Hướng dẫn private python package repository
If you wish to host your own simple repository 1, you can either use a software package like devpi or you can use simply create the proper directory structure and use any web server that can serve static files and generate an autoindex. Show In either case, since you’ll be hosting a repository that is likely not in your user’s default repositories, you should instruct them in your project’s description to configure their installer appropriately. For example with pip: Unix/macOS python3 -m pip install --extra-index-url https://python.example.com/ foobar Windows py -m pip install --extra-index-url https://python.example.com/ foobar In addition, it is highly recommended that you serve your repository with valid HTTPS. At this time, the security of your user’s installations depends on all repositories using a valid HTTPS setup. “Manual” repository¶The directory layout is fairly simple, within a root directory you need to create a directory for each project. This directory should be the normalized name (as defined by PEP 503) of the project. Within each of these directories simply place each of the downloadable files. If you have the projects “Foo” (with the versions 1.0 and 2.0) and “bar” (with the version 0.1) You should end up with a structure that looks like: . ├── bar │ └── bar-0.1.tar.gz └── foo ├── Foo-1.0.tar.gz └── Foo-2.0.tar.gz Once you have this layout,
simply configure your webserver to serve the root directory with autoindex enabled. For an example using the built in Web server in Twisted, you would simply run 1 For complete documentation of the simple repository protocol, see PEP 503. Search Resultsresults matching results No ResultsUpdated Friday, July 9, 2021, by Sam Foo Traducciones al Español Create a Linode account to try this guide with a $ credit. This credit will be applied to any valid services used during your first days. How Does Python Handle Package Management?Package management in Python is available through a variety of different tools:
Before You Begin
Minimalist Python PackageThe basic scaffolding of a Python package is a
Install PyPI ServerNext, set up a server to host a package index. This guide will use
Authentication with Apache and passlib
Download From a ClientRecall the rather long flags
declared with
Although it’s possible to use
More InformationYou may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.
This page was originally published on Friday, September 15, 2017. Your Feedback Is ImportantLet us know if this guide made it easy to get the answer you needed. Join the conversation. Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site. |