-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use pyproject.toml instead of setup.py
- Loading branch information
1 parent
b03160c
commit 7b08597
Showing
14 changed files
with
64 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,3 +93,6 @@ _dev | |
|
||
# docs | ||
docs/examples/*.bufr | ||
|
||
# generated version | ||
src/pdbufr/version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
[build-system] | ||
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] | ||
build-backend = "setuptools.build_meta" | ||
requires = ["setuptools>=61", "setuptools_scm[toml]>=8"] | ||
|
||
[project] | ||
authors = [ | ||
{name = "European Centre for Medium-Range Weather Forecasts (ECMWF)", email = "[email protected]"} | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Operating System :: OS Independent" | ||
] | ||
dependencies = ["attrs", "eccodes", "pandas"] | ||
description = "Pandas reader for the BUFR format using ecCodes." | ||
dynamic = ["version"] | ||
keywords = ["eccodes", "bufr", "pandas"] | ||
license = {text = "Apache License Version 2.0"} | ||
name = "pdbufr" | ||
readme = "README.md" | ||
requires-python = ">= 3.6" | ||
|
||
[project.optional-dependencies] | ||
tests = ["flake8", "pytest", "pytest-cov", "requests"] | ||
|
||
[project.urls] | ||
Documentation = "https://pdbufr.readthedocs.io/en/latest/" | ||
Homepage = "https://github.com/ecmwf/pdbufr" | ||
|
||
[tool.coverage.run] | ||
branch = true | ||
|
@@ -10,3 +45,10 @@ profile = "black" | |
[tool.pydocstyle] | ||
add_ignore = ["D1", "D200", "D205", "D400", "D401", "D403"] | ||
convention = "numpy" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/pdbufr/version.py" | ||
write_to_template = ''' | ||
# Do not change! Do not track in version control! | ||
__version__ = "{version}" | ||
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
[zest.releaser] | ||
python-file-with-version = pdbufr/__init__.py | ||
|
||
|
||
[flake8] | ||
max-line-length = 110 | ||
extend-ignore = E203, W503 | ||
max-line-length = 110 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,52 +8,6 @@ | |
# granted to it by virtue of its status as an intergovernmental organisation | ||
# nor does it submit to any jurisdiction. | ||
|
||
import os | ||
import re | ||
|
||
import setuptools # type: ignore | ||
|
||
|
||
def read(path: str) -> str: | ||
file_path = os.path.join(os.path.dirname(__file__), *path.split("/")) | ||
return open(file_path).read() | ||
|
||
|
||
# single-sourcing the package version using method 1 of: | ||
# https://packaging.python.org/guides/single-sourcing-package-version/ | ||
def parse_version_from(path: str) -> str: | ||
version_file = read(path) | ||
version_match = re.search('^__version__ = "(.*)"', version_file, re.M) | ||
if version_match is None or len(version_match.groups()) > 1: | ||
raise ValueError("couldn't parse version") | ||
return version_match.group(1) | ||
|
||
|
||
setuptools.setup( | ||
name="pdbufr", | ||
version=parse_version_from("pdbufr/__init__.py"), | ||
description="Pandas reader for the BUFR format using ecCodes.", | ||
long_description=read("README.rst"), | ||
author="European Centre for Medium-Range Weather Forecasts (ECMWF)", | ||
author_email="[email protected]", | ||
license="Apache License Version 2.0", | ||
url="https://github.com/ecmwf/pdbufr", | ||
packages=setuptools.find_packages(), | ||
include_package_data=True, | ||
install_requires=["attrs", "eccodes", "pandas"], | ||
extras_require={"tests": ["flake8", "pytest", "pytest-cov", "requests"]}, | ||
zip_safe=True, | ||
keywords="eccodes bufr pandas", | ||
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Operating System :: OS Independent", | ||
], | ||
) | ||
setuptools.setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import pdbufr | ||
|
||
|
||
def test_version() -> None: | ||
assert pdbufr.__version__ != "999" |