Skip to content

Commit

Permalink
Merge pull request #145 from csiro-coasts/task/switch-to-pyproject-toml
Browse files Browse the repository at this point in the history
Switch to using pyproject.toml for all project metadata
  • Loading branch information
mx-moth authored Jul 8, 2024
2 parents 9965a8b + f030333 commit 16266c3
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 98 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
extend-select = E,W
extend-ignore = E501,W503,E731
14 changes: 6 additions & 8 deletions docs/developing/conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,12 @@ Users can install your plugin and ``emsarray`` will automatically find the inclu

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

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

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

.. literalinclude:: /../setup.cfg
:prepend: [entry_points]
:language: ini
:start-at: emsarray.conventions =
.. literalinclude:: /../pyproject.toml
:language: toml
:start-at: [project.entry-points."emsarray.conventions"]
:end-before: # emsarray.conventions end
:tab-width: 4
1 change: 1 addition & 0 deletions docs/releases/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ Next release (in development)
Allow more functions to interchangeably take either a data array or the name of a data array
(:pr:`142`).
* 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`).
* Swap to using `pyproject.toml` for all project metadata (:pr:`145`).
83 changes: 83 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,89 @@ requires = [
]
build-backend = "setuptools.build_meta"

[project]
name = "emsarray"
version = "0.6.1"
description = "xarray extension that supports multiple geometry conventions"
authors = [
{name = "Coastal Environmental Modelling team, Oceans and Atmosphere, CSIRO", email = "[email protected]"},
]
license = {file = "LICENSE"}
requires-python = ">=3.10"
dependencies = [
"bottleneck >=1.3",
"geojson >=3.0",
"netcdf4 >=1.6.4",
"numpy >=1.24",
"packaging >=23.1",
"shapely >=2.0",
"pyshp >=2.3",
"xarray[parallel] >=2023.5",
]

dynamic = ["readme"]

[project.urls]
Documentation = "https://emsarray.readthedocs.io/"
"Release notes" = "https://emsarray.readthedocs.io/en/stable/releases/0.6.1/"
Source = "https://github.com/csiro-coasts/emsarray/"

[project.optional-dependencies]
plot = [
"cartopy >=0.21",
"matplotlib >=3.7",
"pykdtree >=1.3",
"cfunits >= 3.3",
]

tutorial = [
"pooch >=1.7",
]

complete = [
"emsarray[plot,tutorial]",
]

docs = [
"emsarray[complete]",
"sphinx ~=6.2.1",
"sphinx_book_theme ~=1.0.1",
"livereload~=2.6.3",
]

testing = [
"emsarray[complete]",
"pytest",
"pytest-cov",
"pytest-mpl",
"mypy",
"pandas-stubs",
"types-pytz",
"flake8",
"isort",
]

[project.scripts]
emsarray = "emsarray.cli:main"

[project.entry-points."emsarray.conventions"]
ArakawaC = "emsarray.conventions.arakawa_c:ArakawaC"
CFGrid1D = "emsarray.conventions.grid:CFGrid1D"
CFGrid2D = "emsarray.conventions.grid:CFGrid2D"
ShocSimple = "emsarray.conventions.shoc:ShocSimple"
ShocStandard = "emsarray.conventions.shoc:ShocStandard"
UGrid = "emsarray.conventions.ugrid:UGrid"
# emsarray.conventions end - marker used by docs

[tool.setuptools.dynamic]
readme = {file = ["README.md"], content-type = "text/markdown"}

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
mypkg = ["py.typed"]

[tool.pytest.ini_options]
addopts = [
# TODO Work around till the mpl-baseline-path ini option is included in the
Expand Down
87 changes: 0 additions & 87 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

0 comments on commit 16266c3

Please sign in to comment.