The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.
This document describes how to store PyPI artifacts in CODING-AR for centralized artifact management and version control. The following sections introduce how to create an artifact, configure authentication, and pull and push artifacts.
Configure artifact repository authentication information
Before pushing to the CODING artifact repository, you need to add the corresponding authentication information in the local file. You can authenticate through either automatic configuration or manual configuration. Before proceeding, please use the command cd / to go to the root directory and enter ls -a to check if the .pypirc and pip.conf files exist.
If not, enter the following commands to create the two files.
touch .pypirc && touch pip.conf
Automatic configuration
1. Click on the website to generate a personal token as credentials, and the system will automatically generate access credentials for you. To view the personal token, go to Account Settings > Access Tokens for management.
2. Enter your login password to confirm and obtain the configuration.
Copy the configuration content into the root directory's .pypirc and pip.conf files.
Push an Artifact
Enter the project directory, such as the previously created Demo directory, copy the command from the website and execute it in the terminal to push all artifacts in the Demo/dist directory to the artifact repository.
twine upload -r coding-pypi dist/*
After the artifact is pushed successfully, refresh the page to view the latest artifacts.
Pull
Based on the specific artifact retrieval guidelines in the PyPI artifact repository, you can execute pip install to retrieve artifacts.
pip install <artifact name>
Configure a Proxy
If you try to pull an artifact that does not exist in the CODING private repository, the system will try to pull from the configured proxy. You can add a third-party artifact source to obtain artifacts from the specific repository. Without the need for configuration, CODING will retrieve artifacts in sequence from top to bottom.
Use the command generated on the webpage, replace <package> with the package name to complete the pull. The artifact and its dependencies will be successfully pulled to the local machine and synchronized to the CODING Artifact Repository. The package source will be shown on the details page.