简体   繁体   中英

Best way to upload libraries to an offline Artifactory Pypi repo

I have an offline environment where I do development work and I'm currently downloading Python libraries (python - m pip download -r /dir/requirements.txt) on a laptop. I've just been copying the libraries in whl format to the offline env and installing locally with:
pip3 install --no-index --find-links /path/to/reqs.txt/or/library.whl

My company does have a corporate Artifactory available in the offline env and I realized the Pypi repo feature could make life a lot easier so I can run pip install just like I would in an inte.net connected environment. My question is what is the best way to upload libraries downloaded from another machine to my Artifactory pypi server?

The Artifactory documentation seems to specify that I need to create a setuptools entry for each library but I have dozens and dozens more some of my co-workers would like as well. Is there a more efficient wat to do this? I'll suck it up and put all the entries together but I figure there must be a faster way. Thanks for any insight.

To clarify, I'm a bit of an intermediate Python noob and I'm not sure I fully understand the process of uploading libraries. The Artifactory "set me up" option in the GUI essentially just says "run setup.py" and I'm too dumb to understand what to do in my scenario.

I ended up playing with Twine and installing it in my offline environment. With my.pypirc file set up correctly to my Artifactory Pypi repo, I was able to upload my.whl files using:

twine upload reponame /path/to/python/libraries/* --config-file ~/.pypirc

Where "reponame" is the name of the private repository you set up in your local.pypirc file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM