diff --git a/pyproject.toml b/pyproject.toml index 46a745e..68ab7b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,107 @@ +[project] +name = "stsci.tools" +description = "Collection of STScI utility functions" +requires-python = ">=3.8" +authors = [ + { name = "STScI", email = "help@stsci.edu" }, +] +keywords = [ + "astronomy", + "astrophysics", + "utility", +] +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Scientific/Engineering :: Astronomy", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + "packaging", + "numpy", + "astropy>=5.0.4", +] +dynamic = [ + "version", +] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.license] +file = "LICENSE.md" +content-type = "text/plain" + +[project.urls] +Homepage = "https://www.github.com/spacetelescope/stsci.tools" + +[project.scripts] +convertwaiveredfits = "stsci.tools.convertwaiveredfits:main" +convertlog = "stsci.tools.convertlog:main" + +[project.optional-dependencies] +test = [ + "pytest", + "pytest-astropy-header", + "pytest-doctestplus", +] +docs = [ + "sphinx", + "numpydoc", + "sphinx_rtd_theme", +] + [build-system] -requires = ["setuptools>=30.3.0", - "setuptools_scm", - "wheel"] +requires = [ + "setuptools>=30.3.0", + "setuptools_scm", + "wheel", +] build-backend = "setuptools.build_meta" + +[tool.setuptools] +zip-safe = false +include-package-data = false +license-files = [ + "LICENSE.md", +] + +[tool.setuptools.packages.find] +where = [ + "lib/", +] + +[tool.setuptools.package-data] +"stsci.tools.tests" = [ + "data/*.*", +] + +[tool.setuptools_scm] +version_file = "lib/stsci/tools/version.py" + +[tool.pytest.ini_options] +minversion = "6" +testpaths = [ + "lib/stsci/tools", +] +addopts = "--doctest-modules" +astropy_header = true +xfail_strict = true +filterwarnings = [ + "error", + "ignore:.*Column disp option", + "ignore:NMPFIT is deprecated", + "ignore:GFIT is deprecated", + "ignore:unclosed file:ResourceWarning", +] + +[tool.ruff.lint] +extend-ignore = [ + "E501", + "W504", +] + diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index c590588..0000000 --- a/setup.cfg +++ /dev/null @@ -1,76 +0,0 @@ -[metadata] -name = stsci.tools -description = Collection of STScI utility functions -long_description = Collection of STScI utility functions -long_description_content_type = text/plain -keywords = astronomy, astrophysics, utility -author = STScI -author_email = help@stsci.edu -license = BSD -license_file = LICENSE.md -url = https://www.github.com/spacetelescope/stsci.tools -classifiers = - Intended Audience :: Science/Research - License :: OSI Approved :: BSD License - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: Implementation :: CPython - Topic :: Scientific/Engineering :: Astronomy - Topic :: Software Development :: Libraries :: Python Modules - -[options] -packages = find: -package_dir = - = lib -zip_safe = False -setup_requires = - setuptools_scm -install_requires = - packaging - numpy - astropy>=5.0.4 -python_requires = >=3.8 - -[options.packages.find] -where = lib - -[options.extras_require] -test = - pytest - pytest-astropy-header - pytest-doctestplus -docs = - sphinx - numpydoc - sphinx_rtd_theme - -[options.package_data] -stsci.tools.tests = data/*.* - -[options.entry_points] -console_scripts = - convertwaiveredfits = stsci.tools.convertwaiveredfits:main - convertlog = stsci.tools.convertlog:main - -[tool:pytest] -minversion = 6 -testpaths = lib/stsci/tools -addopts = --doctest-modules -astropy_header = true -xfail_strict = true -filterwarnings = - error - ignore:.*Column disp option - ignore:NMPFIT is deprecated - ignore:GFIT is deprecated - ignore:unclosed file:ResourceWarning - -[flake8] -# E501: line too long -# W504: line break after binary operator -ignore = E501,W504 - -[bdist_wheel] -# If at all possible, it is good practice to do this. If you cannot, you -# will need to generate wheels for each Python version that you support. -universal=1 diff --git a/setup.py b/setup.py deleted file mode 100755 index 3313702..0000000 --- a/setup.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python - -import sys -from setuptools import setup - -TEST_HELP = """ -Note: running tests is no longer done using 'python setup.py test'. Instead -you will need to run: - pip install -e . - pytest -For more information, see: - https://docs.astropy.org/en/latest/development/testguide.html#running-tests -""" - -if 'test' in sys.argv: - print(TEST_HELP) - sys.exit(1) - -DOCS_HELP = """ -Note: building the documentation is no longer done using -'python setup.py build_docs'. Instead you will need to run: - cd docs - make html -For more information, see: - https://docs.astropy.org/en/latest/install.html#builddocs -""" - -if 'build_docs' in sys.argv or 'build_sphinx' in sys.argv: - print(DOCS_HELP) - sys.exit(1) - -setup(use_scm_version={'write_to': 'lib/stsci/tools/version.py'})