[Git][debian-gis-team/python-osmapi][master] 6 commits: New upstream version 5.1.0+ds
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Mon Jul 27 06:34:31 BST 2026
Bas Couwenberg pushed to branch master at Debian GIS Project / python-osmapi
Commits:
77aee8a0 by Bas Couwenberg at 2026-07-27T07:23:21+02:00
New upstream version 5.1.0+ds
- - - - -
185eca3c by Bas Couwenberg at 2026-07-27T07:23:22+02:00
Update upstream source from tag 'upstream/5.1.0+ds'
Update to upstream version '5.1.0+ds'
with Debian dir ef0f38924e46dfccd52d90d40d6abb3d4f0b4bcb
- - - - -
1dabbfc5 by Bas Couwenberg at 2026-07-27T07:23:58+02:00
New upstream release.
- - - - -
80947883 by Bas Couwenberg at 2026-07-27T07:25:44+02:00
Drop pep517.patch, applied upstream.
- - - - -
987411df by Bas Couwenberg at 2026-07-27T07:31:07+02:00
Update lintian overrides.
- - - - -
ab05ab07 by Bas Couwenberg at 2026-07-27T07:31:07+02:00
Set distribution to unstable.
- - - - -
11 changed files:
- CHANGELOG.md
- README.md
- debian/changelog
- + debian/lintian-overrides
- − debian/patches/pep517.patch
- − debian/patches/series
- osmapi/__init__.py
- osmapi/changeset.py
- + pyproject.toml
- requirements.txt
- tests/changeset_test.py
Changes:
=====================================
CHANGELOG.md
=====================================
@@ -4,6 +4,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [Unreleased]
+## [5.1.0] - 2026-07-26
+### Changed
+* Bump pygments from 2.15.0 to 2.20.0 by @dependabot[bot] in https://github.com/metaodi/osmapi/pull/193
+
+### Added
+* Add support for PEP 517. by @sebastic in https://github.com/metaodi/osmapi/pull/197
+
+### Fixed
+* Fix TypeError in changeset_upload when handling HTTP 409 responses by @hagatopaxi in https://github.com/metaodi/osmapi/pull/196
+
## [5.0.0] - 2026-02-18
### Changed
- **BC-Break**: Remove support for Python 3.8, new minimum version for osmapi is Python 3.9
@@ -379,7 +389,8 @@ Miroslav Šedivý
- `Fixed` for any bug fixes.
- `Security` to invite users to upgrade in case of vulnerabilities.
-[Unreleased]: https://github.com/metaodi/osmapi/compare/v5.0.0...HEAD
+[Unreleased]: https://github.com/metaodi/osmapi/compare/v5.1.0...HEAD
+[5.1.0]: https://github.com/metaodi/osmapi/compare/v5.0.0...v5.1.0
[5.0.0]: https://github.com/metaodi/osmapi/compare/v4.3.0...v5.0.0
[4.3.0]: https://github.com/metaodi/osmapi/compare/v4.2.0...v4.3.0
[4.2.0]: https://github.com/metaodi/osmapi/compare/v4.1.0...v4.2.0
=====================================
README.md
=====================================
@@ -64,9 +64,9 @@ Check the [examples directory](https://github.com/metaodi/osmapi/tree/develop/ex
### OAuth authentication
-Username/Password authentication will be deprecated in July 2024
+Username/Password authentication is deprecated since July 2024
(see [official OWG announcemnt](https://blog.openstreetmap.org/2024/04/17/oauth-1-0a-and-http-basic-auth-shutdown-on-openstreetmap-org/) for details).
-In order to use this library in the future, you'll need to use OAuth 2.0.
+In order to use this library, you need to use OAuth 2.0.
To use OAuth 2.0, you must register an application with an OpenStreetMap account, either on the
[development server](https://master.apis.dev.openstreetmap.org/oauth2/applications)
@@ -85,7 +85,7 @@ client_id = "<client_id>"
client_secret = "<client_secret>"
auth = OpenStreetMapDevAuth(
- client_id, client_secret, ['read_prefs', 'write_map']
+ client_id, client_secret, ['read_prefs', 'write_api']
).auth_code()
api = osmapi.OsmApi(
=====================================
debian/changelog
=====================================
@@ -1,9 +1,12 @@
-python-osmapi (5.0.0+ds-2) UNRELEASED; urgency=medium
+python-osmapi (5.1.0+ds-1) unstable; urgency=medium
+ * New upstream release.
* Bump Standards-Version to 4.7.4, no changes.
* Use pybuild-plugin-pyproject instead of python3-setuptools.
+ * Drop pep517.patch, applied upstream.
+ * Update lintian overrides.
- -- Bas Couwenberg <sebastic at debian.org> Sat, 04 Apr 2026 10:21:00 +0200
+ -- Bas Couwenberg <sebastic at debian.org> Mon, 27 Jul 2026 07:25:46 +0200
python-osmapi (5.0.0+ds-1) unstable; urgency=medium
=====================================
debian/lintian-overrides
=====================================
@@ -0,0 +1,3 @@
+# False positive
+package-contains-documentation-outside-usr-share-doc [usr/lib/python3/dist-packages/*.*-info/*.txt]
+
=====================================
debian/patches/pep517.patch deleted
=====================================
@@ -1,11 +0,0 @@
-Description: Add support for PEP 517.
-Author: Bas Couwenberg <sebastic at debian.org>
-Forwarded: https://github.com/metaodi/osmapi/pull/197
-Applied-Upstream: https://github.com/metaodi/osmapi/commit/273ccf0ac6b48f17504b70c9fe308fe2caa46753
-
---- /dev/null
-+++ b/pyproject.toml
-@@ -0,0 +1,3 @@
-+[build-system]
-+requires = ["setuptools"]
-+build-backend = "setuptools.build_meta"
=====================================
debian/patches/series deleted
=====================================
@@ -1 +0,0 @@
-pep517.patch
=====================================
osmapi/__init__.py
=====================================
@@ -1,4 +1,4 @@
-__version__ = "5.0.0"
+__version__ = "5.1.0"
from .OsmApi import * # noqa
from .errors import * # noqa
=====================================
osmapi/changeset.py
=====================================
@@ -213,8 +213,13 @@ class ChangesetMixin:
forceAuth=True,
)
except errors.ApiError as e:
+ payload_str = (
+ e.payload.decode("utf-8", errors="replace")
+ if isinstance(e.payload, bytes)
+ else str(e.payload)
+ )
if e.status == 409 and re.search(
- r"The changeset .* was closed at .*", e.payload
+ r"The changeset .* was closed at .*", payload_str
):
raise errors.ChangesetClosedApiError(
e.status, e.reason, e.payload
=====================================
pyproject.toml
=====================================
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
=====================================
requirements.txt
=====================================
@@ -1,4 +1,4 @@
pdoc==14.5.1
-Pygments==2.15.0
+Pygments==2.20.0
requests==2.32.4
python-dotenv
=====================================
tests/changeset_test.py
=====================================
@@ -129,10 +129,10 @@ def test_changeset_update(auth_api, add_response):
result = auth_api.changeset_update({"test": "foobar"})
changeset_xml = xmltosorteddict(
b'<?xml version="1.0" encoding="UTF-8"?>\n'
- b'<osm version="0.6" generator="osmapi/5.0.0">\n'
+ b'<osm version="0.6" generator="osmapi/5.1.0">\n'
b' <changeset visible="true">\n'
b' <tag k="test" v="foobar"/>\n'
- b' <tag k="created_by" v="osmapi/5.0.0"/>\n'
+ b' <tag k="created_by" v="osmapi/5.1.0"/>\n'
b" </changeset>\n"
b"</osm>\n"
)
@@ -152,7 +152,7 @@ def test_changeset_update_with_created_by(auth_api, add_response):
result = auth_api.changeset_update({"test": "foobar", "created_by": "MyTestOSMApp"})
changeset_xml = xmltosorteddict(
b'<?xml version="1.0" encoding="UTF-8"?>\n'
- b'<osm version="0.6" generator="osmapi/5.0.0">\n'
+ b'<osm version="0.6" generator="osmapi/5.1.0">\n'
b' <changeset visible="true">\n'
b' <tag k="test" v="foobar"/>\n'
b' <tag k="created_by" v="MyTestOSMApp"/>\n'
@@ -176,10 +176,10 @@ def test_changeset_create(auth_api, add_response):
changeset_xml = xmltosorteddict(
b'<?xml version="1.0" encoding="UTF-8"?>\n'
- b'<osm version="0.6" generator="osmapi/5.0.0">\n'
+ b'<osm version="0.6" generator="osmapi/5.1.0">\n'
b' <changeset visible="true">\n'
b' <tag k="foobar" v="A new test changeset"/>\n'
- b' <tag k="created_by" v="osmapi/5.0.0"/>\n'
+ b' <tag k="created_by" v="osmapi/5.1.0"/>\n'
b" </changeset>\n"
b"</osm>\n"
)
@@ -199,7 +199,7 @@ def test_changeset_create_with_created_by(auth_api, add_response):
changeset_xml = xmltosorteddict(
b'<?xml version="1.0" encoding="UTF-8"?>\n'
- b'<osm version="0.6" generator="osmapi/5.0.0">\n'
+ b'<osm version="0.6" generator="osmapi/5.1.0">\n'
b' <changeset visible="true">\n'
b' <tag k="foobar" v="A new test changeset"/>\n'
b' <tag k="created_by" v="CoolTestApp"/>\n'
@@ -279,7 +279,7 @@ def test_changeset_upload_create_node(auth_api, add_response):
upload_xml = xmltosorteddict(
b'<?xml version="1.0" encoding="UTF-8"?>\n'
- b'<osmChange version="0.6" generator="osmapi/5.0.0">\n'
+ b'<osmChange version="0.6" generator="osmapi/5.1.0">\n'
b"<create>\n"
b' <node lat="47.123" lon="8.555" visible="true" '
b'changeset="4444">\n'
@@ -351,7 +351,7 @@ def test_changeset_upload_modify_way(auth_api, add_response):
upload_xml = xmltosorteddict(
b'<?xml version="1.0" encoding="UTF-8"?>\n'
- b'<osmChange version="0.6" generator="osmapi/5.0.0">\n'
+ b'<osmChange version="0.6" generator="osmapi/5.1.0">\n'
b"<modify>\n"
b' <way id="4294967296" version="2" visible="true" '
b'changeset="4444">\n'
@@ -424,7 +424,7 @@ def test_changeset_upload_delete_relation(auth_api, add_response):
upload_xml = xmltosorteddict(
b'<?xml version="1.0" encoding="UTF-8"?>\n'
- b'<osmChange version="0.6" generator="osmapi/5.0.0">\n'
+ b'<osmChange version="0.6" generator="osmapi/5.1.0">\n'
b"<delete>\n"
b' <relation id="676" version="2" visible="true" '
b'changeset="4444">\n'
@@ -508,6 +508,54 @@ def test_changeset_upload_no_auth(api):
assert str(execinfo.value) == "Username/Password missing"
+def test_changeset_upload_version_mismatch_raises_api_error(auth_api, add_response):
+ """HTTP 409 version mismatch must raise ApiError, not TypeError."""
+ add_response(PUT, "/changeset/create", body="4444")
+ add_response(
+ POST,
+ "/changeset/4444/upload",
+ body=b"Version mismatch: Provided 3, server had: 4",
+ status=409,
+ )
+
+ changesdata = [
+ {
+ "type": "node",
+ "action": "modify",
+ "data": [{"id": 1, "version": 3, "lat": 47.0, "lon": 8.0, "tag": {}}],
+ }
+ ]
+
+ auth_api.changeset_create()
+ with pytest.raises(osmapi.errors.ApiError) as execinfo:
+ auth_api.changeset_upload(changesdata)
+ assert execinfo.value.status == 409
+ assert b"Version mismatch" in execinfo.value.payload
+
+
+def test_changeset_upload_closed_changeset_raises_correct_error(auth_api, add_response):
+ """HTTP 409 'changeset closed' must raise ChangesetClosedApiError."""
+ add_response(PUT, "/changeset/create", body="4444")
+ add_response(
+ POST,
+ "/changeset/4444/upload",
+ body=b"The changeset 4444 was closed at 2024-01-01T00:00:00Z",
+ status=409,
+ )
+
+ changesdata = [
+ {
+ "type": "node",
+ "action": "modify",
+ "data": [{"id": 1, "version": 1, "lat": 47.0, "lon": 8.0, "tag": {}}],
+ }
+ ]
+
+ auth_api.changeset_create()
+ with pytest.raises(osmapi.errors.ChangesetClosedApiError):
+ auth_api.changeset_upload(changesdata)
+
+
def test_changeset_download(api, add_response):
# Setup mock
add_response(GET, "/changeset/23123/download")
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-osmapi/-/compare/880fe658363397e1838753c70037a2aa38f365a0...ab05ab07391eb8640c06bff9ceb20e7c8e1d5e5f
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-osmapi/-/compare/880fe658363397e1838753c70037a2aa38f365a0...ab05ab07391eb8640c06bff9ceb20e7c8e1d5e5f
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20260727/ecf42b51/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list