anomaly / anomaly/gallagher

Provide `@available` and `@deprecated` decorators for API endpoints to annotate them against Command Centre releases

Offen
#69 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @devraj Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Python
Sterne
17
Forks
2
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Is your feature request related to a problem? Please describe.**
While working on a client project we realised that they are running `v8.9` of the Command Centre software. All of our testing has been against the `9.x` releases (even which is advancing rapidly, two releases a year).

Developers necessarily can't know ahead of time which Command Centre their software will be used against e.g our own Terminal or Command line interfaces.

This poses an issue where a feature may not be available and it can only be determined at runtime.

**Describe the solution you'd like**
The core of our API should make available two `decorators`:
- `@available` - which would allow the developer to annotate an endpoint being available from a certain version of the Command Centre
- `@deprecated` - denoting that an API call has been deprecated and will be remove in a future release

If none of these decorators are applied then its assumed that the API endpoint is generally available, or available since the existence of the Command Centre REST API.

Each decorator should take a formatted SemVer string to denote which version a feature became available or which version of the library a method call will be deprecated (See also warnings package refactor).

For example `@available('>9.10')`

**Describe alternatives you've considered**
NA

**Additional context**
- Python `3.13` introduces the [`deprecated` decorator](https://docs.python.org/3/library/warnings.html) in the `warnings` package. At the moment this library is aimed at Python `3.11+`.
- We might want to leave another ticket open once this is implemented to refactor the implementation (if appropriate) to the `warnings` package when the project is rebased for Python `3.13`
- See also #3
- See also `dto/response/discover.py` for `DiscoveryResponse` which has the `version` attribute and is queried dynamically from the API in accordance with #5
- Read on [version range operators](https://docs.npmjs.com/about-semantic-versioning) to support properly matching the version strings.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.