astrofrog / pypi-timemachine

Install packages with pip as if you were in the past!
BSD 2-Clause "Simplified" License
111 stars 9 forks source link

allow custom API hosts #8

Open asmacdo opened 2 years ago

asmacdo commented 2 years ago

Currently, pypi.org is hardcoded into the request. Ideally this should be configurable to allow usage with a mirror.

pelson commented 1 year ago

(non maintainer here)

FWIW, that mirror would currently have to serve the (non-standardised) JSON API (info at https://warehouse.pypa.io/api-reference/json.html).

If you had such a repository, the key LOC is https://github.com/astrofrog/pypi-timemachine/blob/33e10adee1745d84904617fc0408797bdd69dab0/pypi_timemachine/core.py#L12.

It would be interesting to make use of modern PEPs to get this project working without the JSON API (PEP-691, and PEP-700, which includes upload time in the simple response).

pelson commented 1 month ago

Coming back a year later to say that I prototyped this in #10. So long as the mirror serves PEP-700 metadata, it will work nicely.