common-python-tasks 0.4.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- common_python_tasks-0.5.0/.gitignore +216 -0
- common_python_tasks-0.5.0/.poetry/plugins/poetry_dynamic_versioning-1.10.0.dist-info/licenses/LICENSE +21 -0
- common_python_tasks-0.5.0/.poetry/plugins/poetry_plugin_export-1.10.0.dist-info/licenses/LICENSE +20 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/PKG-INFO +68 -49
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/README.md +48 -27
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/pyproject.toml +14 -13
- common_python_tasks-0.5.0/scripts/add_common_python_tasks.py +143 -0
- common_python_tasks-0.5.0/scripts/release_script.py +175 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/fastapi/compose-base.yml.j2 +2 -1
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/fastapi/compose-db.yml.j2 +2 -1
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/generic/Dockerfile.j2 +40 -7
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/docker.py +30 -18
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/docker_compose.py +7 -4
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/env.py +25 -12
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/git.py +3 -6
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/github.py +37 -9
- common_python_tasks-0.5.0/src/common_python_tasks/project.py +676 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/tasks.py +45 -35
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/utils.py +24 -0
- common_python_tasks-0.4.0/src/common_python_tasks/data/generic/.pytest_cache/.gitignore +0 -2
- common_python_tasks-0.4.0/src/common_python_tasks/data/generic/.pytest_cache/CACHEDIR.TAG +0 -4
- common_python_tasks-0.4.0/src/common_python_tasks/data/generic/.pytest_cache/README.md +0 -8
- common_python_tasks-0.4.0/src/common_python_tasks/data/generic/.pytest_cache/v/cache/lastfailed +0 -12
- common_python_tasks-0.4.0/src/common_python_tasks/data/generic/.pytest_cache/v/cache/nodeids +0 -567
- common_python_tasks-0.4.0/src/common_python_tasks/project.py +0 -367
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/LICENSE +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/__init__.py +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/__main__.py +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/dockerfile_extensions/.gitkeep +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/fastapi/alembic.ini.j2 +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/fastapi/compose-db-debug.yml.j2 +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/fastapi/compose-debug.yml.j2 +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/generic/.coveragerc +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/generic/.dockerignore +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/generic/.flake8 +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/generic/.isort.cfg +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/generic/Dockerfile.deps.j2 +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/generic/cliff.toml +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.5.0}/src/common_python_tasks/data/generic/pytest.ini +0 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
# Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
poetry.lock
|
|
109
|
+
# poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
# pdm.lock
|
|
116
|
+
# pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
# pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# Redis
|
|
135
|
+
*.rdb
|
|
136
|
+
*.aof
|
|
137
|
+
*.pid
|
|
138
|
+
|
|
139
|
+
# RabbitMQ
|
|
140
|
+
mnesia/
|
|
141
|
+
rabbitmq/
|
|
142
|
+
rabbitmq-data/
|
|
143
|
+
|
|
144
|
+
# ActiveMQ
|
|
145
|
+
activemq-data/
|
|
146
|
+
|
|
147
|
+
# SageMath parsed files
|
|
148
|
+
*.sage.py
|
|
149
|
+
|
|
150
|
+
# Environments
|
|
151
|
+
.env
|
|
152
|
+
.envrc
|
|
153
|
+
.venv
|
|
154
|
+
env/
|
|
155
|
+
venv/
|
|
156
|
+
ENV/
|
|
157
|
+
env.bak/
|
|
158
|
+
venv.bak/
|
|
159
|
+
|
|
160
|
+
# Spyder project settings
|
|
161
|
+
.spyderproject
|
|
162
|
+
.spyproject
|
|
163
|
+
|
|
164
|
+
# Rope project settings
|
|
165
|
+
.ropeproject
|
|
166
|
+
|
|
167
|
+
# mkdocs documentation
|
|
168
|
+
/site
|
|
169
|
+
|
|
170
|
+
# mypy
|
|
171
|
+
.mypy_cache/
|
|
172
|
+
.dmypy.json
|
|
173
|
+
dmypy.json
|
|
174
|
+
|
|
175
|
+
# Pyre type checker
|
|
176
|
+
.pyre/
|
|
177
|
+
|
|
178
|
+
# pytype static type analyzer
|
|
179
|
+
.pytype/
|
|
180
|
+
|
|
181
|
+
# Cython debug symbols
|
|
182
|
+
cython_debug/
|
|
183
|
+
|
|
184
|
+
# PyCharm
|
|
185
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
186
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
188
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
189
|
+
# .idea/
|
|
190
|
+
|
|
191
|
+
# Abstra
|
|
192
|
+
# Abstra is an AI-powered process automation framework.
|
|
193
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
194
|
+
# Learn more at https://abstra.io/docs
|
|
195
|
+
.abstra/
|
|
196
|
+
|
|
197
|
+
# Visual Studio Code
|
|
198
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
199
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
200
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
201
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
202
|
+
# .vscode/
|
|
203
|
+
|
|
204
|
+
# Ruff stuff:
|
|
205
|
+
.ruff_cache/
|
|
206
|
+
|
|
207
|
+
# PyPI configuration file
|
|
208
|
+
.pypirc
|
|
209
|
+
|
|
210
|
+
# Marimo
|
|
211
|
+
marimo/_static/
|
|
212
|
+
marimo/_lsp/
|
|
213
|
+
__marimo__/
|
|
214
|
+
|
|
215
|
+
# Streamlit
|
|
216
|
+
.streamlit/secrets.toml
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Matthew T. Kennerly (mtkennerly)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
common_python_tasks-0.5.0/.poetry/plugins/poetry_plugin_export-1.10.0.dist-info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2022 Sébastien Eustace
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: common-python-tasks
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Opinionated Poe the Poet tasks for Python package development.
|
|
5
|
+
Project-URL: Homepage, http://github.com/ci-sourcerer/common-python-tasks
|
|
6
|
+
Project-URL: Source, http://github.com/ci-sourcerer/common-python-tasks.git
|
|
7
|
+
Project-URL: Issues, http://github.com/ci-sourcerer/common-python-tasks/issues
|
|
8
|
+
Author-email: Joseph Asbury <ci_sourcerer@yahoo.com>
|
|
5
9
|
License-Expression: MIT
|
|
6
10
|
License-File: LICENSE
|
|
7
|
-
Author: Joseph Asbury
|
|
8
|
-
Author-email: ci_sourcerer@yahoo.com
|
|
9
|
-
Requires-Python: >=3.11,<4.0
|
|
10
11
|
Classifier: Development Status :: 3 - Alpha
|
|
11
12
|
Classifier: Intended Audience :: Developers
|
|
12
13
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -15,23 +16,21 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
15
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
17
|
Classifier: Programming Language :: Python :: 3.14
|
|
17
18
|
Classifier: Topic :: Software Development :: Build Tools
|
|
18
|
-
Requires-
|
|
19
|
-
Requires-Dist:
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist:
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist: pytest-cov
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
|
|
33
|
-
Project-URL: Issues, http://github.com/ci-sourcerer/common-python-tasks/issues
|
|
34
|
-
Project-URL: Source, http://github.com/ci-sourcerer/common-python-tasks.git
|
|
19
|
+
Requires-Python: <4.0,>=3.11
|
|
20
|
+
Requires-Dist: autoflake<3.0.0,>=2.3.1
|
|
21
|
+
Requires-Dist: black<27.0.0,>=26.3.1
|
|
22
|
+
Requires-Dist: docker<8.0.0,>=7.1.0
|
|
23
|
+
Requires-Dist: dunamai<2.0.0,>=1.25.0
|
|
24
|
+
Requires-Dist: flake8<8.0.0,>=7.3.0
|
|
25
|
+
Requires-Dist: git-cliff<3.0.0,>=2.12.0
|
|
26
|
+
Requires-Dist: isort<9.0.0,>=8.0.1
|
|
27
|
+
Requires-Dist: jinja2<4.0.0,>=3.1.6
|
|
28
|
+
Requires-Dist: packaging<27.0,>=26.2
|
|
29
|
+
Requires-Dist: poethepoet-tasks<0.4.0,>=0.3.0
|
|
30
|
+
Requires-Dist: pytest-cov<8.0.0,>=7.0.0
|
|
31
|
+
Requires-Dist: pytest<10.0.0,>=9.0.3
|
|
32
|
+
Requires-Dist: requests<3.0.0,>=2.34.2
|
|
33
|
+
Requires-Dist: tomlkit<0.14.0,>=0.13.3
|
|
35
34
|
Description-Content-Type: text/markdown
|
|
36
35
|
|
|
37
36
|
# Common Python Tasks
|
|
@@ -47,21 +46,23 @@ Instead of writing your own tasks for formatting, linting, testing, packaging, a
|
|
|
47
46
|
You can add `common-python-tasks` to a new project by using the handy automated installation script.
|
|
48
47
|
|
|
49
48
|
```shell
|
|
50
|
-
curl -sSL https://api.github.com/repos/ci-sourcerer/common-python-tasks/contents/scripts/
|
|
49
|
+
curl -sSL https://api.github.com/repos/ci-sourcerer/common-python-tasks/contents/scripts/add_common_python_tasks.py | jq -r '.content' | base64 -d | python3
|
|
51
50
|
```
|
|
52
51
|
|
|
53
52
|
To install a specific release, set the environment variable `COMMON_PYTHON_TASKS_VERSION`.
|
|
54
53
|
|
|
55
54
|
```shell
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
curl -sSL https://api.github.com/repos/ci-sourcerer/common-python-tasks/contents/scripts/add_common_python_tasks.py \
|
|
56
|
+
| jq -r '.content' \
|
|
57
|
+
| base64 -d \
|
|
58
|
+
| COMMON_PYTHON_TASKS_VERSION=0.5.0 python3
|
|
58
59
|
```
|
|
59
60
|
|
|
60
61
|
This will complete the following steps.
|
|
61
62
|
|
|
62
63
|
1. Add the latest version of `common-python-tasks` to your `pyproject.toml` dependencies
|
|
63
64
|
2. Configure Poe the Poet to expose the default common task set
|
|
64
|
-
3. Install
|
|
65
|
+
3. Install dependencies for your project
|
|
65
66
|
|
|
66
67
|
**Always review scripts before running them!** Even though I believe I write good software, it's best practice to verify any script you download from the Internet.
|
|
67
68
|
|
|
@@ -74,7 +75,7 @@ There's no real reason to run the automated script; I just like automating every
|
|
|
74
75
|
```toml
|
|
75
76
|
[project]
|
|
76
77
|
dependencies = [
|
|
77
|
-
"common-python-tasks==0.
|
|
78
|
+
"common-python-tasks==0.5.0" # Always pin to a specific version
|
|
78
79
|
]
|
|
79
80
|
|
|
80
81
|
[tool.poe]
|
|
@@ -84,6 +85,8 @@ There's no real reason to run the automated script; I just like automating every
|
|
|
84
85
|
2. Install the package
|
|
85
86
|
|
|
86
87
|
```shell
|
|
88
|
+
uv sync
|
|
89
|
+
# or, for Poetry workflows
|
|
87
90
|
poetry install
|
|
88
91
|
```
|
|
89
92
|
|
|
@@ -196,15 +199,30 @@ The `fastapi` stack includes a service for your FastAPI application. It uses the
|
|
|
196
199
|
|
|
197
200
|
Your project must meet the following requirements.
|
|
198
201
|
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
+
- Uses Poetry or uv for dependency management
|
|
203
|
+
- Uses Poe the Poet for task management
|
|
204
|
+
- Has `poetry-dynamic-versioning` or `uv-dynamic-versioning` as a dependency
|
|
205
|
+
- Has a `pyproject.toml` file at the root
|
|
206
|
+
- Has a package name (automatically inferred from `project.name` in `pyproject.toml` or set via `PACKAGE_NAME` environment variable)
|
|
207
|
+
|
|
208
|
+
### Package manager backend selection
|
|
209
|
+
|
|
210
|
+
Packaging-related tasks (`build-package`, `publish-package`, release tagging/version resolution, and related container build metadata) support both Poetry and uv.
|
|
211
|
+
|
|
212
|
+
Backend selection uses this precedence.
|
|
213
|
+
|
|
214
|
+
1. `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
|
|
215
|
+
2. `COMMON_PYTHON_TASKS_BUILD_TOOL`
|
|
216
|
+
3. `PACKAGE_MANAGER`
|
|
217
|
+
4. Auto-discovery (`auto`) based on installed tools and project metadata
|
|
218
|
+
|
|
219
|
+
Supported values are `poetry`, `uv`, and `auto`.
|
|
202
220
|
|
|
203
221
|
### Configuration precedence
|
|
204
222
|
|
|
205
223
|
Tasks that need configuration files (`pytest`, `coverage`, `flake8`, `isort`) follow this order of precedence.
|
|
206
224
|
|
|
207
|
-
1. **`pyproject.toml` sections**: `[tool.pytest]`, `[tool.coverage]`, `[tool.isort]` take priority
|
|
225
|
+
1. **`pyproject.toml` sections**: `[tool.pytest.ini_options]`, `[tool.coverage]`, `[tool.isort]` take priority
|
|
208
226
|
2. **Environment variables**: Override config paths; see [Environment Variables](#environment-variables)
|
|
209
227
|
3. **Local config files**: `pytest.ini`, `.coveragerc`, `.flake8`, `.isort.cfg` in the project root
|
|
210
228
|
4. **Bundled defaults**: Sensible defaults included with this package, found in the [`src/common_python_tasks/data`](src/common_python_tasks/data) directory
|
|
@@ -227,22 +245,24 @@ The following environment variables configure the paths to configuration files.
|
|
|
227
245
|
The following environment variables configure package and container behavior.
|
|
228
246
|
|
|
229
247
|
- `PACKAGE_NAME`: Overrides the package name; the default comes from `pyproject.toml`
|
|
230
|
-
- `
|
|
248
|
+
- `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`: Selects package manager backend (`poetry`, `uv`, or `auto`)
|
|
249
|
+
- `COMMON_PYTHON_TASKS_BUILD_TOOL`: Alias for `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
|
|
250
|
+
- `PACKAGE_MANAGER`: Alias for `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
|
|
231
251
|
- `CONTAINER_REGISTRY_USERNAME`: Specifies the container registry username for image tagging; the default is the current local user
|
|
232
252
|
- `CONTAINER_REGISTRY_URL`: Specifies the registry URL (default: `docker.io/{username}`)
|
|
233
|
-
- `CONTAINER_BUILD_ARGS`: Provides additional Docker build arguments in `KEY=VALUE:OTHER=VALUE` format
|
|
234
|
-
- `CONTAINER_EXTENSION_FILES`: Specifies colon delimited local extension Dockerfile paths to include in the rendered build
|
|
235
|
-
- `CONTAINER_EXTENSIONS`: Specifies colon delimited extension bundle names or parameterized bundle values to include in the rendered build
|
|
236
|
-
- `CONTAINER_ENV`: Provides colon delimited `KEY=VALUE` declarations to inject into the builder stage of the rendered Dockerfile
|
|
253
|
+
- `CONTAINER_BUILD_ARGS`: Provides additional Docker build arguments in `KEY=VALUE:OTHER=VALUE` format. Escape literal colons in values as `\:` or quote the complete value
|
|
254
|
+
- `CONTAINER_EXTENSION_FILES`: Specifies colon delimited local extension Dockerfile paths to include in the rendered build; escape literal colons as `\:` or quote the complete path
|
|
255
|
+
- `CONTAINER_EXTENSIONS`: Specifies colon delimited extension bundle names or parameterized bundle values to include in the rendered build; escape literal colons as `\:` or quote the complete value
|
|
256
|
+
- `CONTAINER_ENV`: Provides colon delimited `KEY=VALUE` declarations to inject into the builder stage of the rendered Dockerfile. Escape literal colons in values as `\:` or quote the complete value
|
|
237
257
|
- `.containerenv`: Can also supply the same declarations from a file in the project root. It is loaded first, then `container_envfile`, then `CONTAINER_ENV`, and finally `container_env`.
|
|
238
258
|
- `CONTAINER_PRUNE_KEEP`: Controls image pruning after builds (`-1` keeps all, `0` keeps the latest only, `N` keeps the latest plus `N` previous)
|
|
239
|
-
- `CUSTOM_ENTRYPOINT`: Specifies a custom entrypoint script name for containers
|
|
259
|
+
- `CUSTOM_ENTRYPOINT`: Specifies a custom entrypoint script name for containers. The value must match a key in `[project].scripts`; unknown values fail the build
|
|
240
260
|
- `CONTAINER_DEPS_CONTENT`: Supplies inline Dockerfile instructions for a dependency image that installs artifacts into `/tmp/deps`
|
|
241
|
-
- `CONTAINER_DEPS_FILE`: Points to one or more explicit Dockerfiles to build the dependency image. It may be a colon delimited list of file paths and is used only when `CONTAINER_DEPS_CONTENT` is unset
|
|
261
|
+
- `CONTAINER_DEPS_FILE`: Points to one or more explicit Dockerfiles to build the dependency image. It may be a colon delimited list of file paths, with literal colons escaped as `\:`, and is used only when `CONTAINER_DEPS_CONTENT` is unset
|
|
242
262
|
- `CONTAINER_DEPS_MAPPINGS`: Maps copied dependency names from `/tmp/deps` into destination paths as space separated `name:/target/path` entries. This is used only when `CONTAINER_DEPS_MOVE_SCRIPT` or `CONTAINER_DEPS_MOVE_SCRIPT_PATH` is not set
|
|
243
263
|
- `CONTAINER_DEPS_MOVE_SCRIPT`: Supplies a raw executable script to run after `/tmp/deps` is copied into the image. The script is written to `/tmp/container-deps-move-script` and executed with its own shebang
|
|
244
264
|
- `CONTAINER_DEPS_MOVE_SCRIPT_PATH`: Supplies a host path to a script file to run after `/tmp/deps` is copied into the image. This path takes precedence over `CONTAINER_DEPS_MOVE_SCRIPT` when both are set
|
|
245
|
-
- `GITHUB_RELEASE_ASSETS`: Colon separated list of file paths or glob patterns to attach to the GitHub Release (default: `dist/*`)
|
|
265
|
+
- `GITHUB_RELEASE_ASSETS`: Colon separated list of file paths or glob patterns to attach to the GitHub Release (default: `dist/*`); escape literal colons as `\:` or quote the complete path
|
|
246
266
|
- `SKIP_GITHUB_RELEASE`: Truthy value to skip GitHub Release publication
|
|
247
267
|
- `GITHUB_TOKEN` or `GH_TOKEN`: GitHub authentication token used to publish releases and upload assets
|
|
248
268
|
- `GITHUB_REPOSITORY`: Optional override for the repository slug used when publishing a GitHub Release
|
|
@@ -289,8 +309,8 @@ By default, `tasks()` exposes the common task set. You can still include or excl
|
|
|
289
309
|
```toml
|
|
290
310
|
[project]
|
|
291
311
|
name = "simple-cli-tool"
|
|
292
|
-
version = "0.
|
|
293
|
-
dependencies = ["common-python-tasks==0.
|
|
312
|
+
version = "0.5.0"
|
|
313
|
+
dependencies = ["common-python-tasks==0.5.0"]
|
|
294
314
|
|
|
295
315
|
[tool.poe]
|
|
296
316
|
include_script = "common_python_tasks:tasks()"
|
|
@@ -302,7 +322,7 @@ Available tasks: common defaults such as `format`, `lint`, `test`, and `build`.
|
|
|
302
322
|
|
|
303
323
|
```toml
|
|
304
324
|
[project]
|
|
305
|
-
dependencies = ["common-python-tasks==0.
|
|
325
|
+
dependencies = ["common-python-tasks==0.5.0"]
|
|
306
326
|
|
|
307
327
|
[tool.poe]
|
|
308
328
|
include_script = "common_python_tasks:tasks(include_tags=['common', 'containers'])"
|
|
@@ -318,7 +338,7 @@ Available tasks: All tasks including `build-image` and `push-image`.
|
|
|
318
338
|
|
|
319
339
|
```toml
|
|
320
340
|
[project]
|
|
321
|
-
dependencies = ["common-python-tasks==0.
|
|
341
|
+
dependencies = ["common-python-tasks==0.5.0"]
|
|
322
342
|
|
|
323
343
|
[tool.poe]
|
|
324
344
|
include_script = "common_python_tasks:tasks()"
|
|
@@ -367,7 +387,7 @@ COMMON_PYTHON_TASKS_LOG_LEVEL=DEBUG poe test
|
|
|
367
387
|
Make sure your `pyproject.toml` contains the following.
|
|
368
388
|
|
|
369
389
|
- A correct package name in `[project]`
|
|
370
|
-
-
|
|
390
|
+
- Package discovery settings required by your chosen build backend (for Poetry projects, this is commonly `[tool.poetry] packages = [{ include = "your_package", from = "src" }]`)
|
|
371
391
|
|
|
372
392
|
### Stack fails to start or services won't connect
|
|
373
393
|
|
|
@@ -401,19 +421,18 @@ If `SECRET_KEY` or `DB_PASS` aren't auto-generated:
|
|
|
401
421
|
|
|
402
422
|
The standard Python Dockerfile incorporates several intentional design choices.
|
|
403
423
|
|
|
404
|
-
- Multi-stage build: The build stage installs Poetry and builds a wheel while the runtime stage installs only the wheel to keep the final image slim and reproducible
|
|
405
|
-
- Pip and
|
|
406
|
-
- Explicit inputs through build args: `PYTHON_VERSION`, `
|
|
424
|
+
- Multi-stage build: The build stage installs the selected package manager backend (Poetry or uv) and builds a wheel while the runtime stage installs only the wheel to keep the final image slim and reproducible
|
|
425
|
+
- Pip and package-manager cache mounts: Speed up iterative builds without bloating the final image
|
|
426
|
+
- Explicit inputs through build args: `PYTHON_VERSION`, `PACKAGE_MANAGER`, `PACKAGE_MANAGER_VERSION`, `PACKAGE_NAME`, `AUTHORS`, `GIT_COMMIT`, and `CUSTOM_ENTRYPOINT` make image metadata and behavior predictable and auditable
|
|
407
427
|
- Optional debug stage: Exports and installs the `debug` dependency group only when present, without failing otherwise, and is not part of the default final image
|
|
408
428
|
- Stable package path: Creates symlinks to the installed package so entrypoints and consumers have a consistent `/pkg` and `/_$PACKAGE_NAME` path regardless of wheel layout. This ensures that the package can be imported and executed from a known location and supports the less common case of reading files directly from the package path
|
|
409
|
-
- Safe entrypoint selection: The default entrypoint resolves the console script matching the package name
|
|
429
|
+
- Safe entrypoint selection: The default entrypoint resolves the console script matching the package name and falls back to `python` when no matching script exists. `CUSTOM_ENTRYPOINT` allows an override at build time, and the override is validated strictly against `[project].scripts`
|
|
410
430
|
- Minimal final image: Uses the slim Python base by default, cleans wheel artifacts and caches, and sets `runtime` as the explicit final target so the debug stage remains optional
|
|
411
431
|
|
|
412
432
|
## Notes
|
|
413
433
|
|
|
414
434
|
- This project dogfoods itself; it uses `common-python-tasks` for its own development. **That said, you must set the environment variable `PYTHONPATH=src` when running tasks locally to ensure you are using the local version of the package instead of the installed version**
|
|
415
435
|
- `RELEASE_UPDATE_CHANGELOG` is enabled by default for releases and prepends a tagged section into `CHANGELOG.md` before the release tag is created. Set it to a falsy value if you prefer to manage changelog commits yourself.
|
|
416
|
-
- `RELEASE_PRE_SCRIPT` and `RELEASE_POST_SCRIPT` hooks may not be necessary for most users, as this package promotes
|
|
436
|
+
- `RELEASE_PRE_SCRIPT` and `RELEASE_POST_SCRIPT` hooks may not be necessary for most users, as this package promotes dynamic versioning and `git-cliff` to automate versioning and changelog generation based on git history. One advanced use case for the `RELEASE_PRE_SCRIPT` hook is to edit another file before release, such as a README that references the current stable version number. This allows you to keep the README up to date with the latest version without hardcoding it.
|
|
417
437
|
- Contributions welcome! Open an issue/discussion to discuss changes before submitting a PR. I do not claim to have all the answers, and you can help determine the future of low-code solutions for Python. I am very interested in your feedback as I don't want to work in a vacuum
|
|
418
438
|
- Alpha status: Expect breaking changes between minor versions until 1.0.0
|
|
419
|
-
|