Easily extendible Python3 image with pyyaml, boto3, twine, black, and pytest to build and push to PyPI. Makefile
can push to ECR
Examples
Run pytest in project directory
docker run -v $PWD:/opt -w /opt replicant0wnz/build-python:latest python -m pytest tests
Build project
docker run -v $PWD:/opt -w /opt replicant0wnz/build-python:latest python -m build
Push project to PyPI test
docker run -v $PWD:/opt -w /opt \
-e TWINE_USERNAME=$PYPI_USERNAME -e TWINE_PASSWORD=$PYPI_PASSWORD \
replicant0wnz/build-python:latest \
python -m twine upload --repository testpypi dist/*
- Clone this repository
- Modify
Dockerfile
with any additions - Run
make build version=$version
- Modify
makefile.json
with your account #, ECR URI, and region - Export
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
- Example:
export AWS_ACCESS_KEY_ID=`grep aws_access_key_id ~/.aws/credentials | awk '{print $3}'` export AWS_SECRET_ACCESS_KEY=`grep aws_secret_access_key ~/.aws/credentials | awk '{print $3}'`
- Example:
- Run
make all