Skip to content

Commit f030333

Browse files
committed
Switch to using pyproject.toml for all project metadata
1 parent 9965a8b commit f030333

File tree

6 files changed

+93
-98
lines changed

6 files changed

+93
-98
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
extend-select = E,W
3+
extend-ignore = E501,W503,E731

docs/developing/conventions.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,12 @@ Users can install your plugin and ``emsarray`` will automatically find the inclu
143143

144144
If you have created a convention subclass called ``Grass``
145145
in the module ``grass.convention``
146-
include the following entry point in your ``setup.cfg``:
146+
include the following entry point in your ``pyproject.toml``:
147147

148148
.. code-block:: ini
149149
150-
[entry_points]
151-
emsarray.conventions =
152-
Grass = grass.convention:Grass
150+
[project.entry-points."emsarray.conventions"]
151+
Grass = "grass.convention:Grass"
153152
154153
The ``name`` portion before the ``=`` is not used,
155154
however we suggest using the same class name as your new convention implementation.
@@ -159,9 +158,8 @@ If your package contains multiple convention implementations, add one per line.
159158

160159
As a real world example, ``emsarray`` defines the following entry points:
161160

162-
.. literalinclude:: /../setup.cfg
163-
:prepend: [entry_points]
164-
:language: ini
165-
:start-at: emsarray.conventions =
161+
.. literalinclude:: /../pyproject.toml
162+
:language: toml
163+
:start-at: [project.entry-points."emsarray.conventions"]
166164
:end-before: # emsarray.conventions end
167165
:tab-width: 4

docs/releases/development.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ Next release (in development)
3434
Allow more functions to interchangeably take either a data array or the name of a data array
3535
(:pr:`142`).
3636
* Add :attr:`.Convention.depth_coordinates` and :meth:`.Convention.get_depth_coordinate_for_data_array()`. Deprecate functions :meth:`.Convention.get_depth_name()`, :meth:`.Convention.get_all_depth_names()`, and :meth:`Convention.get_time_name()`. Remove deprecated functions ``Convention.get_depths()`` and ``Convention.get_times()`` (:pr:`143`).
37+
* Swap to using `pyproject.toml` for all project metadata (:pr:`145`).

pyproject.toml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,89 @@ requires = [
44
]
55
build-backend = "setuptools.build_meta"
66

7+
[project]
8+
name = "emsarray"
9+
version = "0.6.1"
10+
description = "xarray extension that supports multiple geometry conventions"
11+
authors = [
12+
{name = "Coastal Environmental Modelling team, Oceans and Atmosphere, CSIRO", email = "[email protected]"},
13+
]
14+
license = {file = "LICENSE"}
15+
requires-python = ">=3.10"
16+
dependencies = [
17+
"bottleneck >=1.3",
18+
"geojson >=3.0",
19+
"netcdf4 >=1.6.4",
20+
"numpy >=1.24",
21+
"packaging >=23.1",
22+
"shapely >=2.0",
23+
"pyshp >=2.3",
24+
"xarray[parallel] >=2023.5",
25+
]
26+
27+
dynamic = ["readme"]
28+
29+
[project.urls]
30+
Documentation = "https://emsarray.readthedocs.io/"
31+
"Release notes" = "https://emsarray.readthedocs.io/en/stable/releases/0.6.1/"
32+
Source = "https://github.com/csiro-coasts/emsarray/"
33+
34+
[project.optional-dependencies]
35+
plot = [
36+
"cartopy >=0.21",
37+
"matplotlib >=3.7",
38+
"pykdtree >=1.3",
39+
"cfunits >= 3.3",
40+
]
41+
42+
tutorial = [
43+
"pooch >=1.7",
44+
]
45+
46+
complete = [
47+
"emsarray[plot,tutorial]",
48+
]
49+
50+
docs = [
51+
"emsarray[complete]",
52+
"sphinx ~=6.2.1",
53+
"sphinx_book_theme ~=1.0.1",
54+
"livereload~=2.6.3",
55+
]
56+
57+
testing = [
58+
"emsarray[complete]",
59+
"pytest",
60+
"pytest-cov",
61+
"pytest-mpl",
62+
"mypy",
63+
"pandas-stubs",
64+
"types-pytz",
65+
"flake8",
66+
"isort",
67+
]
68+
69+
[project.scripts]
70+
emsarray = "emsarray.cli:main"
71+
72+
[project.entry-points."emsarray.conventions"]
73+
ArakawaC = "emsarray.conventions.arakawa_c:ArakawaC"
74+
CFGrid1D = "emsarray.conventions.grid:CFGrid1D"
75+
CFGrid2D = "emsarray.conventions.grid:CFGrid2D"
76+
ShocSimple = "emsarray.conventions.shoc:ShocSimple"
77+
ShocStandard = "emsarray.conventions.shoc:ShocStandard"
78+
UGrid = "emsarray.conventions.ugrid:UGrid"
79+
# emsarray.conventions end - marker used by docs
80+
81+
[tool.setuptools.dynamic]
82+
readme = {file = ["README.md"], content-type = "text/markdown"}
83+
84+
[tool.setuptools.packages.find]
85+
where = ["src"]
86+
87+
[tool.setuptools.package-data]
88+
mypkg = ["py.typed"]
89+
790
[tool.pytest.ini_options]
891
addopts = [
992
# TODO Work around till the mpl-baseline-path ini option is included in the

setup.cfg

Lines changed: 0 additions & 87 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)