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

apply PEP621 (move configuration into pyproject.toml) #198

Merged
merged 2 commits into from
Aug 22, 2024
Merged
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
3 changes: 2 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import sys
import os
import importlib
# Check Sphinx version
import sphinx
Expand Down
3 changes: 2 additions & 1 deletion doc/source/fits_convention_tsr/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
#from stsci.sphinxext.conf import *
import sys, os
import sys
import os

# 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 Down
3 changes: 2 additions & 1 deletion doc/source/headerlet_tsr/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
import sys
import os

# 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 Down
3 changes: 2 additions & 1 deletion doc/source/npol_tsr/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
#from stsci.sphinxext.conf import *
import sys, os
import sys
import os

# 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 Down
125 changes: 125 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
[project]
name = "stwcs"
description = "Computes the WCS of HST images."
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>=5.0.4",
"numpy",
"stsci.tools>=3.6",
"requests",
"lxml",
]
dynamic = [
"version",
]

[project.urls]
Repository = "https://github.com/spacetelescope/stwcs.git"
Documentation = "https://stwcs.readthedocs.io"

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

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

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

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

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

[tool.setuptools.package-data]
"stwcs.gui" = [
"*.help",
]
"stwcs.gui.pars" = [
"*",
]
"stwcs.gui.htmlhelp" = [
"*",
]

[tool.pytest.ini_options]
minversion = "3.9"
norecursedirs = [
"build",
"docs/_build",
]
filterwarnings = [
"ignore:.*Card is too long*",
"ignore:.*Some non-standard WCS keywords*",
"ignore:.*The WCS transformation has more axes*",
"ignore:.*Keyword name 'IDCSCALE*",
]

[tool.build_sphinx]
builder = "html"
warning-is-error = "1"

[tool.ruff]
line-length = 110

[tool.ruff.lint]
select = [
"F",
"W",
"E101",
# "E111",
# "E112",
# "E113",
"E401",
"E711",
]
exclude = [
".git",
"__pycache__",
"doc",
"build",
"dist",
".tox",
".eggs",
]
ignore = [
"F401",
"F523",
"F524",
"F541",
"F821",
"F841",
"W292",
"W391",
# "W504",
"W605",
]

[tool.distutils.bdist_wheel]
universal = 0

[tool.setuptools_scm]
version_file = "stwcs/version.py"
45 changes: 0 additions & 45 deletions setup.cfg

This file was deleted.

60 changes: 0 additions & 60 deletions setup.py

This file was deleted.

9 changes: 1 addition & 8 deletions stwcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,12 @@

"""
import os
import importlib.metadata

from . import distortion # noqa
from stsci.tools import fileutil # noqa
from stsci.tools import teal # noqa


try:
__version__ = importlib.metadata.version(__name__)

except importlib.metadata.PackageNotFoundError: # pragma: no cover
# package is not installed
pass # pragma: no cover
from .version import __version__

try:
from . import gui
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ commands=

[testenv:style]
deps=
flake8
ruff
commands=
flake8 --count
ruff check .

[testenv:build-docs]
extras= docs
Expand Down
Loading