Skip to content

Commit 0a4ba42

Browse files
Merge pull request #58 from rpanderson/declarative-setup
Declarative setup
2 parents 26f6892 + f48c86b commit 0a4ba42

File tree

2 files changed

+45
-72
lines changed

2 files changed

+45
-72
lines changed

setup.cfg

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[metadata]
2+
name = labscript
3+
description = The labscript compiler — expressive control of harware-timed experiments
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
11+
Download=https://github.com/labscript-suite/labscript/releases
12+
Tracker=https://github.com/labscript-suite/labscript/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 = find:
26+
python_requires = >=3.6
27+
install_requires =
28+
labscript_utils>=2.14.0
29+
numpy>=1.15
30+
scipy
31+
matplotlib
32+
setup_requires =
33+
setuptools_scm
34+
35+
[dist_conda]
36+
pythons = 3.6, 3.7, 3.8

setup.py

Lines changed: 9 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,19 @@
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
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
3+
from setuptools.dist import Distribution
434

445
try:
456
from setuptools_conda import dist_conda
7+
CMDCLASS = {"dist_conda": dist_conda}
468
except ImportError:
47-
dist_conda = None
48-
49-
SETUP_REQUIRES = ['setuptools', 'setuptools_scm']
9+
CMDCLASS = {}
5010

51-
INSTALL_REQUIRES = [
52-
"labscript_utils >=2.14.0",
53-
"numpy >=1.15",
54-
"scipy",
55-
"matplotlib",
56-
]
11+
VERSION_SCHEME = {
12+
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "guess-next-dev"),
13+
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
14+
}
5715

5816
setup(
59-
name='labscript',
60-
use_scm_version=True,
61-
description="The labscript compiler",
62-
long_description=open('README.md').read(),
63-
long_description_content_type='text/markdown',
64-
author='The labscript suite community',
65-
author_email='labscriptsuite@googlegroups.com ',
66-
url='http://labscriptsuite.org',
67-
license="BSD",
68-
packages=["labscript"],
69-
zip_safe=False,
70-
setup_requires=SETUP_REQUIRES,
71-
include_package_data=True,
72-
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5",
73-
install_requires=INSTALL_REQUIRES if 'CONDA_BUILD' not in os.environ else [],
74-
cmdclass={'dist_conda': dist_conda} if dist_conda is not None else {},
75-
command_options={
76-
'dist_conda': {
77-
'pythons': (__file__, ['3.6', '3.7', '3.8']),
78-
'platforms': (__file__, ['linux-64', 'win-32', 'win-64', 'osx-64']),
79-
'force_conversion': (__file__, True),
80-
},
81-
},
17+
use_scm_version=VERSION_SCHEME,
18+
cmdclass=CMDCLASS,
8219
)

0 commit comments

Comments
 (0)