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

Is it possible to install a package located in a git repository? #548

Closed
wrosko opened this issue May 5, 2022 · 7 comments
Closed

Is it possible to install a package located in a git repository? #548

wrosko opened this issue May 5, 2022 · 7 comments

Comments

@wrosko
Copy link

wrosko commented May 5, 2022

Hi, just like this ability in poetry does flit have an option for installing git repos?
python-poetry/poetry#835

Something like "ssh://git@private.instance.url:12345/organization/mypackage.git" added to the pyproject.toml

@wrosko
Copy link
Author

wrosko commented May 5, 2022

@flying-sheep do you know if this is possible?

@wrosko
Copy link
Author

wrosko commented May 5, 2022

Ah, duplicate question here #543

@takluyver
Copy link
Member

Closing as a duplicate of #543.

@flying-sheep
Copy link
Contributor

flying-sheep commented May 5, 2022

Yeah, the blog post linked there describes the difference between abstract and concrete dependencies.

The way I’d solve it is to set up a “Python simple API” server like this: https://pypicloud.readthedocs.io/en/latest/

There’s more low tech alternatives, like PλPI or just the following script using piprepo in CI, combined with some basic auth proxy:

python -m build
piprepo sync ./dist "s3://${bucket}/${bucket_path}"
aws ecs update-service --cluster "${cluster_name}" --service "${service_name}" --force-new-deployment

Then you can

  1. upload packages to it: set up your CI to publish packages there (or publish them manually). You can use the classifier Private :: Do Not Upload to prevent accidentally uploading packages to pypi.org instead of your server

  2. install packages from it or depend on it

    export PIP_EXTRA_INDEX_URL=https://$TOKEN@pypi.yourcompany.com/simple/`
    pip install mypackage # (or some package depending on it)

Here’s some more in depth stuff: https://medium.com/jobteaser-dev-team/python-packaging-how-do-we-manage-it-at-jobteaser-2bc8d1e9d206

@flying-sheep
Copy link
Contributor

All this is a bit more complex than just adding a git URL, but will allow you to actually do dependency management. Very worth it.

@wrosko
Copy link
Author

wrosko commented May 5, 2022

Awesome, thanks so much Phil! Hope you're well :)

@flying-sheep
Copy link
Contributor

I am, I hope you too!

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

No branches or pull requests

3 participants