|
7 | 7 |
|
8 | 8 | # python-src-template |
9 | 9 |
|
10 | | -## Playing around with a new structure. See the releases for previous structures. |
| 10 | +A template I use for most projects and is setup to jive with my environment at the company I work with. |
11 | 11 |
|
12 | | -## A template I use for most projects. |
| 12 | +This is not the one-shot solution to project structure or packaging. This is |
| 13 | +just what works well for one egg on the Internet. Feel free to use it as you see |
| 14 | +fit. |
13 | 15 |
|
14 | | -Straight forward to use! |
15 | | - |
16 | | -**Kind of...** |
| 16 | +The primary setup here uses dynamically loaded requirement files from the |
| 17 | +`./requirements` directory in the pyproject.toml file. This is ideal for |
| 18 | +micro-services, applications, or scripts that need all requirements pinned. |
| 19 | +Pinning is handled by `pip-compile`. The files in `./alt_files` offer an |
| 20 | +alternative where all requirements are kept within the pyproject.toml file and |
| 21 | +any pinning is manually managed. |
17 | 22 |
|
18 | 23 | --- |
19 | 24 |
|
@@ -90,10 +95,16 @@ Run pre-commit on all files: |
90 | 95 | $ pre-commit run --all-files |
91 | 96 | ``` |
92 | 97 |
|
93 | | -Run tests: |
| 98 | +Run tests (quick): |
| 99 | + |
| 100 | +```console |
| 101 | +$ pytest |
| 102 | +``` |
| 103 | + |
| 104 | +Run tests (slow): |
94 | 105 |
|
95 | 106 | ```console |
96 | | -$ tox [-r] [-e py3x] |
| 107 | +$ tox |
97 | 108 | ``` |
98 | 109 |
|
99 | 110 | Build dist: |
@@ -143,13 +154,11 @@ This repo has a Makefile with some quality of life scripts if the system |
143 | 154 | supports `make`. Please note there are no checks for an active `venv` in the |
144 | 155 | Makefile. |
145 | 156 |
|
146 | | -| PHONY | Description | |
147 | | -| -------------- | ------------------------------------------------------------------------------------------ | |
148 | | -| `install` | install the project | |
149 | | -| `install-dev` | install development/test requirements and project as editable install | |
150 | | -| `upgrade-dev` | update all dependencies, regenerate requirements.txt (disabled by default) | |
151 | | -| `coverage` | Run tests with coverage, generate html report, and open browser (double check based on os) | |
152 | | -| `docker-test' | Run coverage and tests in a docker container. | |
153 | | -| `docker-clean` | Run `docker system prune -f` | |
154 | | -| `build-dist` | Build source distribution and wheel distribution | |
155 | | -| `clean` | Deletes build, tox, coverage, pytest, mypy, cache, and pyc artifacts | |
| 157 | +| PHONY | Description | |
| 158 | +| ------------- | --------------------------------------------------------------------- | |
| 159 | +| `install-dev` | install development/test requirements and project as editable install | |
| 160 | +| `upgrade-dev` | update all dependencies, regenerate requirements.txt | |
| 161 | +| `coverage` | Run tests with coverage, generate console report | |
| 162 | +| `docker-test' | Run coverage and tests in a docker container. | |
| 163 | +| `build-dist` | Build source distribution and wheel distribution | |
| 164 | +| `clean` | Deletes build, tox, coverage, pytest, mypy, cache, and pyc artifacts | |
0 commit comments