diff --git a/docs/changelog.rst b/docs/changelog.rst index 9f8268a..613746c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -7,6 +7,41 @@ Change Log .. towncrier release notes start +`2.1.0 `_ - 2026-08-23 +--------------------------------------------------------------------------------------------- + +Changed +~~~~~~~ + +- Predicate caching for keyword validation now works when using :class:`~spacetrack.aio.AsyncSpaceTrackClient` with trio. + Previously, the on-disk cache was skipped because the file locking implementation only supported asyncio. (`#160 `_) +- :class:`~spacetrack.aio.AsyncSpaceTrackClient` no longer performs blocking cache file reads and writes on the event loop; they now run in a worker thread. (`#160 `_) +- Rate limit waits now guarantee that the ``callback`` has finished before the request is retried, in all clients. + As a result, an exception raised by the callback now propagates instead of being silently discarded: directly in :class:`~spacetrack.base.SpaceTrackClient`, and as an :class:`ExceptionGroup` on asyncio, matching the existing trio behaviour. (`#160 `_) +- When the Space-Track session expires (after two hours without requests), the client now logs in again and retries the request transparently instead of failing every subsequent request. (`#164 `_) +- Sets and frozensets are now accepted as predicate values and joined with commas like sequences. + Bytes-like values now raise :class:`TypeError` instead of being sent as comma-separated integers. (`#169 `_) + + +Fixed +~~~~~ + +- :class:`~spacetrack.aio.AsyncSpaceTrackClient` now accepts a plain function as the rate limit ``callback``, as shown in the documentation, in addition to a coroutine function. (`#160 `_) +- Concurrent first requests on a fresh client now share a single login request instead of each sending their own. (`#161 `_) +- Model definition requests are now rate limited like all other requests. (`#163 `_) +- Requests sent after a rate limit wait are now counted against the rate limit. + Previously they were not, so sustained use could exceed Space-Track's limits and trigger server-side rate limit errors. (`#163 `_) +- :meth:`SpaceTrackClient.close() ` and :meth:`AsyncSpaceTrackClient.close() ` now close the underlying HTTPX client even if logging out fails. (`#166 `_) +- Setting ``base_url`` now resets the authentication state and the cached predicates, which are specific to the previous host. (`#166 `_) +- Fixed a :class:`ReferenceError` when chaining a request off a temporary client, e.g. ``SpaceTrackClient(...).basicspacedata.gp(...)``. (`#167 `_) +- :meth:`~spacetrack.base.SpaceTrackClient.get_predicates` now returns the known predicates for request classes without a model definition on Space-Track (such as ``fileshare/download`` and ``publicfiles/dirs``) instead of failing. + The returned :class:`~spacetrack.base.Predicate` objects have a ``type_`` of ``None``, since no model definition exists to provide it. (`#168 `_) +- ``parse_types=True`` now works together with ``metadata=True`` in :meth:`~spacetrack.base.SpaceTrackClient.generic_request` and the request class methods; previously the metadata-wrapped response made it fail after the request had succeeded. (`#170 `_) +- Fixed a :class:`TypeError` when passing positional arguments to request class methods such as ``client.gp_history(...)``. + The request class was bound as a keyword argument internally, so any positional argument clashed with it. (`#171 `_) +- Error responses whose JSON ``error`` value is not a string no longer raise :class:`TypeError` instead of ``httpx2.HTTPStatusError``. (`#172 `_) + + `2.0.0 `_ - 2026-08-10 --------------------------------------------------------------------------------------------- diff --git a/newsfragments/160.changed.2.rst b/newsfragments/160.changed.2.rst deleted file mode 100644 index fe8deb6..0000000 --- a/newsfragments/160.changed.2.rst +++ /dev/null @@ -1,2 +0,0 @@ -Predicate caching for keyword validation now works when using :class:`~spacetrack.aio.AsyncSpaceTrackClient` with trio. -Previously, the on-disk cache was skipped because the file locking implementation only supported asyncio. diff --git a/newsfragments/160.changed.3.rst b/newsfragments/160.changed.3.rst deleted file mode 100644 index a8115ae..0000000 --- a/newsfragments/160.changed.3.rst +++ /dev/null @@ -1 +0,0 @@ -:class:`~spacetrack.aio.AsyncSpaceTrackClient` no longer performs blocking cache file reads and writes on the event loop; they now run in a worker thread. diff --git a/newsfragments/160.changed.rst b/newsfragments/160.changed.rst deleted file mode 100644 index d23ae3b..0000000 --- a/newsfragments/160.changed.rst +++ /dev/null @@ -1,2 +0,0 @@ -Rate limit waits now guarantee that the ``callback`` has finished before the request is retried, in all clients. -As a result, an exception raised by the callback now propagates instead of being silently discarded: directly in :class:`~spacetrack.base.SpaceTrackClient`, and as an :class:`ExceptionGroup` on asyncio, matching the existing trio behaviour. diff --git a/newsfragments/160.fixed.rst b/newsfragments/160.fixed.rst deleted file mode 100644 index 781ea52..0000000 --- a/newsfragments/160.fixed.rst +++ /dev/null @@ -1 +0,0 @@ -:class:`~spacetrack.aio.AsyncSpaceTrackClient` now accepts a plain function as the rate limit ``callback``, as shown in the documentation, in addition to a coroutine function. diff --git a/newsfragments/161.fixed.rst b/newsfragments/161.fixed.rst deleted file mode 100644 index 6f19cdd..0000000 --- a/newsfragments/161.fixed.rst +++ /dev/null @@ -1 +0,0 @@ -Concurrent first requests on a fresh client now share a single login request instead of each sending their own. diff --git a/newsfragments/163.fixed.2.rst b/newsfragments/163.fixed.2.rst deleted file mode 100644 index 953bb8a..0000000 --- a/newsfragments/163.fixed.2.rst +++ /dev/null @@ -1 +0,0 @@ -Model definition requests are now rate limited like all other requests. diff --git a/newsfragments/163.fixed.rst b/newsfragments/163.fixed.rst deleted file mode 100644 index bb30361..0000000 --- a/newsfragments/163.fixed.rst +++ /dev/null @@ -1,2 +0,0 @@ -Requests sent after a rate limit wait are now counted against the rate limit. -Previously they were not, so sustained use could exceed Space-Track's limits and trigger server-side rate limit errors. diff --git a/newsfragments/164.changed.rst b/newsfragments/164.changed.rst deleted file mode 100644 index bc04132..0000000 --- a/newsfragments/164.changed.rst +++ /dev/null @@ -1 +0,0 @@ -When the Space-Track session expires (after two hours without requests), the client now logs in again and retries the request transparently instead of failing every subsequent request. diff --git a/newsfragments/166.fixed.2.rst b/newsfragments/166.fixed.2.rst deleted file mode 100644 index 364a16a..0000000 --- a/newsfragments/166.fixed.2.rst +++ /dev/null @@ -1 +0,0 @@ -Setting ``base_url`` now resets the authentication state and the cached predicates, which are specific to the previous host. diff --git a/newsfragments/166.fixed.rst b/newsfragments/166.fixed.rst deleted file mode 100644 index 2da179a..0000000 --- a/newsfragments/166.fixed.rst +++ /dev/null @@ -1 +0,0 @@ -:meth:`SpaceTrackClient.close() ` and :meth:`AsyncSpaceTrackClient.close() ` now close the underlying HTTPX client even if logging out fails. diff --git a/newsfragments/167.fixed.rst b/newsfragments/167.fixed.rst deleted file mode 100644 index 738fc40..0000000 --- a/newsfragments/167.fixed.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a :class:`ReferenceError` when chaining a request off a temporary client, e.g. ``SpaceTrackClient(...).basicspacedata.gp(...)``. diff --git a/newsfragments/168.fixed.rst b/newsfragments/168.fixed.rst deleted file mode 100644 index d2daed5..0000000 --- a/newsfragments/168.fixed.rst +++ /dev/null @@ -1,2 +0,0 @@ -:meth:`~spacetrack.base.SpaceTrackClient.get_predicates` now returns the known predicates for request classes without a model definition on Space-Track (such as ``fileshare/download`` and ``publicfiles/dirs``) instead of failing. -The returned :class:`~spacetrack.base.Predicate` objects have a ``type_`` of ``None``, since no model definition exists to provide it. diff --git a/newsfragments/169.changed.rst b/newsfragments/169.changed.rst deleted file mode 100644 index 1f1892a..0000000 --- a/newsfragments/169.changed.rst +++ /dev/null @@ -1,2 +0,0 @@ -Sets and frozensets are now accepted as predicate values and joined with commas like sequences. -Bytes-like values now raise :class:`TypeError` instead of being sent as comma-separated integers. diff --git a/newsfragments/170.fixed.rst b/newsfragments/170.fixed.rst deleted file mode 100644 index fb222b5..0000000 --- a/newsfragments/170.fixed.rst +++ /dev/null @@ -1 +0,0 @@ -``parse_types=True`` now works together with ``metadata=True`` in :meth:`~spacetrack.base.SpaceTrackClient.generic_request` and the request class methods; previously the metadata-wrapped response made it fail after the request had succeeded. diff --git a/newsfragments/171.fixed.rst b/newsfragments/171.fixed.rst deleted file mode 100644 index 9e0a284..0000000 --- a/newsfragments/171.fixed.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed a :class:`TypeError` when passing positional arguments to request class methods such as ``client.gp_history(...)``. -The request class was bound as a keyword argument internally, so any positional argument clashed with it. diff --git a/newsfragments/172.fixed.rst b/newsfragments/172.fixed.rst deleted file mode 100644 index d1475ec..0000000 --- a/newsfragments/172.fixed.rst +++ /dev/null @@ -1 +0,0 @@ -Error responses whose JSON ``error`` value is not a string no longer raise :class:`TypeError` instead of ``httpx2.HTTPStatusError``. diff --git a/pyproject.toml b/pyproject.toml index 1e6b102..e542276 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "spacetrack" -version = "2.0.0" +version = "2.1.0" description = "Python client for space-track.org" readme = "README.rst" requires-python = ">=3.10" diff --git a/uv.lock b/uv.lock index 73d8a0f..59e37b8 100644 --- a/uv.lock +++ b/uv.lock @@ -1045,7 +1045,7 @@ wheels = [ [[package]] name = "spacetrack" -version = "2.0.0" +version = "2.1.0" source = { editable = "." } dependencies = [ { name = "anyio" },