From 3d6de8c87516ab06adb48321145326674dc0f382 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Wed, 12 Jul 2023 09:45:12 -0400 Subject: [PATCH] Revert "move build configuration into `pyproject.toml` (#216)" (#229) This reverts commit 9af631fa0c0dcf475b0bbcc59545b2c81a2468d8. --- .flake8 | 7 ----- pyproject.toml | 73 ++------------------------------------------------ setup.cfg | 13 +++++++++ setup.py | 52 ++++++++++++++++++++++++++++++++--- 4 files changed, 64 insertions(+), 81 deletions(-) delete mode 100644 .flake8 create mode 100644 setup.cfg diff --git a/.flake8 b/.flake8 deleted file mode 100644 index bfdb913..0000000 --- a/.flake8 +++ /dev/null @@ -1,7 +0,0 @@ -# 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 d79cacd..d765267 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,77 +1,8 @@ -[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", - "stsci_rtd_theme", -] -test = [ - "ci-watson", - "pytest", - "pytest-cov", -] - [build-system] requires = [ - "setuptools>=61.2", + "setuptools>=42.0", "setuptools_scm[toml]>=3.4", "wheel", "oldest-supported-numpy", ] -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" - +build-backend = 'setuptools.build_meta' diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..dc901d7 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,13 @@ +[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 2a1cc00..345d5b3 100755 --- a/setup.py +++ b/setup.py @@ -2,10 +2,8 @@ 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 = [] @@ -32,7 +30,35 @@ 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', @@ -40,4 +66,24 @@ 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', + ], )