Skip to content

Commit 9b73df5

Browse files
authored
Move static project metadata to pyproject.toml (#23)
* add authors file * add minimal setup.py * add _version.py file to hold package version string * move static metadata into pyproject.toml * update the manifest * remove lint
1 parent 46f247d commit 9b73df5

7 files changed

Lines changed: 104 additions & 57 deletions

File tree

AUTHORS.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Credits
2+
=======
3+
4+
Development Leads
5+
-----------------
6+
7+
- `Mark Piper <https://github.com/mdpiper>`_
8+
- `Eric Hutton <https://github.com/mcflugen>`_

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ include *.rst
44
include *.txt
55
include Makefile
66
global-exclude *.pyc
7+
recursive-exclude examples *

heat/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""Model the diffusion of heat over a 2D plate."""
2-
import pkg_resources
3-
2+
from ._version import __version__
43
from .bmi_heat import BmiHeat
54
from .heat import solve_2d
65

7-
__all__ = ["BmiHeat", "solve_2d"]
8-
__version__ = pkg_resources.get_distribution("bmi-heat").version
6+
__all__ = ["__version__", "BmiHeat", "solve_2d"]

heat/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "2.1.2.dev0"

pyproject.toml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,91 @@
11
[build-system]
22
requires = ["setuptools", "wheel"]
33
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "bmi-heat"
7+
description = "BMI Python example"
8+
authors = [
9+
{email = "eric.hutton@colorado.edu"},
10+
{name = "The CSDMS team"}
11+
]
12+
maintainers = [
13+
{email = "eric.hutton@colorado.edu"},
14+
{name = "The CSDMS team"}
15+
]
16+
keywords = [
17+
"bmi",
18+
"component modeling",
19+
"earth science",
20+
]
21+
license = {file = "LICENSE"}
22+
classifiers = [
23+
"Development Status :: 4 - Beta",
24+
"Intended Audience :: Science/Research",
25+
"License :: OSI Approved :: MIT License",
26+
"Operating System :: OS Independent",
27+
"Programming Language :: Python :: 3",
28+
"Programming Language :: Python :: 3.7",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: Implementation :: CPython",
33+
"Topic :: Scientific/Engineering :: Physics",
34+
]
35+
requires-python = ">=3.7"
36+
dependencies = [
37+
"numpy",
38+
"scipy",
39+
"pyyaml",
40+
"bmipy",
41+
]
42+
dynamic = ["readme", "version"]
43+
44+
45+
[project.urls]
46+
homepage = "https://github.com/csdms/bmi-example-python"
47+
documentation = "https://github.com/csdms/bmi-example-python#readme"
48+
repository = "https://github.com/csdms/bmi-example-python"
49+
changelog = "https://github.com/csdms/bmi-example-python/blob/master/CHANGES.rst"
50+
51+
[project.optional-dependencies]
52+
testing = [
53+
"coveralls",
54+
"flake8",
55+
"pytest",
56+
"pytest-cov",
57+
"six",
58+
"bmi-tester",
59+
]
60+
61+
[tool.setuptools.dynamic]
62+
readme = {file = ["README.rst", "AUTHORS.rst", "CHANGES.rst"]}
63+
version = {attr = "heat._version.__version__"}
64+
65+
[tool.setuptools.packages.find]
66+
where = ["."]
67+
68+
[tool.pytest.ini_options]
69+
minversion = "6.0"
70+
testpaths = ["heat", "tests"]
71+
norecursedirs = [".*", "*.egg*", "build", "dist"]
72+
addopts = """
73+
--ignore setup.py
74+
--tb native
75+
--strict
76+
--durations 16
77+
--doctest-modules
78+
-vvv
79+
"""
80+
doctest_optionflags = [
81+
"NORMALIZE_WHITESPACE",
82+
"IGNORE_EXCEPTION_DETAIL",
83+
"ALLOW_UNICODE"
84+
]
85+
86+
[tool.isort]
87+
multi_line_output = 3
88+
include_trailing_comma = true
89+
force_grid_wrap = 0
90+
combine_as_imports = true
91+
line_length = 88

setup.cfg

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,6 @@
1-
[metadata]
2-
name = bmi-heat
3-
version = 2.1.2.dev0
4-
description = BMI Python example
5-
long_description = file: README.rst
6-
long_description_content_type = text/x-rst
7-
author = Eric Hutton
8-
author_email = eric.hutton@colorado.edu
9-
license = MIT
10-
license_files = LICENSE
11-
classifiers =
12-
Intended Audience :: Science/Research
13-
License :: OSI Approved :: MIT License
14-
Operating System :: OS Independent
15-
Programming Language :: Python :: 3
16-
Programming Language :: Python :: 3.7
17-
Programming Language :: Python :: 3.8
18-
Programming Language :: Python :: 3.9
19-
Programming Language :: Python :: 3.10
20-
Programming Language :: Python :: Implementation :: CPython
21-
Topic :: Scientific/Engineering :: Physics
22-
url = https://github.com/csdms/bmi-example-python
23-
24-
[options]
25-
packages = find:
26-
install_requires =
27-
bmipy
28-
numpy
29-
pyyaml
30-
scipy
31-
32-
[tool:pytest]
33-
minversion = 3.0
34-
testpaths = heat tests
35-
norecursedirs = .* *.egg* build dist
36-
addopts =
37-
--ignore setup.py
38-
--tb native
39-
--strict
40-
--durations 16
41-
--doctest-modules
42-
doctest_optionflags =
43-
NORMALIZE_WHITESPACE
44-
IGNORE_EXCEPTION_DETAIL
45-
ALLOW_UNICODE
46-
471
[coverage:run]
482
relative_files = True
493

50-
[isort]
51-
multi_line_output=3
52-
include_trailing_comma=True
53-
force_grid_wrap=0
54-
combine_as_imports=True
55-
line_length=88
56-
574
[flake8]
585
ignore =
596
E203
@@ -66,3 +13,4 @@ disable = missing-docstring,line-too-long
6613

6714
[zest.releaser]
6815
tag-format = v{version}
16+
python-file-with-version = heat/_version.py

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from setuptools import setup
2+
3+
setup()

0 commit comments

Comments
 (0)