Skip to content

Commit 2af52ef

Browse files
Merge pull request #39 from rpanderson/declarative-setup
Declarative setup
2 parents be40c1c + 8979548 commit 2af52ef

File tree

2 files changed

+62
-92
lines changed

2 files changed

+62
-92
lines changed

setup.cfg

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[metadata]
2+
name = labscript_utils
3+
description = Shared utilities for the labscript suite
4+
long_description = file: README.md
5+
long_description_content_type = text/markdown
6+
author = The labscript suite community
7+
author_email = labscriptsuite@googlegroups.com
8+
url = http://labscriptsuite.org
9+
project_urls =
10+
Source Code=https://github.com/labscript-suite/labscript-utils
11+
Download=https://github.com/labscript-suite/labscript-utils/releases
12+
Tracker=https://github.com/labscript-suite/labscript-utils/issues
13+
keywords = experiment control automation
14+
license = BSD
15+
classifiers =
16+
License :: OSI Approved :: BSD License
17+
Programming Language :: Python :: 3 :: Only
18+
Programming Language :: Python :: 3.6
19+
Programming Language :: Python :: 3.7
20+
Programming Language :: Python :: 3.8
21+
22+
[options]
23+
zip_safe = False
24+
include_package_data = True
25+
packages = labscript_utils, labscript_profile
26+
python_requires = >=3.6
27+
install_requires =
28+
importlib_metadata>=1.0 ; python_version<'3.8'
29+
h5py>=2.9
30+
numpy>=1.15
31+
pyqtgraph>=0.11.0rc0 ; python_version>='3.8'
32+
pyqtgraph ; python_version<'3.8'
33+
pywin32 ; sys_platform=='win32'
34+
qtutils>=2.2.3
35+
scipy
36+
setuptools_scm
37+
zprocess>=2.18.0
38+
setup_requires =
39+
setuptools_scm
40+
41+
[options.entry_points]
42+
console_scripts =
43+
labscript-profile-create = labscript_profile.create:create_profile
44+
45+
[dist_conda]
46+
pythons = 3.6, 3.7, 3.8

setup.py

Lines changed: 16 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,31 @@
1-
# USAGE NOTES
2-
#
3-
# Make a PyPI release tarball with:
4-
#
5-
# python setup.py sdist
6-
#
7-
# Upload to test PyPI with:
8-
#
9-
# twine upload --repository-url https://test.pypi.org/legacy/ dist/*
10-
#
11-
# Install from test PyPI with:
12-
#
13-
# pip install --index-url https://test.pypi.org/simple/ labscript_utils
14-
#
15-
# Upload to real PyPI with:
16-
#
17-
# twine upload dist/*
18-
#
19-
# Build conda packages for all platforms (in a conda environment with setuptools_conda
20-
# installed) with:
21-
#
22-
# python setup.py dist_conda
23-
#
24-
# Upoad to your own account (for testing) on anaconda cloud (in a conda environment with
25-
# anaconda-client installed) with:
26-
#
27-
# anaconda upload --skip-existing conda_packages/*/*
28-
#
29-
# (Trickier on Windows, as it won't expand the wildcards)
30-
#
31-
# Upoad to the labscript-suite organisation's channel on anaconda cloud (in a
32-
# conda environment with anaconda-client installed) with:
33-
#
34-
# anaconda upload -u labscript-suite --skip-existing conda_packages/*/*
35-
#
36-
# If you need to rebuild the same version of the package for conda due to a packaging
37-
# issue, you must increment CONDA_BUILD_NUMBER in order to create a unique version on
38-
# anaconda cloud. When subsequently releasing a new version of the package,
39-
# CONDA_BUILD_NUMBER should be reset to zero.
40-
411
import os
422
from setuptools import setup
43-
from distutils import sysconfig
443

454
try:
465
from setuptools_conda import dist_conda
6+
CMDCLASS = {"dist_conda": dist_conda}
477
except ImportError:
48-
dist_conda = None
49-
50-
SETUP_REQUIRES = ['setuptools', 'setuptools_scm']
8+
CMDCLASS = {}
519

52-
INSTALL_REQUIRES = [
53-
"setuptools_scm",
54-
"importlib_metadata >=1.0; python_version < '3.8'",
55-
"pywin32; sys_platform == 'win32'",
56-
"numpy >=1.15",
57-
"scipy",
58-
"h5py >=2.9",
59-
"qtutils >=2.2.3",
60-
"zprocess >=2.18.0",
61-
"pyqtgraph >=0.11.0rc0; python_version >= '3.8'",
62-
"pyqtgraph; python_version < '3.8'",
63-
]
64-
65-
if 'CONDA_BUILD' in os.environ:
10+
if "CONDA_BUILD" in os.environ:
6611
# Various packaging schemes are variously unhappy with how to include the .pth file
6712
# in site-packages. Conda is happy if we specify it with data_files and an absolute
6813
# path, whereas basically everything else (pip, setup.py install, bdist,
6914
# bdist_wheel) is happy if we specify it as package_data one level up.
70-
data_files = [(sysconfig.get_python_lib(), ['labscript-suite.pth'])]
71-
package_data = {}
15+
DATA_FILES = [(sysconfig.get_python_lib(), ["labscript-suite.pth"])]
16+
PACKAGE_DATA = {}
7217
else:
73-
data_files = []
74-
package_data = {'labscript_suite': [os.path.join('..', 'labscript-suite.pth')]}
18+
DATA_FILES = []
19+
PACKAGE_DATA = {"labscript_suite": [os.path.join("..", "labscript-suite.pth")]}
20+
21+
VERSION_SCHEME = {
22+
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "guess-next-dev"),
23+
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
24+
}
7525

7626
setup(
77-
name='labscript_utils',
78-
use_scm_version=True,
79-
description="Shared utilities for the labscript suite",
80-
long_description=open('README.md').read(),
81-
long_description_content_type='text/markdown',
82-
author='The labscript suite community',
83-
author_email='labscriptsuite@googlegroups.com ',
84-
url='http://labscriptsuite.org',
85-
license="BSD",
86-
packages=["labscript_utils", "labscript_profile"],
87-
zip_safe=False,
88-
setup_requires=SETUP_REQUIRES,
89-
include_package_data=True,
90-
package_data=package_data,
91-
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5",
92-
install_requires=INSTALL_REQUIRES if 'CONDA_BUILD' not in os.environ else [],
93-
cmdclass={'dist_conda': dist_conda} if dist_conda is not None else {},
94-
data_files=data_files,
95-
entry_points={
96-
'console_scripts': [
97-
'labscript-profile-create = labscript_profile.create:create_profile',
98-
],
99-
},
100-
command_options={
101-
'dist_conda': {
102-
'pythons': (__file__, ['3.6', '3.7', '3.8']),
103-
'platforms': (__file__, ['linux-64', 'win-32', 'win-64', 'osx-64']),
104-
'force_conversion': (__file__, True),
105-
},
106-
},
27+
use_scm_version=VERSION_SCHEME,
28+
cmdclass=CMDCLASS,
29+
data_files=DATA_FILES,
30+
package_data=PACKAGE_DATA,
10731
)

0 commit comments

Comments
 (0)