Just a demonstration how to use AWS CodeArtifact for deploying private Python packages.
See medium.com/@rare for the original instructions 🔥.
Make sure you have:
- An access token that grants you access to AWS CodeArtifact
- Set up your AWS CLI through
aws configureto be pointing atus-east-2(this is specific to Barsala)
Install some dependencies:
pip install wheel twineThis python package is super hot and can do incredible stuff.
python setup.py test
python setup.py sdist bdist_wheelaws codeartifact login --tool twine --domain barsala --repository test-package
twine upload --repository codeartifact dist/*
This creates/updates a package called barsala-test-package in our AWS account.
- Add
barsala-test-package==1.0.0to therequirements.txt(or whichever version we are on) - Configure pip to use CodeArtifact:
aws codeartifact login --tool pip --domain barsala --repository test-package - Re-install requirements:
pip install -r requirements
Usage in code:
from barsala_example.tools import is_palindrome