We have a private repo containing a Python project that is being built by setuptools on a CI/CD server and then the wheel artifact is being pushed back to Github as a release. This process works great, however getting the resulting wheel back into other build processes that require this as a dependancy does not seem so easy.
Our original process was using git submodules, however the wheel format is much better self contained, and the consuming project does not have to worry about relative paths, because the wheel is installed straight into site-packages.
The biggest issue has come with pulling and installing the wheel in any consuming projects. Adding the url of the wheel to the requirements.txt
gets pip to try to pull the wheel, but it then fails with the following:
Could not install requirement <ProjectName>==2.0 from
https://github.com/<CompanyName>/<ProjectName>/releases/download/v2.0.0/<ProjectName>-2.0-py3-none-any.whl (from -r
requirements.txt (line 27)) because of HTTP error 404 Client Error: Not Found for url
A 404 error is also returned if following the url in a private browser window. If the url is followed on a browser already logged in to GitHub, the wheel is returned. Inspecting the request that got the wheel shows that the browser sent a cookie that let GitHub know that this wheel belonged to me, but sending cookies programatically doesn't seem like a great idea.
The following questions both touch on the same topic. The accepted answer for the first question seems not very elegent - hopefully there is a better method somewhere!
How do I download binary files of a GitHub release?
pip install wheel version from private github repo
Thanks
Stuart