Skip to content

Commit

Permalink
move build configuration into pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Sep 14, 2022
1 parent cfe744a commit 6005f14
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 108 deletions.
9 changes: 9 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# flake8 does not support pyproject.toml (https://github.com/PyCQA/flake8/issues/234)

[flake8]
select = F, W, E101, E111, E112, E113, E401, E402, E501, E711, E722
# We should set max line length to 88 eventually
max-line-length = 130
exclude =
docs,
ignore = E203, W503, W504, W605
10 changes: 4 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import sphinx
import stsci_rtd_theme
import sphinx_astropy

import tomli

def setup(app):
try:
Expand All @@ -30,8 +30,6 @@ def setup(app):
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
Expand All @@ -40,8 +38,8 @@ def setup(app):
sys.path.insert(0, os.path.abspath('roman_datamodels/'))

# -- General configuration ------------------------------------------------
conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
setup_cfg = dict(conf.items('metadata'))
conf = tomli.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 @@ -127,7 +125,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
81 changes: 80 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,85 @@
[project]
name = 'roman_datamodels'
description = 'data models supporting calibration of the Nancy Grace Roman Space Telescope'
readme = 'README.md'
requires-python = '>=3.8'
license = { file = 'LICENSE' }
authors = [{ name = 'STScI', email = '[email protected]' }]
classifiers = [
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Astronomy',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
]
dependencies = [
'asdf >=2.13.0',
'asdf-astropy >=0.2.0',
'psutil >=5.7.2',
'numpy',
'astropy >=5.0.4',
'rad >=0.13.1',
'asdf-standard >=1.0.3',
]
dynamic = ['version']

[project.optional-dependencies]
test = [
'pytest >=6.0.0',
'pytest-doctestplus',
'pytest-openfiles >=0.5.0',
'pytest-doctestplus >=0.10.0',
]
aws = [
'stsci-aws-utils >= 0.1.2',
]

[project.urls]
'issues' = 'https://github.com/spacetelescope/roman_datamodels/issues'
'repository' = 'https://github.com/spacetelescope/roman_datamodels'

[project.entry-points]
'asdf.extensions' = { roman_datamodels = 'roman_datamodels.integration:get_extensions' }

[build-system]
requires = ["setuptools>=42", "setuptools_scm[toml]>=3.4", "wheel"]
requires = ["setuptools >=60", "setuptools_scm[toml] >=3.4", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/roman_datamodels/_version.py"

[tool.setuptools.packages.find]
where = ['src']

[tool.pytest.ini_options]
minversion = 4.6
doctest_plus = true
doctest_rst = true
text_file_format = 'rst'
addopts = '--show-capture=no --open-files'
testpaths = ['tests']

[tool.coverage.run]
omit = [
'roman_datamodels/pyproject.toml',
'roman_datamodels/tests',
'roman_datamodels/src/roman_datamodels/stnode_test.py',
# And list these again for running against installed version
'*/roman_datamodels/pyproject.toml',
'*/roman_datamodels/tests',
'*/roman_datamodels/src/roman_datamodels/mktest.py',
'*/roman_datamodels/src/roman_datamodels/stnode_test.py',
]

[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
'pragma: no cover',
# Don't complain about packages we have installed
'except ImportError',
# Don't complain if tests don't hit assertions
'raise AssertionError',
'raise NotImplementedError',
# Don't complain about script hooks
'def main\(.*\):',
'if __name__ == \'__main__\':',
]
95 changes: 0 additions & 95 deletions setup.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions setup.py

This file was deleted.

0 comments on commit 6005f14

Please sign in to comment.