A simple template for Urban Machine Python3.9+ projects utilizing black + isort + flake8 + poetry + mypy + bandit + bugbear + more goodness. Best used with cruft
-
Create an empty branch called
template
git checkout --orphan template
-
Remove all staged files from this branch
git reset --hard
-
Ensure you have
cruft
installed. In a virtual environment, runpip install cruft
-
Create a cookiecutter repository
cruft create [email protected]:UrbanMachine/cookiecutter-python-template.git
-
Copy the generated files into the project directory and track them on git
-
Double check everything is up-to-date by running
cruft check
-
Merge
template
into the main branch of the repository.You may need to use:
git merge --allow-unrelated-histories
-
Delete the
template
branch
- Run
cruft update --allow-untracked-files
and follow the prompts. - Resolve merge conflicts
This process requires being an Admin on the github org.
- Go to [Codecov][https://about.codecov.io/sign-up/] and sign in with your Github.
- Go to the repository you wish to add, and select 'Activate'.
- Go to https://github.com/UrbanMachine/PROJECT_NAME/settings/secrets/actions, and create a new secret called
CODECOV_TOKEN
. Paste the token that is given under the "Overview" tab of https://app.codecov.io/gh/UrbanMachine/PROJECT_NAME/ as the value. - You should now be able to see code coverage under codecov!
By default, the lint action will fail because cruft
will be unable to clone the template
repository. To fix this:
- Generate a new private SSH key using
ssh-keygen
- Go to https://github.com/UrbanMachine/PROJECT_NAME/settings/secrets/actions, create a new secret called
SSH_KEY
, and store theid_rsa
file there. - Go to https://github.com/UrbanMachine/PROJECT_NAME/settings/keys, create a new deploy key (name irrelevant), and store the
id_rsa.pub
file there.