Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
- "3.12"
- "3.11"
- "3.10"
numpy-version:
- false
- "1.x"
- "2.x"
optional-deps:
- ""
- "[numpy2]"
- "[numpy1]"
exclude:
- python-version: "3.14"
numpy-version: "1.x"
optional-deps: "[numpy1]"
- python-version: "3.13"
numpy-version: "1.x"
optional-deps: "[numpy1]"

name: "Tests (Python: ${{ matrix.python-version }}, NumPy: ${{ matrix.numpy-version }})"
name: "Tests (Python: ${{ matrix.python-version }}, optional dependencies: ${{ matrix.optional-deps }})"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
Expand All @@ -41,10 +41,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- run: pip install -r requirements.txt

- run: pip install -r numpy-${{ matrix.numpy-version }}-requirements.txt
if: matrix.numpy-version != false
- run: python -m pip install .${{ matrix.optional-deps }} --group test

- run: pytest -v --cov=utm --color=yes

Expand All @@ -61,11 +58,9 @@ jobs:
with:
python-version: "3.14"

- run: pip install -r release-requirements.txt

- run: python -m build

- uses: pypa/gh-action-pypi-publish@v1.14.1
- uses: pypa/gh-action-pypi-publish@v1.14.2
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
Unreleased
------

* Convert ``setup.py`` to ``pyproject.toml`` (#164)
* ...


Expand Down
56 changes: 46 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ You can also use NumPy arrays for ``EASTING`` and ``NORTHING``. In the result

.. code-block:: python

>>> utm.to_latlon(np.array([395200, 456100]), np.array([5673100, 5427600]), 32, 'U')
(array([51.19968297, 48.99973627]), array([7.49999141, 8.3998036 ]))
>>> utm.to_latlon(np.array([395200, 456100]), np.array([5673100, 5427600]), 32, 'U')
(array([51.19968297, 48.99973627]), array([7.49999141, 8.3998036 ]))


Since the zone letter is not strictly needed for the conversion you may also
Expand Down Expand Up @@ -91,9 +91,27 @@ previous test). Using ``utm.from_latlon(x, y)`` to convert one million points:
Development
-----------

Create a new ``virtualenv`` and install the library via ``pip install -e .``.
After that install the ``pytest`` package via ``pip install pytest`` and run
the unit test suite by calling ``pytest``.
Setup development environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Using ``uv`` is the easiest:

* Run: ``uv sync``

Using ``pipx``:

* Run: ``pipx install -e . --pip-args="--group dev"``

Using ``pip`` requires manually setting up the virtual environment:

* Create and activate a new ``virtualenv``
* Run: ``python -m pip install -e . --group dev``

Run tests
^^^^^^^^^

After preparing the development environment, run the unit test suite by
calling ``pytest``.

Changelog
---------
Expand All @@ -103,17 +121,35 @@ see `CHANGELOG.rst <CHANGELOG.rst>`_ file
Authors
-------

* Bart van Andel <bavanandel@gmail.com>
* Tobias Bieniek <Tobias.Bieniek@gmx.de>
* Torstein I. Bø

Maintainers
-----------

* Bart van Andel <bavanandel@gmail.com>

License
-------

Copyright (C) 2012 Tobias Bieniek <Tobias.Bieniek@gmx.de>
MIT License

Copyright (c) 2012-2017 Tobias Bieniek <Tobias.Bieniek@gmx.de>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 0 additions & 1 deletion numpy-1.x-requirements.txt

This file was deleted.

3 changes: 0 additions & 3 deletions numpy-2.x-requirements.txt

This file was deleted.

74 changes: 73 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,75 @@
[project]
name = "utm"
description = "Bidirectional UTM-WGS84 converter for python"
readme = "README.rst"
dynamic = ["version"]
requires-python = ">=3.10"
authors = [{ name = "Tobias Bieniek", email = "Tobias.Bieniek@gmx.de" }]
maintainers = [{ name = "Bart van Andel", email = "bavanandel@gmail.com" }]
keywords = ["utm", "wgs84", "coordinate", "converter"]
license = "MIT"
license-files = ["LICENSE"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"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",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: GIS",
]
dependencies = []

[project.optional-dependencies]
# Within each major NumPy version, use the latest minor versions that each Python version supports
# See: https://numpy.org/news/
numpy1 = [
# NumPy 1.26 supports Python 3.9-3.12, even if we don't
"numpy==1.26.4;python_version >= '3.9' and python_version < '3.13'",
]
numpy2 = [
# NumPy 2.5 supports Python 3.12-3.14
"numpy==2.5.1; python_version >= '3.12' and python_version < '3.15'",
# NumPy 2.4 supports Python 3.11-3.13
"numpy==2.4.6; python_version >= '3.11' and python_version < '3.12'",
# NumPy 2.2 supports Python 3.10-3.13
"numpy==2.2.6; python_version >= '3.10' and python_version < '3.11'",
]

[dependency-groups]
test = [
"pytest==9.1.1; python_version >= '3.10' and python_version < '3.16'",
"pytest-cov==7.1.0; python_version >= '3.9' and python_version < '3.15'",
"tox>=4.58.0,<5.0.0; python_version >= '3.9' and python_version < '3.15'",
]
dev = [{ include-group = "test" }]
release = ["build"]

[project.scripts]
utm-converter = "utm:cli"

[project.urls]
homepage = "https://github.com/Turbo87/utm"
source = "https://github.com/Turbo87/utm"
download = "https://pypi.org/project/utm"
changelog = "https://github.com/Turbo87/utm/blob/master/CHANGELOG.rst"
releasenotes = "https://github.com/Turbo87/utm/releases"
issues = "https://github.com/Turbo87/utm/issues"
documentation = "https://github.com/Turbo87/utm/blob/master/README.rst"

[build-system]
requires = ["setuptools"]
requires = ["setuptools>=77.0.3"]
build-backend = "setuptools.build_meta"

[tool.setuptool]
packages = ["utm"]

[tool.setuptools.dynamic]
version = { attr = "utm._version.__version__" }
1 change: 0 additions & 1 deletion release-requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

43 changes: 0 additions & 43 deletions setup.py

This file was deleted.

File renamed without changes.