1. Construction 1. Prepare htpasswd.txt file The file contains the username and password for verification when uploading the package to the warehouse.
2. Start the container
3. Set up nginx reverse proxy cat /usr/local/nginx/conf/exten/pypi.conf upstream pypi { server 127.0.0.1:8080; } server { listen 80; server_name pypi.local.me; location / { proxy_pass_header Server; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; proxy_pass http://pypi; } } 2. Use 1. Create a test project # Create a project directory mkdir -p linode_example/linode_example # Create setup.py cat linode_example/setup.py from setuptools import setup setup( name='linode_example', packages=['linode_example'], #Directory after uploading to the warehouse, such as http://pypi.local.me/linode_example description = 'Hello world enterprise edition', version='0.1', # version number url='http://github.com/example/linode_example', author='Linode', keywords=['pip','linode','example'] ) # The content of this file is for explanatory purposes only. You can set it according to your own package. # Create the __init__.py main program cat linode_example/linode_example/__init__.py def hello_word(): print("hello world") #Package and upload python3.7 setup.py sdist #Package. After execution, there will be a tarball in the dist directory twine upload --repository-url http://pypi.local.me dist/* #Username and password are required when uploading: admin/admin123 2. Use the package uploaded to the warehouse pip install -i http://pypi.local.me --trusted-host pypi.local.me linode_example Packing Notes: 1. The directory structure of all projects that need to be packaged in the git repository must be consistent to facilitate automated integration of Jenkinsfile; 2. The setup.py files of all projects that need to be packaged must be located in the project root directory; 3. Python uses a unified version, and the version of each project needs to be fixed to facilitate iteration. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Summary of 10 amazing tricks of Element-UI
>>: Q&A: Differences between XML and HTML
Table of contents Preface 1. What variables are p...
Dig Introduction: Dig is a tool that queries DNS ...
Table of contents Event-driven and publish-subscr...
Preface 1. The tools used in this article can be ...
Table of contents 1. Download the installation pa...
Organize the MySQL 5.5 installation and configura...
This article shares the specific code of typescri...
First of all, we need to make it clear why we use...
Preface The previous article installed Hadoop, an...
Table of contents 1. Introduction 2. Rendering 3....
CocosCreator version: 2.3.4 Most games have layer...
I knew before that to synchronously obtain the re...
lsof (list open files) is a tool to view files op...
Recently I saw a barrage effect on B station call...
I struggled with this for a long time, and after s...