Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

follow PEP621 to move build configuration from setup.cfg / setup.py to pyproject.toml #90

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
include README.rst
include CHANGES.rst
include setup.cfg
include LICENSE.txt
include pyproject.toml

include setup.py
include setup.cfg

recursive-include docs *
recursive-include wfc3tools *

Expand Down
20 changes: 13 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@
from configparser import ConfigParser
import datetime
import os
from pathlib import Path
import sys

from wfc3tools import __version__

conf = ConfigParser()
conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
setup_cfg = dict(conf.items('metadata'))
if sys.version_info < (3, 11):
import tomli as tomllib
else:
import tomllib

with open(Path(__file__).parent.parent / "pyproject.toml", "rb") as configuration_file:
metadata = tomllib.load(configuration_file)["project"]

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
Expand All @@ -28,9 +34,9 @@


# -- Project information -----------------------------------------------------
project = setup_cfg['name']
author = setup_cfg['author']
copyright = '{0}, {1}'.format(datetime.datetime.now().year, author)
project = metadata["name"]
author = f'{metadata["authors"][0]["name"]}'
copyright = f"{datetime.datetime.now().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
Expand Down Expand Up @@ -139,4 +145,4 @@
# latex_appendices = []

# If false, no module index is generated.
latex_domain_indices = True
latex_domain_indices = True
66 changes: 65 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
[project]
name = "wfc3tools"
description = "Python Tools for HST WFC3 Data"
requires-python = ">=3.9"
authors = [
{ name = "STScI", email = "[email protected]" },
]
classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"astropy>=4.2.0",
"numpy>=1.21.0",
"matplotlib>=3.5.1",
"stsci.tools>=4.0.1",
"scipy>=1.8.0",
]
dynamic = [
"version",
]
github-project = "spacetelescope/wfc3tools"
description-file = "README.rst"

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[project.license]
file = "LICENSE.txt"
content-type = "text/plain"

[project.urls]
Homepage = "http://wfc3tools.readthedocs.io/"
"Bug Reports" = "https://github.com/spacetelescope/wfc3tools/issues/"
Source = "https://github.com/spacetelescope/wfc3tools/"
Help = "https://hsthelp.stsci.edu"
homepage = "http:://wfc3tools.readthedocs.io/"

[project.optional-dependencies]
docs = [
"sphinx",
"sphinx-automodapi",
"sphinx-rtd-theme",
]

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

[tool.setuptools]
zip-safe = false
include-package-data = false

[tool.setuptools.packages.find]
namespaces = false

[tool.setuptools_scm]
write_to = "wfc3tools/version.py"
41 changes: 0 additions & 41 deletions setup.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions setup.py

This file was deleted.

Loading