common-python-tasks 0.4.0__tar.gz → 0.4.1__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.4.1/.gitignore +216 -0
- common_python_tasks-0.4.1/.poetry/plugins/poetry_dynamic_versioning-1.10.0.dist-info/licenses/LICENSE +21 -0
- common_python_tasks-0.4.1/.poetry/plugins/poetry_plugin_export-1.10.0.dist-info/licenses/LICENSE +20 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/PKG-INFO +55 -38
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/README.md +35 -16
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/pyproject.toml +14 -13
- common_python_tasks-0.4.1/scripts/add-common-python-tasks.sh +35 -0
- common_python_tasks-0.4.1/scripts/release_script.py +175 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/fastapi/compose-base.yml.j2 +2 -1
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/fastapi/compose-db.yml.j2 +2 -1
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/generic/Dockerfile.j2 +40 -7
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/docker.py +30 -18
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/docker_compose.py +7 -4
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/git.py +3 -6
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/project.py +287 -26
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/tasks.py +13 -30
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/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 → common_python_tasks-0.4.1}/LICENSE +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/__init__.py +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/__main__.py +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/dockerfile_extensions/.gitkeep +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/fastapi/alembic.ini.j2 +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/fastapi/compose-db-debug.yml.j2 +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/fastapi/compose-debug.yml.j2 +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/generic/.coveragerc +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/generic/.dockerignore +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/generic/.flake8 +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/generic/.isort.cfg +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/generic/Dockerfile.deps.j2 +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/generic/cliff.toml +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/data/generic/pytest.ini +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/env.py +0 -0
- {common_python_tasks-0.4.0 → common_python_tasks-0.4.1}/src/common_python_tasks/github.py +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.4.1/.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.4.
|
|
3
|
+
Version: 0.4.1
|
|
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
|
|
@@ -53,7 +52,7 @@ curl -sSL https://api.github.com/repos/ci-sourcerer/common-python-tasks/contents
|
|
|
53
52
|
To install a specific release, set the environment variable `COMMON_PYTHON_TASKS_VERSION`.
|
|
54
53
|
|
|
55
54
|
```shell
|
|
56
|
-
COMMON_PYTHON_TASKS_VERSION=0.4.
|
|
55
|
+
COMMON_PYTHON_TASKS_VERSION=0.4.1 \
|
|
57
56
|
sh -c "$(curl -sSL https://api.github.com/repos/ci-sourcerer/common-python-tasks/contents/scripts/add-common-python-tasks.sh | jq -r '.content' | base64 -d)"
|
|
58
57
|
```
|
|
59
58
|
|
|
@@ -61,7 +60,7 @@ This will complete the following steps.
|
|
|
61
60
|
|
|
62
61
|
1. Add the latest version of `common-python-tasks` to your `pyproject.toml` dependencies
|
|
63
62
|
2. Configure Poe the Poet to expose the default common task set
|
|
64
|
-
3. Install
|
|
63
|
+
3. Install dependencies for your project
|
|
65
64
|
|
|
66
65
|
**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
66
|
|
|
@@ -74,7 +73,7 @@ There's no real reason to run the automated script; I just like automating every
|
|
|
74
73
|
```toml
|
|
75
74
|
[project]
|
|
76
75
|
dependencies = [
|
|
77
|
-
"common-python-tasks==0.4.
|
|
76
|
+
"common-python-tasks==0.4.1" # Always pin to a specific version
|
|
78
77
|
]
|
|
79
78
|
|
|
80
79
|
[tool.poe]
|
|
@@ -84,6 +83,8 @@ There's no real reason to run the automated script; I just like automating every
|
|
|
84
83
|
2. Install the package
|
|
85
84
|
|
|
86
85
|
```shell
|
|
86
|
+
uv sync
|
|
87
|
+
# or, for Poetry workflows
|
|
87
88
|
poetry install
|
|
88
89
|
```
|
|
89
90
|
|
|
@@ -196,9 +197,24 @@ The `fastapi` stack includes a service for your FastAPI application. It uses the
|
|
|
196
197
|
|
|
197
198
|
Your project must meet the following requirements.
|
|
198
199
|
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
200
|
+
- Uses Poetry or uv for dependency management
|
|
201
|
+
- Uses Poe the Poet for task management
|
|
202
|
+
- Has `poetry-dynamic-versioning` or `uv-dynamic-versioning` as a dependency
|
|
203
|
+
- Has a `pyproject.toml` file at the root
|
|
204
|
+
- Has a package name (automatically inferred from `project.name` in `pyproject.toml` or set via `PACKAGE_NAME` environment variable)
|
|
205
|
+
|
|
206
|
+
### Package manager backend selection
|
|
207
|
+
|
|
208
|
+
Packaging-related tasks (`build-package`, `publish-package`, release tagging/version resolution, and related container build metadata) support both Poetry and uv.
|
|
209
|
+
|
|
210
|
+
Backend selection uses this precedence.
|
|
211
|
+
|
|
212
|
+
1. `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
|
|
213
|
+
2. `COMMON_PYTHON_TASKS_BUILD_TOOL`
|
|
214
|
+
3. `PACKAGE_MANAGER`
|
|
215
|
+
4. Auto-discovery (`auto`) based on installed tools and project metadata
|
|
216
|
+
|
|
217
|
+
Supported values are `poetry`, `uv`, and `auto`.
|
|
202
218
|
|
|
203
219
|
### Configuration precedence
|
|
204
220
|
|
|
@@ -227,7 +243,9 @@ The following environment variables configure the paths to configuration files.
|
|
|
227
243
|
The following environment variables configure package and container behavior.
|
|
228
244
|
|
|
229
245
|
- `PACKAGE_NAME`: Overrides the package name; the default comes from `pyproject.toml`
|
|
230
|
-
- `
|
|
246
|
+
- `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`: Selects package manager backend (`poetry`, `uv`, or `auto`)
|
|
247
|
+
- `COMMON_PYTHON_TASKS_BUILD_TOOL`: Alias for `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
|
|
248
|
+
- `PACKAGE_MANAGER`: Alias for `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
|
|
231
249
|
- `CONTAINER_REGISTRY_USERNAME`: Specifies the container registry username for image tagging; the default is the current local user
|
|
232
250
|
- `CONTAINER_REGISTRY_URL`: Specifies the registry URL (default: `docker.io/{username}`)
|
|
233
251
|
- `CONTAINER_BUILD_ARGS`: Provides additional Docker build arguments in `KEY=VALUE:OTHER=VALUE` format
|
|
@@ -289,8 +307,8 @@ By default, `tasks()` exposes the common task set. You can still include or excl
|
|
|
289
307
|
```toml
|
|
290
308
|
[project]
|
|
291
309
|
name = "simple-cli-tool"
|
|
292
|
-
version = "0.4.
|
|
293
|
-
dependencies = ["common-python-tasks==0.4.
|
|
310
|
+
version = "0.4.1"
|
|
311
|
+
dependencies = ["common-python-tasks==0.4.1"]
|
|
294
312
|
|
|
295
313
|
[tool.poe]
|
|
296
314
|
include_script = "common_python_tasks:tasks()"
|
|
@@ -302,7 +320,7 @@ Available tasks: common defaults such as `format`, `lint`, `test`, and `build`.
|
|
|
302
320
|
|
|
303
321
|
```toml
|
|
304
322
|
[project]
|
|
305
|
-
dependencies = ["common-python-tasks==0.4.
|
|
323
|
+
dependencies = ["common-python-tasks==0.4.1"]
|
|
306
324
|
|
|
307
325
|
[tool.poe]
|
|
308
326
|
include_script = "common_python_tasks:tasks(include_tags=['common', 'containers'])"
|
|
@@ -318,7 +336,7 @@ Available tasks: All tasks including `build-image` and `push-image`.
|
|
|
318
336
|
|
|
319
337
|
```toml
|
|
320
338
|
[project]
|
|
321
|
-
dependencies = ["common-python-tasks==0.4.
|
|
339
|
+
dependencies = ["common-python-tasks==0.4.1"]
|
|
322
340
|
|
|
323
341
|
[tool.poe]
|
|
324
342
|
include_script = "common_python_tasks:tasks()"
|
|
@@ -367,7 +385,7 @@ COMMON_PYTHON_TASKS_LOG_LEVEL=DEBUG poe test
|
|
|
367
385
|
Make sure your `pyproject.toml` contains the following.
|
|
368
386
|
|
|
369
387
|
- A correct package name in `[project]`
|
|
370
|
-
-
|
|
388
|
+
- Package discovery settings required by your chosen build backend (for Poetry projects, this is commonly `[tool.poetry] packages = [{ include = "your_package", from = "src" }]`)
|
|
371
389
|
|
|
372
390
|
### Stack fails to start or services won't connect
|
|
373
391
|
|
|
@@ -401,9 +419,9 @@ If `SECRET_KEY` or `DB_PASS` aren't auto-generated:
|
|
|
401
419
|
|
|
402
420
|
The standard Python Dockerfile incorporates several intentional design choices.
|
|
403
421
|
|
|
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`, `
|
|
422
|
+
- 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
|
|
423
|
+
- Pip and package-manager cache mounts: Speed up iterative builds without bloating the final image
|
|
424
|
+
- 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
425
|
- 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
426
|
- 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
427
|
- Safe entrypoint selection: The default entrypoint resolves the console script matching the package name, while `CUSTOM_ENTRYPOINT` allows an override at build time and keeps runtime behavior predictable
|
|
@@ -413,7 +431,6 @@ The standard Python Dockerfile incorporates several intentional design choices.
|
|
|
413
431
|
|
|
414
432
|
- 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
433
|
- `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
|
|
434
|
+
- `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
435
|
- 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
436
|
- Alpha status: Expect breaking changes between minor versions until 1.0.0
|
|
419
|
-
|
|
@@ -17,7 +17,7 @@ curl -sSL https://api.github.com/repos/ci-sourcerer/common-python-tasks/contents
|
|
|
17
17
|
To install a specific release, set the environment variable `COMMON_PYTHON_TASKS_VERSION`.
|
|
18
18
|
|
|
19
19
|
```shell
|
|
20
|
-
COMMON_PYTHON_TASKS_VERSION=0.4.
|
|
20
|
+
COMMON_PYTHON_TASKS_VERSION=0.4.1 \
|
|
21
21
|
sh -c "$(curl -sSL https://api.github.com/repos/ci-sourcerer/common-python-tasks/contents/scripts/add-common-python-tasks.sh | jq -r '.content' | base64 -d)"
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ This will complete the following steps.
|
|
|
25
25
|
|
|
26
26
|
1. Add the latest version of `common-python-tasks` to your `pyproject.toml` dependencies
|
|
27
27
|
2. Configure Poe the Poet to expose the default common task set
|
|
28
|
-
3. Install
|
|
28
|
+
3. Install dependencies for your project
|
|
29
29
|
|
|
30
30
|
**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.
|
|
31
31
|
|
|
@@ -38,7 +38,7 @@ There's no real reason to run the automated script; I just like automating every
|
|
|
38
38
|
```toml
|
|
39
39
|
[project]
|
|
40
40
|
dependencies = [
|
|
41
|
-
"common-python-tasks==0.4.
|
|
41
|
+
"common-python-tasks==0.4.1" # Always pin to a specific version
|
|
42
42
|
]
|
|
43
43
|
|
|
44
44
|
[tool.poe]
|
|
@@ -48,6 +48,8 @@ There's no real reason to run the automated script; I just like automating every
|
|
|
48
48
|
2. Install the package
|
|
49
49
|
|
|
50
50
|
```shell
|
|
51
|
+
uv sync
|
|
52
|
+
# or, for Poetry workflows
|
|
51
53
|
poetry install
|
|
52
54
|
```
|
|
53
55
|
|
|
@@ -160,9 +162,24 @@ The `fastapi` stack includes a service for your FastAPI application. It uses the
|
|
|
160
162
|
|
|
161
163
|
Your project must meet the following requirements.
|
|
162
164
|
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
165
|
+
- Uses Poetry or uv for dependency management
|
|
166
|
+
- Uses Poe the Poet for task management
|
|
167
|
+
- Has `poetry-dynamic-versioning` or `uv-dynamic-versioning` as a dependency
|
|
168
|
+
- Has a `pyproject.toml` file at the root
|
|
169
|
+
- Has a package name (automatically inferred from `project.name` in `pyproject.toml` or set via `PACKAGE_NAME` environment variable)
|
|
170
|
+
|
|
171
|
+
### Package manager backend selection
|
|
172
|
+
|
|
173
|
+
Packaging-related tasks (`build-package`, `publish-package`, release tagging/version resolution, and related container build metadata) support both Poetry and uv.
|
|
174
|
+
|
|
175
|
+
Backend selection uses this precedence.
|
|
176
|
+
|
|
177
|
+
1. `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
|
|
178
|
+
2. `COMMON_PYTHON_TASKS_BUILD_TOOL`
|
|
179
|
+
3. `PACKAGE_MANAGER`
|
|
180
|
+
4. Auto-discovery (`auto`) based on installed tools and project metadata
|
|
181
|
+
|
|
182
|
+
Supported values are `poetry`, `uv`, and `auto`.
|
|
166
183
|
|
|
167
184
|
### Configuration precedence
|
|
168
185
|
|
|
@@ -191,7 +208,9 @@ The following environment variables configure the paths to configuration files.
|
|
|
191
208
|
The following environment variables configure package and container behavior.
|
|
192
209
|
|
|
193
210
|
- `PACKAGE_NAME`: Overrides the package name; the default comes from `pyproject.toml`
|
|
194
|
-
- `
|
|
211
|
+
- `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`: Selects package manager backend (`poetry`, `uv`, or `auto`)
|
|
212
|
+
- `COMMON_PYTHON_TASKS_BUILD_TOOL`: Alias for `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
|
|
213
|
+
- `PACKAGE_MANAGER`: Alias for `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
|
|
195
214
|
- `CONTAINER_REGISTRY_USERNAME`: Specifies the container registry username for image tagging; the default is the current local user
|
|
196
215
|
- `CONTAINER_REGISTRY_URL`: Specifies the registry URL (default: `docker.io/{username}`)
|
|
197
216
|
- `CONTAINER_BUILD_ARGS`: Provides additional Docker build arguments in `KEY=VALUE:OTHER=VALUE` format
|
|
@@ -253,8 +272,8 @@ By default, `tasks()` exposes the common task set. You can still include or excl
|
|
|
253
272
|
```toml
|
|
254
273
|
[project]
|
|
255
274
|
name = "simple-cli-tool"
|
|
256
|
-
version = "0.4.
|
|
257
|
-
dependencies = ["common-python-tasks==0.4.
|
|
275
|
+
version = "0.4.1"
|
|
276
|
+
dependencies = ["common-python-tasks==0.4.1"]
|
|
258
277
|
|
|
259
278
|
[tool.poe]
|
|
260
279
|
include_script = "common_python_tasks:tasks()"
|
|
@@ -266,7 +285,7 @@ Available tasks: common defaults such as `format`, `lint`, `test`, and `build`.
|
|
|
266
285
|
|
|
267
286
|
```toml
|
|
268
287
|
[project]
|
|
269
|
-
dependencies = ["common-python-tasks==0.4.
|
|
288
|
+
dependencies = ["common-python-tasks==0.4.1"]
|
|
270
289
|
|
|
271
290
|
[tool.poe]
|
|
272
291
|
include_script = "common_python_tasks:tasks(include_tags=['common', 'containers'])"
|
|
@@ -282,7 +301,7 @@ Available tasks: All tasks including `build-image` and `push-image`.
|
|
|
282
301
|
|
|
283
302
|
```toml
|
|
284
303
|
[project]
|
|
285
|
-
dependencies = ["common-python-tasks==0.4.
|
|
304
|
+
dependencies = ["common-python-tasks==0.4.1"]
|
|
286
305
|
|
|
287
306
|
[tool.poe]
|
|
288
307
|
include_script = "common_python_tasks:tasks()"
|
|
@@ -331,7 +350,7 @@ COMMON_PYTHON_TASKS_LOG_LEVEL=DEBUG poe test
|
|
|
331
350
|
Make sure your `pyproject.toml` contains the following.
|
|
332
351
|
|
|
333
352
|
- A correct package name in `[project]`
|
|
334
|
-
-
|
|
353
|
+
- Package discovery settings required by your chosen build backend (for Poetry projects, this is commonly `[tool.poetry] packages = [{ include = "your_package", from = "src" }]`)
|
|
335
354
|
|
|
336
355
|
### Stack fails to start or services won't connect
|
|
337
356
|
|
|
@@ -365,9 +384,9 @@ If `SECRET_KEY` or `DB_PASS` aren't auto-generated:
|
|
|
365
384
|
|
|
366
385
|
The standard Python Dockerfile incorporates several intentional design choices.
|
|
367
386
|
|
|
368
|
-
- 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
|
|
369
|
-
- Pip and
|
|
370
|
-
- Explicit inputs through build args: `PYTHON_VERSION`, `
|
|
387
|
+
- 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
|
|
388
|
+
- Pip and package-manager cache mounts: Speed up iterative builds without bloating the final image
|
|
389
|
+
- 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
|
|
371
390
|
- 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
|
|
372
391
|
- 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
|
|
373
392
|
- Safe entrypoint selection: The default entrypoint resolves the console script matching the package name, while `CUSTOM_ENTRYPOINT` allows an override at build time and keeps runtime behavior predictable
|
|
@@ -377,6 +396,6 @@ The standard Python Dockerfile incorporates several intentional design choices.
|
|
|
377
396
|
|
|
378
397
|
- 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**
|
|
379
398
|
- `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.
|
|
380
|
-
- `RELEASE_PRE_SCRIPT` and `RELEASE_POST_SCRIPT` hooks may not be necessary for most users, as this package promotes
|
|
399
|
+
- `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.
|
|
381
400
|
- 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
|
|
382
401
|
- Alpha status: Expect breaking changes between minor versions until 1.0.0
|
|
@@ -32,8 +32,7 @@ dependencies = [
|
|
|
32
32
|
"packaging (>=26.2,<27.0)",
|
|
33
33
|
"requests (>=2.34.2,<3.0.0)",
|
|
34
34
|
]
|
|
35
|
-
dynamic = []
|
|
36
|
-
version = "0.4.0"
|
|
35
|
+
dynamic = ["version"]
|
|
37
36
|
|
|
38
37
|
[project.urls]
|
|
39
38
|
Homepage = "http://github.com/ci-sourcerer/common-python-tasks"
|
|
@@ -48,23 +47,25 @@ PYTHONPATH = "src"
|
|
|
48
47
|
RELEASE_UPDATE_CHANGELOG = "1"
|
|
49
48
|
RELEASE_PRE_SCRIPT = "RELEASE_SCRIPT_PHASE=pre python scripts/release_script.py"
|
|
50
49
|
|
|
51
|
-
[tool.
|
|
52
|
-
|
|
53
|
-
poetry-plugin-export = { version = ">=1.9.0,<2.0.0" }
|
|
50
|
+
[tool.hatch.version]
|
|
51
|
+
source = "uv-dynamic-versioning"
|
|
54
52
|
|
|
55
|
-
[tool.
|
|
56
|
-
packages = [
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
[tool.hatch.build.targets.wheel]
|
|
54
|
+
packages = ["src/common_python_tasks"]
|
|
55
|
+
|
|
56
|
+
[tool.hatch.build.targets.sdist]
|
|
57
|
+
include = ["src/common_python_tasks", "scripts", "README.md", "LICENSE"]
|
|
59
58
|
|
|
60
59
|
[dependency-groups]
|
|
61
60
|
debug = ["debugpy (>=1.8.16,<2.0.0)"]
|
|
62
61
|
|
|
63
62
|
[build-system]
|
|
64
|
-
requires = ["
|
|
65
|
-
build-backend = "
|
|
63
|
+
requires = ["hatchling>=1.27.0", "uv-dynamic-versioning>=0.14.0"]
|
|
64
|
+
build-backend = "hatchling.build"
|
|
66
65
|
|
|
67
|
-
[tool.
|
|
68
|
-
enable = false
|
|
66
|
+
[tool.uv-dynamic-versioning]
|
|
69
67
|
style = "pep440"
|
|
70
68
|
dirty = true
|
|
69
|
+
|
|
70
|
+
[tool.uv]
|
|
71
|
+
package = true
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
# This script adds the common-python-tasks package to the current project
|
|
4
|
+
# and updates the pyproject.toml file to include the requested tasks.
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
pkg="common-python-tasks"
|
|
9
|
+
if [ -n "$COMMON_PYTHON_TASKS_VERSION" ]; then
|
|
10
|
+
ver="$COMMON_PYTHON_TASKS_VERSION"
|
|
11
|
+
else
|
|
12
|
+
searchOutput=$(poetry search "$pkg")
|
|
13
|
+
if [ "$searchOutput" = "No matching packages were found." ]; then
|
|
14
|
+
printf 'Package %s not found\n' "$pkg" >&2
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
ver=$(printf "%s" "$searchOutput" | awk -v p="$pkg" '$1==p{print $2}' | tail -n1)
|
|
18
|
+
fi
|
|
19
|
+
if [ -n "$ver" ]; then
|
|
20
|
+
poetry add --group dev "$pkg==$ver" || exit 1
|
|
21
|
+
else
|
|
22
|
+
printf 'Error parsing version for %s\n' "$pkg" >&2
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
script=$([ -n "$TAGS_TO_INCLUDE" ] && python -c "import sys; tags = sys.argv[1].split(); print('common_python_tasks:tasks(include_tags='+repr(tags)+')')" "$TAGS_TO_INCLUDE" || echo "common_python_tasks:tasks()")
|
|
27
|
+
cat >>pyproject.toml <<EOF
|
|
28
|
+
|
|
29
|
+
[tool.poe]
|
|
30
|
+
include_script = "$script"
|
|
31
|
+
|
|
32
|
+
EOF
|
|
33
|
+
|
|
34
|
+
printf "\n\033[1;32mCommon Python tasks added to project.\033[0m\n\n\033[1mAvailable tasks:\033[0m\n"
|
|
35
|
+
poe --help --ansi | awk '/Configured tasks:/ {flag=1; next} flag'
|