-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Install packages up to a certain date #6257
Comments
I feel this should be handled by version specifiers. Dates are just a less robust way to do the same thing. |
Alternatively, maybe PyPI can have a feature like a way back machine, accepting a date parameter to show only packages up to some point…? I don’t know, that sounds like a cool feature, but probably difficult to implement. |
If the data is available on PyPI, then a small front-end that wraps PyPI in a service that only returns packages that were available on a particular date should be very easy to do. I suspect there are a lot of situations where a small adapter webapp in front of PyPI would be the simplest solution, rather than adding more features to either pip or PyPI. |
@pfmoore Good point. The simple API does not have such information, but for PyPI (warehouse, specifically), the publish time is available via the JSON API, so it should be straightforward to build a server that fetches data from there and renders a simple API page. |
The PyPI side of this should be covered by pypi/warehouse#6215. The author of that issue also included a link to their project, pypi-timemachine, which implements the desired behavior. |
I think that this would be very useful when creating Docker containers. Right now I need to write a Dockerfile that does all the installs and pip freezes the installation, then run a container to copy the requirements.txt out of the container, then change the Dockerfile to copy the requirements.txt into the context and use pip install -r rather than installing individual packages. Instead I could just put the current date in the Dockerfile and it would work forever. Does anyone have a better workflow? |
I think pypi-timemachine covers the use case and it is not general enough to be included in pip. Combined with uranusjr/simpleindex#16 you’d have a complete one-command solution. I’ll venture to close this as no-action for now. |
Reopened based on pypi/warehouse#6215 (comment) |
Isn't this the same as #12275 ? |
I would add the more recent discussion is in #12275 as it is based on the standardized upload-time field in the Simple API 1.1, as opposed to the discussion in this thread which is about the non standard PyPI JSON API |
What's the problem this feature will solve?
Some old python apps wont work with the latest packages. Using this date parameter feature like the version number parameter feature would allow us to use some older apps that are no longer supported or being developed.
Describe the solution you'd like
Pip would look up the latest packages before a certain date or between two dates and only install packages up to that date or in that time span.
If you have an old app that only works with the old packages you can not run it now, but with this feature you could get all the necessary package versions to be able to use the app.
Alternative Solutions
The only other idea was to manually search for the right package versions but with many dependencies it would take a very long time.
Additional context
I would like to use the old nRF Connect for my Nordic Power Profiler Kit because the new one is missing a key feature I need.
The old one is written in python but it's not supported anymore.
The text was updated successfully, but these errors were encountered: