|
| 1 | +# python-cli-template |
| 2 | + |
| 3 | +A template repository for creating Python CLI applications. |
| 4 | + |
| 5 | +## App setup (delete this section and above after initial application setup) |
| 6 | + |
| 7 | +1. Rename "app" to the desired app name across the repo. (May be helpful to do a project-wide find-and-replace). |
| 8 | +2. Update Python version if needed. |
| 9 | +3. Install all dependencies with `make install` to create initial Pipfile.lock with latest dependency versions. |
| 10 | +4. Add initial app description to README and update initial required ENV variable documentation as needed. |
| 11 | +5. Update license if needed (check app-specific dependencies for licensing terms). |
| 12 | +6. Check Github repository settings: |
| 13 | + - Confirm repo branch protection settings are correct (see [dev docs](https://mitlibraries.github.io/guides/basics/github.html) for details) |
| 14 | + - Confirm that all of the following are enabled in the repo's code security and analysis settings: |
| 15 | + - Dependabot alerts |
| 16 | + - Dependabot security updates |
| 17 | + - Secret scanning |
| 18 | +7. Create a Sentry project for the app if needed (we want this for most apps): |
| 19 | + - Send initial exceptions to Sentry project for dev, stage, and prod environments to create them. |
| 20 | + - Create an alert for the prod environment only, with notifications sent to the appropriate team(s). |
| 21 | + - If *not* using Sentry, delete Sentry configuration from config.py and test_config.py, and remove sentry_sdk from project dependencies. |
| 22 | + |
| 23 | +# app |
| 24 | + |
| 25 | +Description of the app |
| 26 | + |
| 27 | +## Development |
| 28 | + |
| 29 | +- To install with dev dependencies: `make install` |
| 30 | +- To update dependencies: `make update` |
| 31 | +- To run unit tests: `make test` |
| 32 | +- To lint the repo: `make lint` |
| 33 | +- To run the app: `pipenv run app --help` |
| 34 | + |
| 35 | +## Required ENV |
| 36 | + |
| 37 | +- `SENTRY_DSN` = If set to a valid Sentry DSN, enables Sentry exception monitoring. This is not needed for local development. |
| 38 | +- `WORKSPACE` = Set to `dev` for local development, this will be set to `stage` and `prod` in those environments by Terraform. |
0 commit comments