diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..bfdb913 --- /dev/null +++ b/.flake8 @@ -0,0 +1,7 @@ +# flake8 does not support pyproject.toml (https://github.com/PyCQA/flake8/issues/234) + +[flake8] +# E265: block comment should start with '#' +# F821 undefined name +extend-ignore = E265,F821,F841 +extend-exclude = setup.py,__init__.py \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d765267..8584cdc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,77 @@ +[project] +name = "calcos" +description = "Calibration software for COS (Cosmic Origins Spectrograph)" +requires-python = ">=3.8" +authors = [ + { name = "Phil Hodge" }, + { name = "Robert Jedrzejewski" }, +] +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: C", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + "astropy>=5.0.4", + "numpy", + "scipy", + "stsci.tools>=4.0.0", +] +dynamic = [ + "version", +] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.scripts] +calcos = "calcos:main" + +[project.optional-dependencies] +docs = [ + "sphinx", +] +test = [ + "ci-watson", + "pytest", + "pytest-cov", + "codecov", +] + [build-system] requires = [ - "setuptools>=42.0", + "setuptools>=61.2", "setuptools_scm[toml]>=3.4", "wheel", "oldest-supported-numpy", ] -build-backend = 'setuptools.build_meta' +build-backend = "setuptools.build_meta" + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.packages.find] +namespaces = false + +[tool.setuptools.package-data] +calcos = [ + "pars/*", + "*.help", +] + +[tool.setuptools_scm] +write_to = 'calcos/version.py' + +[tool.pytest.ini_options] +minversion = "3.0" +norecursedirs = [ + "build", + "doc/build", + "src", +] +junit_family = "xunit2" + diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index dc901d7..0000000 --- a/setup.cfg +++ /dev/null @@ -1,13 +0,0 @@ -[options] -python_requires = >=3.8 - -[tool:pytest] -minversion = 3.0 -norecursedirs = build doc/build src -junit_family = xunit2 - -[flake8] -# E265: block comment should start with '#' -# F821 undefined name -ignore = E265,F821,F841 -exclude = setup.py,__init__.py diff --git a/setup.py b/setup.py index 345d5b3..2a1cc00 100755 --- a/setup.py +++ b/setup.py @@ -2,8 +2,10 @@ import os from fnmatch import fnmatch -from setuptools import setup, find_packages, Extension + from numpy import get_include as numpy_includes +from setuptools import setup, Extension + def c_sources(parent): sources = [] @@ -30,35 +32,7 @@ def c_includes(parent, depth=1): SOURCES = c_sources('src') INCLUDES = c_includes('src') + [numpy_includes()] - setup( - name=PACKAGENAME, - use_scm_version={'write_to': 'calcos/version.py'}, - setup_requires=['setuptools_scm'], - install_requires=[ - 'astropy>=5.0.4', - 'numpy', - 'scipy', - 'stsci.tools>=4.0.0', - ], - extras_require={ - 'docs': [ - 'sphinx', - ], - 'test': [ - 'ci-watson', - 'pytest', - 'pytest-cov', - 'codecov', - ], - }, - packages=find_packages(), - package_data={ - PACKAGENAME: [ - 'pars/*', - '*.help', - ], - }, ext_modules=[ Extension( PACKAGENAME + '.ccos', @@ -66,24 +40,4 @@ def c_includes(parent, depth=1): include_dirs=INCLUDES, ), ], - entry_points={ - 'console_scripts': { - 'calcos = calcos:main', - }, - }, - author='Phil Hodge, Robert Jedrzejewski', - author_email='help@stsci.edu', - description='Calibration software for COS (Cosmic Origins Spectrograph)', - long_description='README.md', - long_description_content_type='text/x-rst', - url='https://github.com/spacetelescope/calcos', - license='BSD', - classifiers=[ - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: C', - 'Topic :: Software Development :: Libraries :: Python Modules', - ], )