Created
April 13, 2022 08:47
-
-
Save Geremie/1095be7b6aa3c67332dff21484e0ba23 to your computer and use it in GitHub Desktop.
Manage your Private Python Packages with Artifact Registry (Part 1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Clone the sample python package | |
| git clone https://gitlab.com/marcdjoh/sample-python-package.git | |
| # Create a python virtual environment (command for python3) | |
| python3 -m venv py3-env | |
| # Activate the python virtual environment | |
| source py3-env/bin/activate | |
| # Install twine, keyrings.google-artifactregistry-auth and wheel | |
| pip install twine keyrings.google-artifactregistry-auth wheel | |
| # Build the sample python package | |
| python setup.py bdist_wheel | |
| # Authenticate to your GCP project | |
| gcloud config set account <your_gcp_account_email> | |
| gcloud config set project <your_gcp_project> | |
| gcloud auth application-default login | |
| # Deploy the sample python package to artifact registry | |
| twine upload https://<your_repository_location>-python.pkg.dev/<your_gcp_project>/<your_repository_name> dist/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment