Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "releases" key on the pypi JSON API is deprecated #6076

Closed
dimbleby opened this issue Jul 26, 2022 · 6 comments · Fixed by #6081
Closed

The "releases" key on the pypi JSON API is deprecated #6076

dimbleby opened this issue Jul 26, 2022 · 6 comments · Fixed by #6081
Labels
kind/bug Something isn't working as expected

Comments

@dimbleby
Copy link
Contributor

dimbleby commented Jul 26, 2022

https://warehouse.pypa.io/api-reference/json.html#project

The releases key on this response should be considered deprecated, and projects should shift to using the simple API (which can be accessed as JSON via PEP 691) to get this information where possible.

In the future, the releases key may be removed from this response.

see PyPiRepository.find_packages() for where poetry currently uses this.

@dimbleby dimbleby added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jul 26, 2022
@dimbleby dimbleby changed the title The "releases" key on the pyp JSON API is deprecated The "releases" key on the pypi JSON API is deprecated Jul 26, 2022
@dimbleby
Copy link
Contributor Author

As an alternative to #6081, perhaps someone should petition that this key if deprecated be replaced by something that is useful.

I think a sensible API and poetry's needs are aligned here:

  • it makes perfect sense to remove most of the information in releases, clients that need details for a particular version can go to the version-specific endpoint
  • but removing the capability even to learn what the available versions are seems like overshoot
  • perhaps they would be open to replacing releases with eg versions which would be just a list of the available versions

would #5971 give poetry more weight in such discussions?!

@Luned
Copy link

Luned commented Jul 27, 2022

Hi, commenting to bump this one up. This issue is also currently affecting my team's projects.

We recently released a new version of a package developed by us, and we are currently unable to upgrade to it via Poetry. By checking my package on the JSON API I noticed that the latest release is indeed not listed there. But, for example, checking here, the newest release is listed (3.2.3).

Are we close to getting a fix?

@dimbleby
Copy link
Contributor Author

this issue is not affecting your projects, you are confused with something else. The releases key is not yet removed from the API

@Luned
Copy link

Luned commented Jul 27, 2022

Hey, thanks for your answer!
I assumed it could be potentially related, since they are deprecating the releases key, there could have been some (accidental) changes on their side which is causing my issue. It could just be a huge coincidence.
I checked the pypi github and noticed that some people are reporting the same issue as myself so I am looking closely into that option as well.

Either way, I was just reporting the problem in case it was related and other people came across this, and to follow the issue as well.

@neersighted
Copy link
Member

The JSON API issue is known/ongoing and is/was tracked at pypi/warehouse#11949 -- please see the linked issues there for an explanation and add your voice to the crowd there.

neersighted pushed a commit that referenced this issue Sep 17, 2022
Resolves #6076 

I've taken the JSON version of the simple API and converted it into a
`LinkSource` so that the package-finding logic in the `PyPiRepository`
is very similar to - but annoyingly not quite the same as! - the
`LegacyRepository`.

I've also taken the opportunity to refactor the `LegacyRepository` ever
so slightly to emphasise that similarity. I think I've probably fixed a
small bug re caching and pre-releases: previously the processing for
ignored pre-releases was skipped when reading from the cache.

I believe this change will tend to be a modest performance hit. Eg
consider a package like `cryptography`, for which there are maybe a
couple of dozen downloads available at each release: to get the
available versions we now have to iterate over each of those files and
parse their names, rather than simply reading the answer.

However if the API that poetry currently uses is truly deprecated I see
little choice but to suck that up - or risk being in an awkward spot
when it is turned off. cf #5970, but worse.

Most of the changes are in the test fixtures:
- unversioned fixtures were generated from the existing fixtures: I
didn't want to download fresh data and start getting different answers
than the tests were expecting
- new versioned fixtures were downloaded fresh
poetry-bot bot pushed a commit that referenced this issue Sep 17, 2022
Resolves #6076

I've taken the JSON version of the simple API and converted it into a
`LinkSource` so that the package-finding logic in the `PyPiRepository`
is very similar to - but annoyingly not quite the same as! - the
`LegacyRepository`.

I've also taken the opportunity to refactor the `LegacyRepository` ever
so slightly to emphasise that similarity. I think I've probably fixed a
small bug re caching and pre-releases: previously the processing for
ignored pre-releases was skipped when reading from the cache.

I believe this change will tend to be a modest performance hit. Eg
consider a package like `cryptography`, for which there are maybe a
couple of dozen downloads available at each release: to get the
available versions we now have to iterate over each of those files and
parse their names, rather than simply reading the answer.

However if the API that poetry currently uses is truly deprecated I see
little choice but to suck that up - or risk being in an awkward spot
when it is turned off. cf #5970, but worse.

Most of the changes are in the test fixtures:
- unversioned fixtures were generated from the existing fixtures: I
didn't want to download fresh data and start getting different answers
than the tests were expecting
- new versioned fixtures were downloaded fresh

(cherry picked from commit b61a4dd)
neersighted pushed a commit that referenced this issue Sep 17, 2022
Resolves #6076

I've taken the JSON version of the simple API and converted it into a
`LinkSource` so that the package-finding logic in the `PyPiRepository`
is very similar to - but annoyingly not quite the same as! - the
`LegacyRepository`.

I've also taken the opportunity to refactor the `LegacyRepository` ever
so slightly to emphasise that similarity. I think I've probably fixed a
small bug re caching and pre-releases: previously the processing for
ignored pre-releases was skipped when reading from the cache.

I believe this change will tend to be a modest performance hit. Eg
consider a package like `cryptography`, for which there are maybe a
couple of dozen downloads available at each release: to get the
available versions we now have to iterate over each of those files and
parse their names, rather than simply reading the answer.

However if the API that poetry currently uses is truly deprecated I see
little choice but to suck that up - or risk being in an awkward spot
when it is turned off. cf #5970, but worse.

Most of the changes are in the test fixtures:
- unversioned fixtures were generated from the existing fixtures: I
didn't want to download fresh data and start getting different answers
than the tests were expecting
- new versioned fixtures were downloaded fresh

(cherry picked from commit b61a4dd)
@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Sep 18, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants