Skip to content

Commit 1b42e2c

Browse files
move build configuration into pyproject.toml
1 parent 4b19990 commit 1b42e2c

File tree

5 files changed

+203
-159
lines changed

5 files changed

+203
-159
lines changed

MANIFEST.in

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
include README.rst TESTING install clean setup.py setup_data.py setup.cfg
2-
recursive-include envs *
1+
include README.rst TESTING install clean setup.py setup_data.py pyproject.toml recursive-include envs *

pyproject.toml

+162-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,167 @@
1+
[project]
2+
name = "crds"
3+
description = "Calibration Reference Data System, HST/JWST/Roman reference file management"
4+
authors = [{ name = "STScI CRDS s/w developers" }]
5+
classifiers = [
6+
"Intended Audience :: Science/Research",
7+
"License :: OSI Approved :: BSD License",
8+
"Operating System :: POSIX :: Linux",
9+
"Operating System :: MacOS :: MacOS X",
10+
"Programming Language :: Python :: 3",
11+
"Topic :: Scientific/Engineering :: Astronomy",
12+
]
13+
dependencies = [
14+
"astropy",
15+
"numpy",
16+
"filelock",
17+
"asdf",
18+
"requests",
19+
"lxml",
20+
"parsley",
21+
]
22+
dynamic = ["version"]
23+
24+
[project.readme]
25+
file = "README.rst"
26+
content-type = "text/x-rst"
27+
28+
[project.license]
29+
file = "LICENSE"
30+
content-type = "text/plain"
31+
32+
[project.urls]
33+
homepage = "https://github.com/spacetelescope/crds"
34+
35+
[project.optional-dependencies]
36+
jwst = ["jwst"]
37+
roman = ["roman_datamodels"]
38+
submission = ["requests", "lxml", "parsley"]
39+
dev = ["ipython", "jupyterlab", "ansible", "helm", "nose-cprof", "coverage"]
40+
test = [
41+
"lockfile",
42+
"mock",
43+
"nose",
44+
"pytest",
45+
"pylint",
46+
"flake8",
47+
"bandit",
48+
"coverage",
49+
]
50+
docs = [
51+
"sphinx",
52+
"sphinx_rtd_theme",
53+
"docutils",
54+
"sphinx_automodapi",
55+
"sphinx-tabs",
56+
]
57+
aws = ["boto3", "awscli"]
58+
synphot = ["stsynphot", "pysynphot"]
59+
160
[build-system]
2-
requires = ["setuptools>=42", "setuptools_scm[toml]>=3.4", "wheel"]
61+
requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4", "wheel"]
362
build-backend = "setuptools.build_meta"
463

64+
[tool.setuptools]
65+
platforms = ["Linux", "OS-X"]
66+
zip-safe = false
67+
packages = [
68+
"crds",
69+
"crds.bestrefs",
70+
"crds.certify",
71+
"crds.certify.validators",
72+
"crds.client",
73+
"crds.core",
74+
"crds.io",
75+
"crds.submit",
76+
"crds.misc",
77+
"crds.misc.synphot",
78+
"crds.refactoring",
79+
"crds.hst",
80+
"crds.jwst",
81+
"crds.tobs",
82+
"crds.roman",
83+
"crds.tests",
84+
]
85+
include-package-data = false
86+
87+
[tool.setuptools.package-dir]
88+
crds = "crds"
89+
"crds.bestrefs" = "crds/bestrefs"
90+
"crds.certify" = "crds/certify"
91+
"crds.certify.validators" = "crds/certify/validators"
92+
"crds.client" = "crds/client"
93+
"crds.core" = "crds/core"
94+
"crds.io" = "crds/io"
95+
"crds.submit" = "crds/submit"
96+
"crds.misc" = "crds/misc"
97+
"crds.misc.synphot" = "crds/misc/synphot"
98+
"crds.refactoring" = "crds/refactoring"
99+
"crds.hst" = "crds/hst"
100+
"crds.jwst" = "crds/jwst"
101+
"crds.roman" = "crds/roman"
102+
"crds.tobs" = "crds/tobs"
103+
"crds.tests" = "crds/tests"
104+
105+
[tool.setuptools.package-data]
106+
"crds.hst" = [
107+
"*.dat",
108+
"*.yaml",
109+
"*.json",
110+
"tpns/*.tpn",
111+
"tpns/includes/*.tpn",
112+
"specs/*.spec",
113+
"specs/*.rmap",
114+
"specs/*.json",
115+
]
116+
"crds.jwst" = [
117+
"*.dat",
118+
"*.yaml",
119+
"*.json",
120+
"tpns/*.tpn",
121+
"tpns/includes/*.tpn",
122+
"specs/*.spec",
123+
"specs/*.rmap",
124+
"specs/*.json",
125+
]
126+
"crds.roman" = [
127+
"*.dat",
128+
"*.yaml",
129+
"*.json",
130+
"tpns/*.tpn",
131+
"tpns/includes/*.tpn",
132+
"specs/*.spec",
133+
"specs/*.rmap",
134+
"specs/*.json",
135+
]
136+
"crds.tobs" = [
137+
"*.dat",
138+
"*.yaml",
139+
"*.json",
140+
"tpns/*.tpn",
141+
"tpns/includes/*.tpn",
142+
"specs/*.spec",
143+
"specs/*.rmap",
144+
"specs/*.json",
145+
]
146+
147+
[tool.distutils.nosetests]
148+
verbosity = 2
149+
detailed-errors = 1
150+
where = "crds"
151+
with-doctest = 1
152+
doctest-tests = 1
153+
doctest-options = "+ELLIPSIS,+NORMALIZE_WHITESPACE,+IGNORE_EXCEPTION_DETAIL"
154+
logging-clear-handlers = 1
155+
156+
[tool.pytest.ini_options]
157+
python_files = ["pytest_test_*"]
158+
python_classes = ["*PyTests"]
159+
python_functions = ["pytest_test_*"]
160+
markers = [
161+
"smoke: critical tests required to pass for the system to work.",
162+
"roman: all tests specific to the ROMAN Space Telescope mission.",
163+
"distortion: all tests related to distortion filetype",
164+
]
165+
5166
[tool.setuptools_scm]
6167
write_to = "crds/_version.py"

setup.py

+3-112
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,8 @@
11
#! /usr/bin/env python
2-
import sys
32
import glob
43

5-
from distutils.core import setup
4+
from setuptools import setup
65

7-
import setuptools
8-
9-
# Define data files included by each observatory package relative
10-
# to each observatory/mission directory.
11-
STD_MISSION_FILES = [
12-
'*.dat',
13-
'*.yaml',
14-
'*.json',
15-
'tpns/*.tpn',
16-
'tpns/includes/*.tpn',
17-
'specs/*.spec',
18-
'specs/*.rmap',
19-
'specs/*.json',
20-
]
21-
22-
setup_pars = {
23-
"packages" : [
24-
'crds',
25-
'crds.bestrefs',
26-
'crds.certify',
27-
'crds.certify.validators',
28-
'crds.client',
29-
'crds.core',
30-
'crds.io',
31-
'crds.submit',
32-
33-
'crds.misc',
34-
'crds.misc.synphot',
35-
'crds.refactoring',
36-
37-
'crds.hst',
38-
'crds.jwst',
39-
'crds.tobs',
40-
'crds.roman',
41-
42-
'crds.tests',
43-
],
44-
"package_dir" : {
45-
'crds' : 'crds',
46-
'crds.bestrefs' : 'crds/bestrefs',
47-
'crds.certify' : 'crds/certify',
48-
'crds.certify.validators' : 'crds/certify/validators',
49-
'crds.client' : 'crds/client',
50-
'crds.core' : 'crds/core',
51-
'crds.io' : 'crds/io',
52-
'crds.submit' : 'crds/submit',
53-
54-
'crds.misc' : 'crds/misc',
55-
'crds.misc.synphot' : 'crds/misc/synphot',
56-
'crds.refactoring' : 'crds/refactoring',
57-
58-
'crds.hst' : 'crds/hst',
59-
'crds.jwst' : 'crds/jwst',
60-
'crds.roman' : 'crds/roman',
61-
'crds.tobs' : 'crds/tobs',
62-
63-
'crds.tests' : 'crds/tests',
64-
},
65-
"package_data" : {
66-
'crds.hst': STD_MISSION_FILES,
67-
'crds.jwst': STD_MISSION_FILES,
68-
'crds.roman': STD_MISSION_FILES,
69-
'crds.tobs': STD_MISSION_FILES,
70-
},
71-
"scripts" : glob.glob("scripts/*"),
72-
}
73-
74-
TEST_DEPS = ["lockfile", "mock", "nose", "pytest", "pylint", "flake8", "bandit", "coverage",]
75-
76-
SUBMISSION_DEPS = ["requests", "lxml", "parsley"]
77-
78-
setup(name="crds",
79-
provides=["crds"],
80-
use_scm_version={"write_to": "crds/_version.py"},
81-
description="Calibration Reference Data System, HST/JWST/Roman reference file management",
82-
long_description=open('README.rst').read(),
83-
author="STScI CRDS s/w developers",
84-
url="https://hst-crds.stsci.edu",
85-
license="BSD",
86-
python_requires=">=3.8",
87-
setup_requires=["setuptools_scm"],
88-
install_requires=["astropy", "numpy", "filelock", "asdf"] + SUBMISSION_DEPS,
89-
extras_require={
90-
"jwst": ["jwst"],
91-
"roman" : ["roman_datamodels"],
92-
"submission": ["requests", "lxml", "parsley"],
93-
"dev" : ["ipython","jupyterlab","ansible","helm",
94-
"nose-cprof", "coverage"],
95-
"test" : TEST_DEPS,
96-
"docs" : ["sphinx","sphinx_rtd_theme","docutils","sphinx_automodapi","sphinx-tabs"],
97-
"aws" : ["boto3","awscli"],
98-
"synphot": ["stsynphot", "pysynphot"],
99-
},
100-
tests_require=TEST_DEPS,
101-
zip_safe=False,
102-
classifiers=[
103-
'Intended Audience :: Science/Research',
104-
'License :: OSI Approved :: BSD License',
105-
'Operating System :: POSIX :: Linux',
106-
'Operating System :: MacOS :: MacOS X',
107-
'Programming Language :: Python :: 3',
108-
'Topic :: Scientific/Engineering :: Astronomy',
109-
],
110-
project_urls={
111-
'Documentation' : 'https://hst-crds.stsci.edu/static/users_guide/index.html',
112-
'Bug Reports': 'https://github.com/spacetelescope/crds/issues/',
113-
'Source': 'https://github.com/spacetelescope/crds/',
114-
'Help': 'https://hsthelp.stsci.edu/',
115-
},
116-
**setup_pars
6+
setup(
7+
scripts=glob.glob("scripts/*"),
1178
)

setup_data.py

+37-34
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,43 @@
55
from distutils.core import setup
66

77
setup_pars = {
8-
"packages" : [
9-
'crds',
10-
'crds.tests',
8+
"packages": [
9+
"crds",
10+
"crds.tests",
11+
],
12+
"package_dir": {
13+
"crds": "crds",
14+
"crds.tests": "crds/tests",
15+
},
16+
"package_data": {
17+
"crds.tests": [
18+
"data/*",
1119
],
12-
"package_dir" : {
13-
'crds' : 'crds',
14-
'crds.tests' : 'crds/tests',
15-
},
16-
"package_data" : {
17-
'crds.tests' : [
18-
'data/*',
19-
],
20-
},
21-
}
20+
},
21+
}
2222

23-
import crds # local subdirectory... ew...
23+
import crds # local subdirectory... ew...
2424

25-
setup(name="crds_test_data",
26-
provides=["crds.tests.data",],
27-
version=crds.__version__,
28-
description="Calibration Reference Data System, HST/JWST reference file management (test data)",
29-
author="Todd Miller",
30-
author_email="[email protected]",
31-
url="https://hst-crds.stsci.edu",
32-
license="BSD",
33-
requires=["numpy","astropy"],
34-
classifiers=[
35-
'Intended Audience :: Science/Research',
36-
'License :: OSI Approved :: BSD License',
37-
'Operating System :: OS-X, Linux',
38-
'Programming Language :: Python :: 2.7',
39-
# 'Programming Language :: Python :: 3',
40-
'Programming Language :: Python :: Implementation :: CPython',
41-
'Topic :: Scientific/Engineering :: Astronomy',
42-
],
43-
**setup_pars
44-
)
25+
setup(
26+
name="crds_test_data",
27+
provides=[
28+
"crds.tests.data",
29+
],
30+
version=crds.__version__,
31+
description="Calibration Reference Data System, HST/JWST reference file management (test data)",
32+
author="Todd Miller",
33+
author_email="[email protected]",
34+
url="https://hst-crds.stsci.edu",
35+
license="BSD",
36+
requires=["numpy", "astropy"],
37+
classifiers=[
38+
"Intended Audience :: Science/Research",
39+
"License :: OSI Approved :: BSD License",
40+
"Operating System :: OS-X, Linux",
41+
"Programming Language :: Python :: 2.7",
42+
# 'Programming Language :: Python :: 3',
43+
"Programming Language :: Python :: Implementation :: CPython",
44+
"Topic :: Scientific/Engineering :: Astronomy",
45+
],
46+
**setup_pars
47+
)

test/pytest.ini

-10
This file was deleted.

0 commit comments

Comments
 (0)