|
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_devices |
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 | | - |
41 | 1 | import os |
42 | 2 | from setuptools import setup |
43 | 3 |
|
44 | 4 | try: |
45 | 5 | from setuptools_conda import dist_conda |
| 6 | + CMDCLASS = {"dist_conda": dist_conda} |
46 | 7 | except ImportError: |
47 | | - dist_conda = None |
48 | | - |
49 | | -SETUP_REQUIRES = ['setuptools', 'setuptools_scm'] |
| 8 | + CMDCLASS = {} |
50 | 9 |
|
51 | | -INSTALL_REQUIRES = [ |
52 | | - "labscript_utils >= 2.13.2", |
53 | | - "blacs >= 2.7.0", |
54 | | - "labscript >= 2.6.0", |
55 | | - "qtutils >=2.2.3", |
56 | | - "zprocess >=2.18.0", |
57 | | - "numpy >=1.15.1", |
58 | | - "pyserial", |
59 | | - "pillow", |
60 | | - "PyDAQmx", |
61 | | - "PyNIVision", |
62 | | - "spinapi", |
63 | | -] |
| 10 | +VERSION_SCHEME = { |
| 11 | + "version_scheme": os.getenv("SCM_VERSION_SCHEME", "guess-next-dev"), |
| 12 | + "local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"), |
| 13 | +} |
64 | 14 |
|
65 | 15 | setup( |
66 | | - name='labscript_devices', |
67 | | - use_scm_version=True, |
68 | | - description="Device drivers for the labscript suite", |
69 | | - long_description=open('README.md').read(), |
70 | | - long_description_content_type='text/markdown', |
71 | | - author='The labscript suite community', |
72 | | - author_email='[email protected] ', |
73 | | - url='http://labscriptsuite.org', |
74 | | - license="BSD", |
75 | | - packages=["labscript_devices"], |
76 | | - zip_safe=False, |
77 | | - setup_requires=SETUP_REQUIRES, |
78 | | - include_package_data=True, |
79 | | - python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5", |
80 | | - install_requires=INSTALL_REQUIRES if 'CONDA_BUILD' not in os.environ else [], |
81 | | - cmdclass={'dist_conda': dist_conda} if dist_conda is not None else {}, |
82 | | - command_options={ |
83 | | - 'dist_conda': { |
84 | | - 'pythons': (__file__, ['3.6', '3.7', '3.8']), |
85 | | - 'platforms': (__file__, ['linux-64', 'win-32', 'win-64', 'osx-64']), |
86 | | - 'force_conversion': (__file__, True), |
87 | | - }, |
88 | | - }, |
| 16 | + use_scm_version=VERSION_SCHEME, |
| 17 | + cmdclass=CMDCLASS, |
89 | 18 | ) |
0 commit comments