From 01b36217720c76f2c7f11511e18fc59fc2f2145d Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 13 Apr 2023 08:32:32 -0400 Subject: [PATCH] move build configuration from `setup.cfg` to `pyproject.toml` --- .flake8 | 25 ++ CHANGES.rst | 3 +- CONTRIBUTING.md | 12 +- MANIFEST.in | 1 - docs/conf.py | 19 +- docs/jwst/user_documentation/introduction.rst | 6 +- .../tests/data/sources/reduce_dataset.ipynb | 2 +- jwst/scripts/verify_install_requires.py | 2 +- pyproject.toml | 304 +++++++++++++++++- setup.cfg | 195 ----------- setup.py | 45 +-- tox.ini | 2 +- 12 files changed, 340 insertions(+), 276 deletions(-) create mode 100644 .flake8 delete mode 100644 setup.cfg diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000000..d141fee4cb6 --- /dev/null +++ b/.flake8 @@ -0,0 +1,25 @@ +# flake8 does not support pyproject.toml (https://github.com/PyCQA/flake8/issues/234) + +[flake8] +select = F, W, E, C +# We should set max line length lower eventually +max-line-length = 130 +exclude = + jwst/extern, + docs, + jwst/associations, + jwst/fits_generator, + .tox, + .eggs, + build +per-file-ignores = + jwst/ramp_fitting/tests/compare_cr_navg_files.py:E + jwst/ramp_fitting/tests/compare_crs.py:E + jwst/ramp_fitting/tests/compare_cr_files.py:E + jwst/ramp_fitting/tests/create_cube.py:E + jwst/ramp_fitting/tests/mc_3d.py:E +ignore = E231,E241,W503,W504 +; E231, # Missing whitespace after ',', ';', or ':' +; E241, # Multiple spaces after ',' +; W503, # Line break occurred before a binary operator +; W504, # Line break occurred after a binary operator diff --git a/CHANGES.rst b/CHANGES.rst index e67339ede9b..5678e918406 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -73,6 +73,8 @@ other - Close files left open in test suite [#7599] +- Moved build configuration from ``setup.cfg`` to ``pyproject.toml`` to support PEP621 [#6847] + pathloss -------- @@ -175,7 +177,6 @@ resample_spec - Update ``resample_spec`` to be skipped for NIRSpec fixed slit MultiSlitModel rateints input, because that mode is not allowed. [#7516] - 1.10.0 (2023-04-03) =================== diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 81196bf456f..23fd25e57ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -219,7 +219,7 @@ successfully (i.e, produces a working .html file). This happens on the CI when open a pull request, but it is a good idea to build the documentation yourself locally as well. Before you do this, you will need to make sure you have the correct dependencies installed in your current environment. All of these optional dependencies are specified -in `setup.cfg` and include things like the correct version of sphinx, as well as the +in `pyproject.toml` and include things like the correct version of sphinx, as well as the necessary sphinx themes that the project uses. These do not install automatically when you install `jwst` unless directly specified. To do this, while in the top level directory of `jwst` on your my_feature branch: @@ -266,7 +266,7 @@ for running tests. >> pip install -e ".[test]" -This will install the optional 'test' dependencies specified in `setup.cfg` that +This will install the optional 'test' dependencies specified in `pyproject.toml` that don't install by default. The package `pytest` is one of these and is what's used to run the tests. `pytest` searches through all the directories in your repository (underneath the directory from which it was invoked command line) and looks for any @@ -324,14 +324,14 @@ in your environment, you can check their versions by doing: >> conda list When opening up two dependent pull requests in `jwst` and one of its dependency packages, -unit tests will not pass on the CI because the setup.cfg file in `jwst` points to the +unit tests will not pass on the CI because the `pyproject.toml` file in `jwst` points to the last released version of `stcal`, and stcal points to the last version of `jwst`, so the -issue becomes circular. What you will need to do is modify the setup.cfg files in both +issue becomes circular. What you will need to do is modify the `pyproject.toml` files in both packages to point to the other to demonstrate that CI tests pass (and make a comment noting this in your PR), and then change it back before the PR is merge so that changes -to setup.cfg are not merged into master/main. In your `jwst` branch, to point to your +to `pyproject.toml` are not merged into master/main. In your `jwst` branch, to point to your branch in the dependent package (in this example `stcal`), change the required `stcal` -version in setup.cfg to: +version in `pyproject.toml` to: >> stcal @ git+https://github.com//stcal.git@ diff --git a/MANIFEST.in b/MANIFEST.in index 887ff5cd0f7..b368740c0bc 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,5 @@ include README.md include CHANGES.rst -include setup.cfg include LICENSE include pyproject.toml diff --git a/docs/conf.py b/docs/conf.py index 69bfb9d0681..ddc2c8548dc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,12 @@ import importlib import sys import os +from pathlib import Path + +if sys.version_info < (3, 11): + import tomli as tomllib +else: + import tomllib from packaging.version import Version from configparser import ConfigParser @@ -39,9 +45,6 @@ def setup(app): sys.path.insert(0, os.path.abspath('exts/')) # -- General configuration ------------------------------------------------ -conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')]) -setup_cfg = dict(conf.items('metadata')) - # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.3' @@ -131,16 +134,18 @@ def check_sphinx_version(expected_version): # General information about the project -project = setup_cfg['name'] -author = setup_cfg['author'] -copyright = '{0}, {1}'.format(datetime.datetime.now().year, author) +with open(Path(__file__).parent.parent / "pyproject.toml", "rb") as metadata_file: + metadata = tomllib.load(metadata_file)['project'] +project = metadata['name'] +author = metadata["authors"][0]["name"] +copyright = f'{datetime.datetime.today().year}, {author}' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -package = importlib.import_module(setup_cfg['name']) +package = importlib.import_module(metadata['name']) try: version = package.__version__.split('-', 1)[0] # The full version, including alpha/beta/rc tags. diff --git a/docs/jwst/user_documentation/introduction.rst b/docs/jwst/user_documentation/introduction.rst index 759e75c795e..bba3a80ab1d 100644 --- a/docs/jwst/user_documentation/introduction.rst +++ b/docs/jwst/user_documentation/introduction.rst @@ -108,9 +108,9 @@ There is also a `pipeline` module, where the `pipeline` classes, consisting of **Dependencies** -The `jwst` package has several dependencies (see the `setup.cfg` file in the -top-level directory of `jwst` for a full list). Some notable dependencies -include: +The `jwst` package has several dependencies (see the `pyproject.toml` file +in the top-level directory of `jwst` for a full list). Some notable +dependencies include: **asdf** diff --git a/jwst/exp_to_source/tests/data/sources/reduce_dataset.ipynb b/jwst/exp_to_source/tests/data/sources/reduce_dataset.ipynb index d503ed8a0a2..c136db2a8f7 100644 --- a/jwst/exp_to_source/tests/data/sources/reduce_dataset.ipynb +++ b/jwst/exp_to_source/tests/data/sources/reduce_dataset.ipynb @@ -188,7 +188,7 @@ "text": [ "============================= test session starts ==============================\n", "platform linux -- Python 3.6.7, pytest-3.9.1, py-1.7.0, pluggy-0.8.0\n", - "rootdir: /internal/1/astropy/jwst, inifile: setup.cfg\n", + "rootdir: /internal/1/astropy/jwst, inifile: pyproject.toml\n", "plugins: requests-mock-1.5.2, remotedata-0.3.0, openfiles-0.3.0, doctestplus-0.1.3, arraydiff-0.2, ci-watson-0.3\n", "\n", "========================= no tests ran in 0.00 seconds =========================\n" diff --git a/jwst/scripts/verify_install_requires.py b/jwst/scripts/verify_install_requires.py index 6fe8724e688..5cbf07e1993 100644 --- a/jwst/scripts/verify_install_requires.py +++ b/jwst/scripts/verify_install_requires.py @@ -11,7 +11,7 @@ def main(): This script is used in a Travis build that doesn't install any test dependencies from the package. This is to verify that all the modules are at least importable with only the dependencies listed in - install_requires in setup.py. + ``pyproject.toml``. This is to prevent adding code to the runtime codebase that have dependencies that are only pulled in via the test dependencies. So for diff --git a/pyproject.toml b/pyproject.toml index 9e3c242f60c..c4b10c44283 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,33 +1,305 @@ +[project] +name = "jwst" +description = "Library for calibration of science observations from the James Webb Space Telescope" +requires-python = ">=3.9" +authors = [ + { name = "JWST calibration pipeline developers" }, +] +classifiers = [ + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Astronomy", + "License :: OSI Approved :: BSD License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", +] +dependencies = [ + "asdf>=2.14.1", + "asdf-transform-schemas>=0.3.0", + "astropy>=5.2", + "BayesicFitting>=3.0.1", + "crds>=11.16.19", + "drizzle>=1.13.7", + "gwcs>=0.18.3", + "numpy>=1.20", + "opencv-python-headless>=4.6.0.66", + "photutils>=1.4.0", + "psutil>=5.7.2", + "poppy>=1.0.2", + "pyparsing>=2.2.1", + "requests>=2.22", + "scikit-image>=0.17.2", + "scipy>=1.6.0,<1.10.0", + "spherical-geometry>=1.2.22", + "stcal>=1.3.7", + "stdatamodels>=1.5.0", + "stpipe>=0.5.0", + "stsci.image>=2.3.5", + "stsci.imagestats>=1.6.3", + "tweakwcs>=0.8.2", + "asdf-astropy>=0.3.0", + "wiimatch>=0.2.1", + "packaging>19.0", + "importlib-metadata>=4.11.4", +] +dynamic = [ + "version", +] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.license] +file = "LICENSE" +content-type = "text/plain" + +[project.urls] +Homepage = "https://github.com/spacetelescope/jwst" +Tracker = "https://github.com/spacetelescope/jwst/issues" +Documentation = "https://jwst-pipeline.readthedocs.io/en/stable/" +"Source Code" = "https://github.com/spacetelescope/jwst" + +[project.scripts] +adjust_wcs = "jwst.scripts.adjust_wcs:main" +asn_edit = "jwst.scripts.asn_edit:main" +asn_from_list = "jwst.associations.asn_from_list:main" +asn_gather = "jwst.scripts.asn_gather:main" +asn_generate = "jwst.associations.main:main" +asn_make_pool = "jwst.scripts.asn_make_pool:main" +assign_wcs = "jwst.scripts.assign_wcs:main" +collect_pipeline_cfgs = "jwst.scripts.collect_pipeline_cfgs:main" +coron = "jwst.scripts.coron:main" +create_data = "jwst.scripts.create_data:main" +csvconvert = "jwst.csv_tools.csvconvert:CSVConvertScript" +cube_build = "jwst.scripts.cube_build:main" +dark_current = "jwst.scripts.dark_current:main" +data_generate = "jwst.scripts.data_generate:main" +dqinit = "jwst.scripts.dqinit:main" +exp_to_source = "jwst.exp_to_source.main:Main" +flatfieldcorr = "jwst.scripts.flatfieldcorr:main" +fringecorr = "jwst.scripts.fringecorr:main" +ipc = "jwst.scripts.ipc:main" +jump = "jwst.scripts.jump:main" +linearitycorr = "jwst.scripts.linearitycorr:main" +make_header = "jwst.scripts.make_header:main" +migrate_data = "jwst.scripts.migrate_data:main" +move_wcs = "jwst.scripts.move_wcs:main" +okify_regtests = "jwst.scripts.okify_regtests:main" +outlier_detection = "jwst.scripts.outlier_detection:main" +persistencecorr = "jwst.scripts.persistencecorr:main" +photomcorr = "jwst.scripts.photomcorr:main" +pointing_summary = "jwst.scripts.pointing_summary:main" +rampfitcorr = "jwst.scripts.rampfitcorr:main" +refpix = "jwst.scripts.refpix:main" +resample = "jwst.scripts.resample:main" +saturationcorr = "jwst.scripts.saturationcorr:main" +schema_editor = "jwst.scripts.schema_editor:main" +schemadoc = "jwst.scripts.schemadoc:main" +set_telescope_pointing = "jwst.scripts.set_telescope_pointing:main" +"set_telescope_pointing.py" = "jwst.scripts.set_telescope_pointing:deprecated_name" +set_velocity_aberration = "jwst.scripts.set_velocity_aberration:main" +"set_velocity_aberration.py" = "jwst.scripts.set_velocity_aberration:deprecated_name" +straylight = "jwst.scripts.straylight:main" +superbias = "jwst.scripts.superbias:main" +v1_calculate = "jwst.scripts.v1_calculate:main" +verify_install_requires = "jwst.scripts.verify_install_requires:main" +world_coords = "jwst.scripts.world_coords:main" + +[project.entry-points."stpipe.steps"] +jwst = "jwst.stpipe.integration:get_steps" + +[project.entry-points.pytest11] +report_crds_context = "pytest_crds.plugin" + +[project.optional-dependencies] +docs = [ + "matplotlib", + "sphinx", + "sphinx-asdf>=0.1.1", + "sphinx-astropy", + "sphinx-automodapi", + "sphinx-rtd-theme", + "stsci-rtd-theme", + "mistune~=0.8.4", + "tomli; python_version <\"3.11\"", +] +sdp = [ + "jplephem>=2.9", + "pymssql>=2.1.6", + "pysiaf>=0.13.0", +] +test = [ + "ci-watson>=0.5.0", + "colorama>=0.4.1", + "readchar>=3.0", + "ruff", + "pytest>=6.0.0", + "pytest-cov>=2.9.0", + "pytest-doctestplus>=0.10.0", + "requests_mock>=1.0", +] + [build-system] requires = [ - "setuptools>=42", + "setuptools>=61.2", "setuptools_scm[toml]>=3.4", "wheel", "oldest-supported-numpy", ] build-backend = "setuptools.build_meta" +[tool.setuptools] +zip-safe = false + +[tool.setuptools.packages.find] + +[tool.setuptools.package-data] +"*" = [ + "*.asdf", + "*.cfg", + "tests/data/*.csv", + "tests/data/*.ecsv", + "tests/data/*.fits", + "tests/data/**/*.fits", + "*.json", + "tests/data/*.json", + "tests/data/**/*.json", + "tests/data/*.txt", + "*.yaml", + "*.cat", + "*.hdr", +] +"jwst.fits_generator" = [ + "templates/*.inc", + "templates/*.txt", + "tests/okfile/*.prop", +] +"jwst.lib" = [ + "tests/data/*.asdf", + "tests/data/*.db", + "tests/data/*.ecsv", + "tests/data/*.fits", +] +"jwst.associations" = [ + "tests/data/*.py", +] +"jwst.lib.src" = [ + "*.c", +] +"jwst.cube_build.src" = [ + "*.c", +] +"jwst.straylight.src" = [ + "*.c", +] +"jwst.transforms" = [ + "resources/schemas/stsci.edu/jwst_pipeline/*.yaml", +] +"jwst.stpipe.resources" = [ + "schemas/*.yaml", +] + +[tool.build-sphinx] +source-dir = "docs" +build-dir = "docs" +all_files = "1" + +[tool.distutils.upload_docs] +upload-dir = "docs/_build/html" +show-response = 1 + +[tool.pytest.ini_options] +minversion = "6.0" +norecursedirs = [ + "docs/_build", + "docs/exts", + "jwst/timeconversion", + "jwst/associations/tests/data", + "scripts", + ".tox", + ".eggs", + "build", +] +asdf_schema_tests_enabled = true +asdf_schema_validate_default = false +asdf_schema_root = "jwst/transforms/resources/schemas jwst/datamodels/schemas" +junit_family = "xunit2" +inputs_root = "jwst-pipeline" +results_root = "jwst-pipeline-results" +text_file_format = "rst" +doctest_plus = "enabled" +doctest_rst = "enabled" +addopts = "--show-capture=no --report-crds-context" +filterwarnings = [ + "error::ResourceWarning", + "ignore:Models in math_functions:astropy.utils.exceptions.AstropyUserWarning", +] + +[tool.coverage.run] +omit = [ + "jwst/conftest.py", + "jwst/setup.py", + "jwst/tests/test*", + "jwst/regtest/test*", + "jwst/*/tests/*", + "docs/*", + "*/jwst/conftest.py", + "*/jwst/setup.py", + "*/jwst/tests/test*", + "*/jwst/regtest/test*", + "*/jwst/*/tests/*", + "*/docs/*", + "*.rmap", + "*.pmap", +] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "if self.debug:", + "except ImportError", + "raise AssertionError", + "raise NotImplementedError", + "if __name__ == '__main__':", +] +omit = [ + "*.rmap", + "*.pmap", +] + [tool.setuptools_scm] [tool.ruff] -line-length = 130 exclude = [ - 'jwst/extern', - 'docs', - 'jwst/associations', - 'jwst/fits_generator', - '.tox', - '.eggs', - 'build', + "jwst/extern", + "docs", + "jwst/associations", + "jwst/fits_generator", + ".tox", + ".eggs", + "build", ] - ignore = [ - 'E741', # ambiguous variable name + "E741", ] +line-length = 130 [tool.ruff.per-file-ignores] -'jwst/ramp_fitting/tests/compare_cr_navg_files.py' = ['E402'] -'jwst/ramp_fitting/tests/compare_crs.py' = ['E402'] -'jwst/ramp_fitting/tests/compare_cr_files.py' = ['E402'] -'jwst/ramp_fitting/tests/create_cube.py' = ['E402'] -'jwst/ramp_fitting/tests/mc_3d.py' = ['E402'] +"jwst/ramp_fitting/tests/compare_cr_navg_files.py" = [ + "E402", +] +"jwst/ramp_fitting/tests/compare_crs.py" = [ + "E402", +] +"jwst/ramp_fitting/tests/compare_cr_files.py" = [ + "E402", +] +"jwst/ramp_fitting/tests/create_cube.py" = [ + "E402", +] +"jwst/ramp_fitting/tests/mc_3d.py" = [ + "E402", +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 9eeb8e4ecd2..00000000000 --- a/setup.cfg +++ /dev/null @@ -1,195 +0,0 @@ -[metadata] -name = jwst -description = Library for calibration of science observations from the James Webb Space Telescope -long_description = Library for calibration of science observations from the James Webb Space Telescope -long_description_content_type = text/plain -author = JWST calibration pipeline developers -license = BSD-3-Clause -url = https://github.com/spacetelescope/jwst -project_urls = - Tracker = https://github.com/spacetelescope/jwst/issues - Documentation = https://jwst-pipeline.readthedocs.io/en/stable/ - Source Code = https://github.com/spacetelescope/jwst -classifiers = - Intended Audience :: Science/Research - Topic :: Scientific/Engineering :: Astronomy - License :: OSI Approved :: BSD License - Operating System :: MacOS :: MacOS X - Operating System :: POSIX - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - -[options] -zip_safe = False -python_requires = >=3.9 -setup_requires = - setuptools_scm -install_requires = - asdf>=2.14.1 - asdf-transform-schemas>=0.3.0 - astropy>=5.2 - BayesicFitting>=3.0.1 - crds>=11.16.19 - drizzle>=1.13.7 - gwcs>=0.18.3 - numpy>=1.20 - opencv-python-headless>=4.6.0.66 - photutils>=1.4.0 - psutil>=5.7.2 - poppy>=1.0.2 - pyparsing>=2.2.1 - requests>=2.22 - scipy>=1.6.0,<1.10.0 - spherical-geometry>=1.2.22 - stcal>=1.3.7 - stdatamodels>=1.5.0 - stpipe>=0.5.0 - stsci.image>=2.3.5 - stsci.imagestats>=1.6.3 - tweakwcs>=0.8.2 - asdf-astropy>=0.3.0 - wiimatch>=0.2.1 - packaging>19.0 - importlib-metadata>=4.11.4 - -[options.extras_require] -docs = - matplotlib - sphinx - sphinx-asdf>=0.1.1 - sphinx-astropy - sphinx-automodapi - sphinx-rtd-theme - stsci-rtd-theme - mistune~=0.8.4 -sdp = - jplephem>=2.9 - pymssql>=2.1.6 - pysiaf>=0.13.0 -test = - ci-watson>=0.5.0 - colorama>=0.4.1 - readchar>=3.0 - ruff - pytest>=6.0.0 - pytest-cov>=2.9.0 - pytest-doctestplus>=0.10.0 - requests_mock>=1.0 - -[options.entry_points] -stpipe.steps = - jwst = jwst.stpipe.integration:get_steps -pytest11 = - report_crds_context = pytest_crds.plugin -console_scripts = - adjust_wcs = jwst.scripts.adjust_wcs:main - asn_edit = jwst.scripts.asn_edit:main - asn_from_list = jwst.associations.asn_from_list:main - asn_gather = jwst.scripts.asn_gather:main - asn_generate = jwst.associations.main:main - asn_make_pool = jwst.scripts.asn_make_pool:main - assign_wcs = jwst.scripts.assign_wcs:main - collect_pipeline_cfgs = jwst.scripts.collect_pipeline_cfgs:main - coron = jwst.scripts.coron:main - create_data = jwst.scripts.create_data:main - csvconvert = jwst.csv_tools.csvconvert:CSVConvertScript - cube_build = jwst.scripts.cube_build:main - dark_current = jwst.scripts.dark_current:main - data_generate = jwst.scripts.data_generate:main - dqinit = jwst.scripts.dqinit:main - exp_to_source = jwst.exp_to_source.main:Main - flatfieldcorr = jwst.scripts.flatfieldcorr:main - fringecorr = jwst.scripts.fringecorr:main - ipc = jwst.scripts.ipc:main - jump = jwst.scripts.jump:main - linearitycorr = jwst.scripts.linearitycorr:main - make_header = jwst.scripts.make_header:main - migrate_data = jwst.scripts.migrate_data:main - move_wcs = jwst.scripts.move_wcs:main - okify_regtests = jwst.scripts.okify_regtests:main - outlier_detection = jwst.scripts.outlier_detection:main - persistencecorr = jwst.scripts.persistencecorr:main - photomcorr = jwst.scripts.photomcorr:main - pointing_summary = jwst.scripts.pointing_summary:main - rampfitcorr = jwst.scripts.rampfitcorr:main - refpix = jwst.scripts.refpix:main - resample = jwst.scripts.resample:main - saturationcorr = jwst.scripts.saturationcorr:main - schema_editor = jwst.scripts.schema_editor:main - schemadoc = jwst.scripts.schemadoc:main - set_telescope_pointing = jwst.scripts.set_telescope_pointing:main - set_telescope_pointing.py = jwst.scripts.set_telescope_pointing:deprecated_name - set_velocity_aberration = jwst.scripts.set_velocity_aberration:main - set_velocity_aberration.py = jwst.scripts.set_velocity_aberration:deprecated_name - straylight = jwst.scripts.straylight:main - superbias = jwst.scripts.superbias:main - v1_calculate = jwst.scripts.v1_calculate:main - verify_install_requires = jwst.scripts.verify_install_requires:main - world_coords = jwst.scripts.world_coords:main - -[build-sphinx] -source-dir = docs -build-dir = docs -all_files = 1 - -[upload_docs] -upload-dir = docs/_build/html -show-response = 1 - -[tool:pytest] -minversion = 6.0 -norecursedirs = - docs/_build - docs/exts - jwst/timeconversion - jwst/associations/tests/data - scripts - .tox - .eggs - build - venv -asdf_schema_tests_enabled = true -asdf_schema_validate_default = false -asdf_schema_root = jwst/transforms/resources/schemas jwst/datamodels/schemas -junit_family = xunit2 -inputs_root = jwst-pipeline -results_root = jwst-pipeline-results -text_file_format = rst -doctest_plus = enabled -doctest_rst = enabled -addopts = --show-capture=no --report-crds-context -filterwarnings = - error::ResourceWarning - ignore:Models in math_functions:astropy.utils.exceptions.AstropyUserWarning - -[coverage:run] -omit = - jwst/conftest.py - jwst/setup.py - jwst/tests/test* - jwst/regtest/test* - jwst/*/tests/* - docs/* -# And list these again for running against installed version - */jwst/conftest.py - */jwst/setup.py - */jwst/tests/test* - */jwst/regtest/test* - */jwst/*/tests/* - */docs/* - *.rmap - *.pmap - -[coverage:report] -exclude_lines = - pragma: no cover - if self.debug: - except ImportError - raise AssertionError - raise NotImplementedError - if __name__ == '__main__': -omit = - *.rmap - *.pmap diff --git a/setup.py b/setup.py index 9812f5b53b1..245ed5f6aaf 100644 --- a/setup.py +++ b/setup.py @@ -1,44 +1,5 @@ import numpy -from setuptools import setup, find_packages, Extension - -# package_data values are glob patterns relative to each specific subpackage. -package_data = { - "": [ - "*.asdf", - "*.cfg", - "tests/data/*.csv", - "tests/data/*.ecsv", - "tests/data/*.fits", - "tests/data/**/*.fits", - "*.json", - "tests/data/*.json", - "tests/data/**/*.json", - "tests/data/*.txt", - "*.yaml", - "*.cat", - "*.hdr", - ], - "jwst.fits_generator": [ - "templates/*.inc", - "templates/*.txt", - "tests/okfile/*.prop", - ], - "jwst.lib": [ - "tests/data/*.asdf", - "tests/data/*.db", - "tests/data/*.ecsv", - "tests/data/*.fits", - ], - # Include the rules .py files in associations test data - "jwst.associations": ["tests/data/*.py"], - # Include C extensions - "jwst.lib.src": ["*.c"], - "jwst.cube_build.src": ["*.c"], - "jwst.straylight.src": ["*.c"], - # Include the transforms schemas - "jwst.transforms": ["resources/schemas/stsci.edu/jwst_pipeline/*.yaml"], - "jwst.stpipe.resources": ["schemas/*.yaml"], -} +from setuptools import setup, Extension # Setup C module include directories include_dirs = [numpy.get_include()] @@ -47,10 +8,6 @@ define_macros = [("NUMPY", "1")] setup( - use_scm_version=True, - setup_requires=["setuptools_scm"], - packages=find_packages(), - package_data=package_data, ext_modules=[ Extension( "jwst.lib.winclip", diff --git a/tox.ini b/tox.ini index f454b397896..d67432062f2 100644 --- a/tox.ini +++ b/tox.ini @@ -77,7 +77,7 @@ commands_pre = pip freeze commands = pytest \ - cov: --cov=. --cov-config=setup.cfg --cov-report=xml \ + cov: --cov . --cov-report xml --cov-report term-missing \ warnings: -W error \ regtests: --bigdata --slow --basetemp={homedir}/test_outputs \ xdist: -n auto \