Skip to content

Commit

Permalink
move build configuration from setup.cfg to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed May 18, 2022
1 parent 605f145 commit b3a786c
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 229 deletions.
11 changes: 5 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import importlib
import sys
import os

import toml
from packaging.version import Version
from configparser import ConfigParser

Expand All @@ -28,9 +30,6 @@ def setup(app):
except AttributeError:
app.add_stylesheet("stsci.css")

conf = ConfigParser()


# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand All @@ -39,8 +38,8 @@ 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'))
conf = toml.load('../pyproject.toml')
setup_cfg = conf['project']

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.3'
Expand Down Expand Up @@ -130,7 +129,7 @@ def check_sphinx_version(expected_version):

# General information about the project
project = setup_cfg['name']
author = setup_cfg['author']
author = setup_cfg['authors'][0]['name']
copyright = '{0}, {1}'.format(datetime.datetime.now().year, author)

# The version info for the project you're documenting, acts as replacement for
Expand Down
177 changes: 172 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,177 @@
[project]
name = 'jwst'
version = '0.0.0'
description = 'Library for calibration of science observations from the James Webb Space Telescope'
readme = 'README.md'
requires-python = '>=3.8'
license = { file = 'LICENSE' }
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.8',
'Programming Language :: Python :: 3.9',
]
dependencies = [
'asdf >=2.11.1',
'asdf-astropy >=0.2.1',
'astropy >=5.0.4',
'BayesicFitting >=2.7.2',
'crds >=11.13.1',
'drizzle >=1.13.4',
'gwcs >=0.18.0',
'jsonschema >=4.0.1',
'numpy >=1.20',
'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',
'spherical-geometry >=1.2.22',
'stcal >=0.7.1',
'stdatamodels >=0.4.2, <1.0',
'stpipe >=0.3.3, <1.0',
'stsci.image >=2.3.5',
'stsci.imagestats >=1.6.3',
'tweakwcs >=0.7.2',
]

[project.optional-dependencies]
aws = ['stsci-aws-utils >=0.1.2']
docs = [
'packaging',
'matplotlib',
'mistune ~=0.8.4',
'sphinx',
'sphinx-asdf >=0.1.1',
'sphinx-astropy',
'sphinx-automodapi',
'sphinx-rtd-theme',
'stsci-rtd-theme',
'toml',
]
sdp = [
'jplephem >=2.9',
'pymssql',
'pysiaf',
]
test = [
'ci-watson >=0.5.0',
'codecov >=1.6.0',
'colorama >=0.4.1',
'flake8 >=3.6.0',
'getch >=1.0.0',
'pyproject-flake8',
'pytest >=6.0.0',
'pytest-cov >=2.9.0',
'pytest-doctestplus >=0.10.0',
'pytest-openfiles >=0.5.0',
'requests_mock >=1.0',
]

[project.urls]
'documentation' = 'https://jwst-pipeline.readthedocs.io/en/stable/'
'repository' = 'https://github.com/spacetelescope/jwst'
'tracker' = 'https://github.com/spacetelescope/jwst/issues'

[project.entry-points]
'asdf.extensions' = { jwst_pipeline = 'jwst.transforms.integration:get_extensions' }
asdf_extensions = { jwst_datamodel = 'jwst.datamodels.extension:DataModelExtension' }
'asdf.resource_mappings' = { jwst_pipeline = 'jwst.transforms.integration:get_resource_mappings' }
'stpipe.steps' = { jwst = 'jwst.stpipe.integration:get_steps' }
pytest11 = { report_crds_context = 'pytest_crds.plugin' }

[build-system]
requires = [
"setuptools>=42",
"setuptools_scm[toml]>=3.4",
"wheel",
"oldest-supported-numpy",
'setuptools>=42',
'setuptools_scm[toml]>=3.4',
'wheel',
'oldest-supported-numpy',
]
build-backend = "setuptools.build_meta"
build-backend = 'setuptools.build_meta'

[tool.setuptools_scm]

[tool.setuptools]
packages = ['jwst']

[tool.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', # Missing whitespace after ',', ';', or ':'
'E241', # Multiple spaces after ','
'W503', # Line break occurred before a binary operator
'W504', # Line break occurred after a binary operator
]

[tool.pytest]
minversion = 6.0
norecursedirs = [
'docs/_build',
'docs/exts',
'jwst/timeconversion',
'jwst/associations/tests/data',
'scripts',
'.tox',
]
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 --open-files --report-crds-context'
filterwarnings = ['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/*',
# And list these again for running against installed version
'*/jwst/conftest.py',
'*/jwst/setup.py',
'*/jwst/tests/test*',
'*/jwst/regtest/test*',
'*/jwst/*/tests/*',
'*/docs/*',
] }
report = { exclude_lines = [
'pragma: no cover',
'if self.debug:',
'except ImportError',
'raise AssertionError',
'raise NotImplementedError',
'if __name__ == "__main__":',
] }
173 changes: 0 additions & 173 deletions setup.cfg

This file was deleted.

Loading

0 comments on commit b3a786c

Please sign in to comment.