Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 1.57 KB

DEVELOPMENT.md

File metadata and controls

82 lines (65 loc) · 1.57 KB

AWS Toolbox -- Development

Requirements

pyenv virtualenv 3.10.13 aws-toolbox-dev
pyenv activate aws-toolbox-dev
pip install --upgrade pip
pip install -r requirements-dev.txt

Configure Pre-Commit

Install pre-commit hook for the local repo:

pre-commit install

For the first time, run pre-commit checks on the whole codebase:

pre-commit run --all-files

Install

Install the package on your local environment:

pip install -e .

Build

python -m build

Publish

To publish a new release on PyPI, you need to create a new release on GitHub, which in turns triggers a GitHub action to publish the release on PyPI.

To this aim, you first need to store the PyPI API Token as a secret on GitHub:

PYPI_API_TOKEN_BODY=$(cat resources/secrets/pypi-token.txt)
gh secret set "PYPI_API_TOKEN" \
  --app "actions" \
  --body "${PYPI_API_TOKEN_BODY}"

Create a draft release:

VERSION="1.0.0"
gh release create v${VERSION} \
--title "aws-toolbox v$VERSION" \
--target mainline \
--notes-file CHANGELOG.md \
--latest \
--draft

Make changes to the release notes.

Publish the release:

gh release edit v${VERSION} --draft=false

If you need to delete the release from GitHub:

gh release delete v${VERSION} --cleanup-tag --yes

Manually publish to PyPI test

Publish to PyPi test repo at https://test.pypi.org/project/aws-toolbox

python -m twine upload --repository testpypi dist/*

Manually publish to PyPI prod

Publish to PyPi production repo at https://pypi.org/project/aws-toolbox

python -m twine upload dist/*