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

Allow usage of UV, CPython and pypy mirrors #146

Closed
Coruscant11 opened this issue Jul 26, 2024 · 5 comments
Closed

Allow usage of UV, CPython and pypy mirrors #146

Coruscant11 opened this issue Jul 26, 2024 · 5 comments

Comments

@Coruscant11
Copy link
Contributor

Coruscant11 commented Jul 26, 2024

First let me thank you again for this wonderful tool!

Context

We want to use pyapp in order to make easier the deployment and installation of some of ours CI/CD python tools.
However, depending on the environments, sometimes the connection to the public internet is closed. We want to be able to target our own mirrors, for which we have an network connectivity. These mirrors are proxying known external providers, including GitHub, and caching stuff.

Example: https://jfrog.com/help/r/jfrog-artifactory-documentation/configure-vcs-repository-layout

Currently, if you do not hardcode a specific distribution file URL with PYAPP_DISTRIBUTION_SOURCE, pyapp will always download UV, CPython and Pypy from their official source:

I think this is issue can really be a blocker-point in large companies.
In fact, I want to promote pyapp as much as possible in my company and this is a mandatory feature for us.

Proposition

A simple solution would be to add three new environment variables:

  • PYAPP_DISTRIBUTION_CPYTHON_REPOSITORY
  • PYAPP_DISTRIBUTION_PYPY_HOST
  • PYAPP_UV_REPOSITORY

By default, they will keep the same url as before.
It's important to understand that we will keep the same download scheme. If we change the GitHub repository of UV or python-build-standalone, we will still downloads the artifacts from the release section of the repository.

Contribution

I worked on a pull-request and validated that the whole compilation & binary are working without any connectivity to GitHub when I set up the options.
I will link the pull-request to this issue.

@Coruscant11 Coruscant11 changed the title Allow usage of python-build-standalone and uv fork/mirror Allows usage of UV, CPython and pypy mirrors Jul 26, 2024
@Coruscant11 Coruscant11 changed the title Allows usage of UV, CPython and pypy mirrors Allow usage of UV, CPython and pypy mirrors Jul 26, 2024
@ofek
Copy link
Owner

ofek commented Aug 3, 2024

Actually, upon having time to look at this in more detail I'm quite confused. Why doesn't setting the PYAPP_DISTRIBUTION_SOURCE and associated custom options suffice? This would be adding just another way to do that, I don't see the benefit.

For UV however I understand because there is no option currently.

@ofek
Copy link
Owner

ofek commented Aug 3, 2024

#153

@Coruscant11
Copy link
Contributor Author

Coruscant11 commented Aug 3, 2024

Actually, upon having time to look at this in more detail I'm quite confused. Why doesn't setting the PYAPP_DISTRIBUTION_SOURCE and associated custom options suffice? This would be adding just another way to do that, I don't see the benefit.

For UV however I understand because there is no option currently.

Hi @ofek, yes you're totally right!
I'm sorry, I think I must have been confused because of the change of the strategy since the first comments 😄
Yes, indeed, it's just adding the possibility to configure per python version, it's not very useful

@Coruscant11
Copy link
Contributor Author

Coruscant11 commented Aug 3, 2024

pyapp is not handling multiple python versions at the same time like hatch, so I guess we don't need the exact same dynamic option!

Guess we can close this issue? 🙂

@ofek
Copy link
Owner

ofek commented Aug 4, 2024

Okay then, thank you! Just released https://github.com/ofek/pyapp/releases/tag/v0.23.0

@ofek ofek closed this as completed Aug 4, 2024
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 a pull request may close this issue.

2 participants