-
Notifications
You must be signed in to change notification settings - Fork 44
MNT: unify static configuration files into pyproject.toml, update PEP 639 license metadata
#371
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,4 @@ | ||
| include *.txt | ||
| include README.md | ||
| include LICENSE | ||
| include pyproject.toml | ||
| include Changelog | ||
| exclude *.legacy | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,105 @@ | ||
| [project] | ||
| name = "cftime" | ||
| version = "1.6.5" | ||
| description = "Time-handling functionality from netcdf4-python" | ||
| readme = "README.md" | ||
| authors = [ | ||
| { name="Jeff Whitaker", email="whitaker.jeffrey@gmail.com"} | ||
| ] | ||
| license = "MIT" | ||
| license-files = ["LICENSE"] | ||
| classifiers = [ | ||
| 'Development Status :: 5 - Production/Stable', | ||
| 'Operating System :: MacOS :: MacOS X', | ||
| 'Operating System :: Microsoft :: Windows', | ||
| 'Operating System :: POSIX :: Linux', | ||
| 'Programming Language :: Python', | ||
| 'Programming Language :: Python :: 3', | ||
| 'Programming Language :: Python :: 3.8', | ||
| 'Programming Language :: Python :: 3.9', | ||
| 'Programming Language :: Python :: 3.10', | ||
| 'Programming Language :: Python :: 3.11', | ||
| 'Programming Language :: Python :: 3.12', | ||
| 'Programming Language :: Python :: 3.13', | ||
| 'Topic :: Scientific/Engineering', | ||
| ] | ||
| dependencies = [ | ||
| "numpy>1.13.3", | ||
| ] | ||
| requires-python = ">=3.8" | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "check-manifest", | ||
| "coverage", | ||
| "coveralls", | ||
| "cython>=0.29.20", | ||
| "pytest", | ||
| "pytest-cov", | ||
| "sphinx", | ||
| "twine", | ||
| ] | ||
|
|
||
| [build-system] | ||
| requires = [ | ||
| "setuptools>=41.2", | ||
| "setuptools>=77.0.1", | ||
| "cython>=0.29.20", | ||
| "wheel", | ||
| "oldest-supported-numpy ; python_version < '3.9'", | ||
| "numpy>=2.0.0rc1,<3 ; python_version >= '3.9'", | ||
| "numpy>=2.0.0,<3 ; python_version >= '3.9'", | ||
| ] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [tool.setuptools] | ||
| package-dir = {"" = "src"} | ||
|
|
||
| [tool.pytest.ini_options] | ||
| testpaths = "test" | ||
| addopts = [ | ||
| "-ra", | ||
| "-v", | ||
| "--doctest-modules", | ||
| "--cov=cftime", | ||
| "--cov-report=term-missing", | ||
| ] | ||
| doctest_optionflags = [ | ||
| "NORMALIZE_WHITESPACE", | ||
| "ELLIPSIS", | ||
| ] | ||
|
|
||
| [tool.coverage.run] | ||
| relative_files = true | ||
| branch = true | ||
| plugins = [ | ||
| "Cython.Coverage", | ||
| ] | ||
| include = [ | ||
| "src/cftime/*", | ||
| ] | ||
| omit = [ | ||
| "setup.py", | ||
| "docs/*", | ||
| "ci/*", | ||
| "test/*", | ||
| ".eggs", | ||
| ] | ||
|
|
||
| [tool.coverage.report] | ||
| exclude_lines = [ | ||
| "pragma: no cover", | ||
| "def __repr__", | ||
| "if __name__ == .__main__.:", | ||
| ] | ||
|
|
||
| [tool.check-manifest] | ||
| ignore = [ | ||
| "*.yml", | ||
| ".coveragerc", | ||
| ".gitignore", | ||
| "README.release", | ||
| "ci", | ||
| "ci/*", | ||
| "docs", | ||
| "docs/*", | ||
| "test", | ||
| "test/*", | ||
| ] | ||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,14 +2,9 @@ | |
| import sys | ||
| import numpy | ||
|
|
||
| from Cython.Build import cythonize | ||
| from setuptools import Command, Extension, setup | ||
|
|
||
| # https://github.com/Unidata/cftime/issues/34 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: direct invocations of |
||
| try: | ||
| from Cython.Build import cythonize | ||
| except ImportError: | ||
| cythonize = False | ||
|
|
||
|
|
||
| BASEDIR = os.path.abspath(os.path.dirname(__file__)) | ||
| SRCDIR = os.path.join(BASEDIR,'src') | ||
|
|
@@ -58,31 +53,6 @@ def run(self): | |
| print('clean: skipping file {!r}'.format(artifact)) | ||
|
|
||
|
|
||
| def extract_version(): | ||
| version = None | ||
| with open(CYTHON_FNAME) as fi: | ||
| for line in fi: | ||
| if (line.startswith('__version__')): | ||
| _, version = line.split('=') | ||
| version = version.strip()[1:-1] # Remove quotation characters. | ||
| break | ||
| return version | ||
|
|
||
|
|
||
| def load(fname): | ||
| result = [] | ||
| with open(fname, 'r') as fi: | ||
| result = [package.strip() for package in fi.readlines()] | ||
| return result | ||
|
|
||
|
|
||
| def description(): | ||
| fname = os.path.join(BASEDIR, 'README.md') | ||
| with open(fname, 'r') as fi: | ||
| result = ''.join(fi.readlines()) | ||
| return result | ||
|
|
||
|
|
||
| if ((FLAG_COVERAGE in sys.argv or os.environ.get('CYTHON_COVERAGE', None)) | ||
| and cythonize): | ||
| COMPILER_DIRECTIVES = { | ||
|
|
@@ -99,43 +69,17 @@ def description(): | |
| ext_modules = [] | ||
| else: | ||
| extension = Extension('{}._{}'.format(NAME, NAME), | ||
| sources=[CYTHON_FNAME], | ||
| sources=[os.path.relpath(CYTHON_FNAME, BASEDIR)], | ||
| define_macros=DEFINE_MACROS, | ||
| include_dirs=[numpy.get_include(),]) | ||
| ext_modules = [extension] | ||
| if cythonize: | ||
| ext_modules = cythonize(extension, | ||
| compiler_directives=COMPILER_DIRECTIVES, | ||
| language_level=3) | ||
|
|
||
| ext_modules = cythonize( | ||
| extension, | ||
| compiler_directives=COMPILER_DIRECTIVES, | ||
| language_level=3, | ||
| ) | ||
|
|
||
| setup( | ||
| name=NAME, | ||
| author='Jeff Whitaker', | ||
| author_email='whitaker.jeffrey@gmail.com', | ||
| description='Time-handling functionality from netcdf4-python', | ||
| long_description=description(), | ||
| long_description_content_type='text/markdown', | ||
| cmdclass={'clean_cython': CleanCython}, | ||
| packages=[NAME], | ||
| package_dir={'':'src'}, | ||
| version=extract_version(), | ||
| ext_modules=ext_modules, | ||
| install_requires=load('requirements.txt'), | ||
| tests_require=load('requirements-dev.txt'), | ||
| license='License :: OSI Approved :: MIT License', | ||
| python_requires=">=3.8", | ||
| classifiers=[ | ||
| 'Development Status :: 5 - Production/Stable', | ||
| 'Operating System :: MacOS :: MacOS X', | ||
| 'Operating System :: Microsoft :: Windows', | ||
| 'Operating System :: POSIX :: Linux', | ||
| 'Programming Language :: Python', | ||
| 'Programming Language :: Python :: 3', | ||
| 'Programming Language :: Python :: 3.9', | ||
| 'Programming Language :: Python :: 3.10', | ||
| 'Programming Language :: Python :: 3.11', | ||
| 'Programming Language :: Python :: 3.12', | ||
| 'Programming Language :: Python :: 3.13', | ||
| 'Topic :: Scientific/Engineering', | ||
| 'License :: OSI Approved :: MIT License'], | ||
| ) | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that I redefined
requirements-tests.txtas a PEP 735 dependency group, which accomplishes the same thing: dev-only, and user-invisible dependencies. This PEP is already supported bypip,uv,cibuildwheel,toxand (I suspect)pdm.