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

move build configuration into pyproject.toml #216

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.

from datetime import datetime
import os
import sys
from pathlib import Path

import tomli

# 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
69 changes: 67 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,73 @@
[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",
"scipystsci.tools>=4.0.0",
zacharyburnett marked this conversation as resolved.
Show resolved Hide resolved
]
dynamic = [
"version",
]

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.scripts]
calcos = "calcos:main"

stscirij marked this conversation as resolved.
Show resolved Hide resolved
[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.pytest.ini_options]
minversion = "3.0"
norecursedirs = [
"build",
"doc/build",
"src",
]
junit_family = "xunit2"

13 changes: 0 additions & 13 deletions setup.cfg

This file was deleted.

52 changes: 3 additions & 49 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand All @@ -30,60 +32,12 @@ 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',
sources=SOURCES,
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',
],
)