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

Proof-of-concept for using simple-repository instead of the non-standards based JSON API #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pelson
Copy link

@pelson pelson commented Sep 10, 2024

👋 @astrofrog (long time no see... hope you're doing well!)

I have been working on providing package repository infrastructure at work, and have built up a set of libraries that make building custom repositories child's play 😜. In fact, I thought I would test it out on your awesome pypi-timemachine, and include my <30min hack in this PR. The result is a fully functional prototype (though I was disappointed with the fact that implementing #7 wasn't so easy due to some inflexibility in the simple-repository-server router definition - I will refine that 😉)

A huge advantage of the approach taken in this PR is that you no longer rely on the (original and non-standardised) JSON API, and instead are using the PEP-503++ goodness that is out there on PyPI already.

I doubt you actually want to merge this (just yet at least) - the simple-repository codebase is still in preview / not-yet-maintained stage, and I would be fine if you want to go ahead and close the PR without merge.

@@ -31,11 +31,21 @@ This will start up a Flask app, and will print out a line such as::

You can then call pip with::

pip install --index-url http://127.0.0.1:5000/ astropy
pip install --index-url http://127.0.0.1:5000/simple/ astropy
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also caused by some inflexibility on simple-repository-server (at https://github.com/simple-repository/simple-repository-server/blob/main/simple_repository_server/routers/simple.py#L41).

There is no good reason for this limitation, but it would require some more thought than I have capacity for this evening 😴

@pelson pelson mentioned this pull request Sep 10, 2024
@@ -40,43 +100,20 @@ def main(cutoff_date, port, quiet):

CUTOFF = parse_iso(cutoff_date)

INDEX = requests.get(MAIN_PYPI).content
repo = DateFilteredReleases(
HttpRepository(MAIN_PYPI),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to say: There is no real reason not to parameterise this now... it is something that has been asked for to support private indexes. (e.g. https://www.reddit.com/r/Python/comments/1cte019/comment/l4bh02p/ #8)

@astrofrog
Copy link
Owner

astrofrog commented Jan 14, 2025

@pelson - sorry for not replying sooner, and thank you so much for working on this! Do you consider simple-repository maintained well enough at this point for me to rely on it? If so, I'll happily go ahead and review this! (and has anything changed with respect to being able to implement #7?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants