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 Jun 2, 2022
1 parent 9492298 commit 317da7a
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 87 deletions.
18 changes: 8 additions & 10 deletions docs/source/conf.py
@@ -1,11 +1,10 @@
from pathlib import Path
import os
import importlib
import sys
from configparser import ConfigParser
from datetime import datetime
import importlib
from pathlib import Path

import stsci_rtd_theme
import toml as toml


def setup(app):
Expand All @@ -19,16 +18,15 @@ def setup(app):

# Modules that automodapi will document need to be available
# in the path:
sys.path.insert(0, str(REPO_ROOT/"src"/"stpipe"))
sys.path.insert(0, str(REPO_ROOT / "src" / "stpipe"))

# Read the package's setup.cfg so that we can use relevant
# Read the package's `pyproject.toml` so that we can use relevant
# values here:
conf = ConfigParser()
conf.read(REPO_ROOT/"setup.cfg")
setup_metadata = dict(conf.items("metadata"))
conf = toml.load(str(REPO_ROOT / 'pyproject.toml'))
setup_metadata = conf['project']

project = setup_metadata["name"]
author = setup_metadata["author"]
author = setup_metadata["authors"][0]['name']
copyright = f"{datetime.now().year}, {author}"

package = importlib.import_module(setup_metadata["name"])
Expand Down
90 changes: 87 additions & 3 deletions pyproject.toml
@@ -1,6 +1,90 @@
[project]
name = 'stpipe'
description = 'Framework for calibration pipeline software'
readme = 'README.md'
requires-python = '>=3.7'
license = { file = 'LICENSE' }
authors = [{ name = 'STScI' }]
classifiers = [
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Astronomy',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
]
dependencies = [
'asdf>=2.7.1',
'crds>=7.4.1.3',
'astropy>=5.0.4',
'stdatamodels>=0.2.4',
]
dynamic = ['version']

[project.optional-dependencies]
docs = [
'sphinx',
'sphinx-automodapi',
'numpydoc',
'sphinx-rtd-theme',
'stsci-rtd-theme',
]
lint = [
'pyproject-flake8',
]
test = [
'pytest >=4.6.0',
'pytest-doctestplus',
'pytest-openfiles >=0.5.0',
]

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

[project.entry-points]
asdf_extensions = { stpipe = 'stpipe.integration:StpipeExtension' }
console_scripts = { stpipe = 'stpipe.cli.main:main' }

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

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

[tool.setuptools]
zip-safe = true

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

[tool.flake8]
select = ['F', 'W', 'E101', 'E111', 'E112', 'E113', 'E401', 'E402', 'E501', 'E711', 'E722']
# We should set max line length lower eventually
max-line-length = 130
exclude = [
'docs',
'src/stpipe/extern',
]
ignore = [
'E203',
'E503',
'W504',
'W605',
]

[tool.pytest]
minversion = 4.6
doctest_plus = true
doctest_rst = true
text_file_format = 'rst'
addopts = '--open-files'
norecursedirs = [
'src/stpipe/extern',
]
testpaths = [
'tests',
]
74 changes: 0 additions & 74 deletions setup.cfg

This file was deleted.

0 comments on commit 317da7a

Please sign in to comment.