|
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 |
| - |
41 | 1 | import os
|
42 | 2 | from setuptools import setup
|
43 |
| -from distutils import sysconfig |
44 | 3 |
|
45 | 4 | try:
|
46 | 5 | from setuptools_conda import dist_conda
|
| 6 | + CMDCLASS = {"dist_conda": dist_conda} |
47 | 7 | except ImportError:
|
48 |
| - dist_conda = None |
49 |
| - |
50 |
| -SETUP_REQUIRES = ['setuptools', 'setuptools_scm'] |
| 8 | + CMDCLASS = {} |
51 | 9 |
|
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: |
66 | 11 | # Various packaging schemes are variously unhappy with how to include the .pth file
|
67 | 12 | # in site-packages. Conda is happy if we specify it with data_files and an absolute
|
68 | 13 | # path, whereas basically everything else (pip, setup.py install, bdist,
|
69 | 14 | # 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 = {} |
72 | 17 | 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 | +} |
75 | 25 |
|
76 | 26 | 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, |
107 | 31 | )
|
0 commit comments