Skip to content

replicant0wnz/build-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build-python

Releases Latest commit LICENSE

Easily extendible Python3 image with pyyaml, boto3, twine, black, and pytest to build and push to PyPI. Makefile can push to ECR

Usage

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/* 

Extending

  1. Clone this repository
  2. Modify Dockerfile with any additions
  3. Run make build version=$version

Pushing to ECR

  1. Modify makefile.json with your account #, ECR URI, and region
  2. Export AWS_ACCESS_KEY_ID and AWS_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}'`
  3. Run make all

About

Python3 image with pyyaml, boto3, and pytest

Resources

License

Stars

Watchers

Forks

Packages

No packages published