You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-29Lines changed: 9 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,6 @@ Add `common-python-tasks` as a development dependency from your project root.
12
12
13
13
```shell
14
14
uv add --dev common-python-tasks==0.8.0
15
-
# or, for Poetry projects
16
-
poetry add --group dev common-python-tasks==0.8.0
17
15
```
18
16
19
17
Configure Poe the Poet to expose the default `common` task set.
@@ -76,7 +74,7 @@ The generated tables below list public tasks only. Tags identify which tasks are
76
74
| --- | --- | --- |
77
75
|`publish-package`| Publish the package to the PyPI server. | common, packaging |
78
76
|`publish-github-release`| Publish or update a GitHub Release for the current repository. | common, packaging, release |
79
-
|`update-dependencies`| Update project dependencies with Poetry or uv. | common, packaging |
77
+
|`update-dependencies`| Update project dependencies with uv. | common, packaging |
80
78
|`build-package`| Build the package (wheel and sdist). | build, common, packaging |
81
79
|`bump-version`| Bump the project version. | common, packaging |
82
80
|`changelog`| Print the changelog for the current version based on git history and git-cliff. | common, packaging, release |
@@ -111,7 +109,7 @@ The generated tables below list public tasks only. Tags identify which tasks are
111
109
112
110
Every project needs a `pyproject.toml` file at its root and Poe the Poet available in its development environment.
113
111
114
-
Tasks that install, build, publish, or update dependencies also require either Poetry or uv. Package and release tasks need a resolvable project version from `project.version`, Poetry's version resolution, or Git tags. Dynamic-versioning plugins are supported but are not a baseline requirement.
112
+
Tasks that install, build, publish, or update dependencies require uv. Package and release tasks need a resolvable project version from `project.version`or Git tags. Dynamicversioning is supported but is not a baseline requirement.
The `containers` tag also includes container-based development-stack tasks. Use the tags in the task tables to tailor a smaller task set.
133
131
134
-
### Package manager backend selection
132
+
### Package management
135
133
136
-
Packaging-related tasks, including `build-package`, `publish-package`, release version resolution, and container build metadata, support Poetry and uv.
137
-
138
-
Backend selection uses this precedence.
139
-
140
-
1.`COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
141
-
2.`COMMON_PYTHON_TASKS_BUILD_TOOL`
142
-
3.`PACKAGE_MANAGER`
143
-
4. Auto-discovery (`auto`) based on installed tools and project metadata
144
-
145
-
Supported values are `poetry`, `uv`, and `auto`.
134
+
Packaging-related tasks, including `build-package`, `publish-package`, dependency updates, release version resolution, and container build metadata, use uv exclusively. The `uv` executable must be available on `PATH`.
146
135
147
136
### Publish target selection
148
137
@@ -151,12 +140,7 @@ The `publish-package` task resolves publish targets with this precedence.
151
140
1. Explicit task arguments (`repository` or `repository_url`)
152
141
2. Environment-variable fallback
153
142
3. uv project configuration fallback from `[[tool.uv.index]]`
154
-
4. Backend defaults (`poetry publish` or `uv publish`)
155
-
156
-
Poetry uses repository names only.
157
-
158
-
-`COMMON_PYTHON_TASKS_PUBLISH_REPOSITORY`
159
-
-`POETRY_REPOSITORY`
143
+
4. The `uv publish` default
160
144
161
145
uv prefers named publish indexes.
162
146
@@ -223,12 +207,8 @@ addopts = "-ra"
223
207
#### Project and package settings
224
208
225
209
-`PACKAGE_NAME`: Overrides the package name inferred from `pyproject.toml`
226
-
-`COMMON_PYTHON_TASKS_PACKAGE_MANAGER`: Selects the package-manager backend as `poetry`, `uv`, or `auto`
227
-
-`COMMON_PYTHON_TASKS_BUILD_TOOL`: Alias for `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
228
-
-`PACKAGE_MANAGER`: Alias for `COMMON_PYTHON_TASKS_PACKAGE_MANAGER`
229
210
-`COMMON_PYTHON_TASKS_PUBLISH_REPOSITORY`: Preferred publish repository/index name for `publish-package`
230
211
-`COMMON_PYTHON_TASKS_PUBLISH_URL`: Preferred uv publish upload URL for `publish-package` when no repository/index is selected
231
-
-`POETRY_REPOSITORY`: Poetry repository-name fallback for `publish-package`
232
212
-`UV_PUBLISH_INDEX`: uv publish-index fallback for `publish-package`
233
213
-`UV_PUBLISH_URL`: uv publish upload-url fallback for `publish-package`
### Container build fails with "unable to find package"
384
364
385
-
Check that `pyproject.toml` has a correct package name and the package-discovery settings required by its build backend. For Poetry projects, this commonly includes `[tool.poetry] packages = [{ include = "your_package", from = "src" }]`.
365
+
Check that `pyproject.toml` has a correct package name and the package-discovery settings required by its build backend. For a `src` layout built with Hatch, configure `[tool.hatch.build.targets.wheel] packages = ["src/your_package"]`.
386
366
387
367
### Stack fails to start or services cannot connect
388
368
@@ -407,9 +387,9 @@ Ensure the project-root `.env` file is writable and inspect its permissions with
407
387
408
388
See the [standard Dockerfile template](src/common_python_tasks/data/generic/Dockerfile.j2) for the implementation.
409
389
410
-
- Multi-stage build: The build stage installs the selected package-manager backend and builds a wheel. The runtime stage installs only the wheel to keep the final image slim and reproducible.
411
-
- Cache mounts: Pip and package-manager cache mounts speed up iterative builds without bloating the final image.
412
-
- Explicit build metadata: `PYTHON_VERSION`, `PACKAGE_MANAGER`, `PACKAGE_MANAGER_VERSION`, `PACKAGE_NAME`, `AUTHORS`, and `GIT_COMMIT` make image metadata predictable and auditable.
390
+
- Multi-stage build: The build stage installs uv and builds a wheel. The runtime stage installs only the wheel to keep the final image slim and reproducible.
391
+
- Cache mounts: Pip and uv cache mounts speed up iterative builds without bloating the final image.
392
+
- Explicit build metadata: `PYTHON_VERSION`, `UV_VERSION`, `PACKAGE_VERSION`, `PACKAGE_NAME`, `AUTHORS`, and `GIT_COMMIT` make image metadata predictable and auditable.
413
393
- Project-level build settings: `CONTAINER_APT_PACKAGES`, `CONTAINER_CUSTOM_ENTRYPOINT`, and `CONTAINER_DEPS_IMAGE` configure generated image behavior without being encoded as generic Docker arguments.
414
394
- Optional debug stage: The image exports and installs the `debug` dependency group only when present and does not include it in the default final image.
415
395
- Stable package path: Symlinks give entrypoints and consumers consistent `/pkg` and `/_$PACKAGE_NAME` paths regardless of wheel layout.
if [ -n "${POETRY_DYNAMIC_VERSIONING_PLUGIN_VERSION:-}" ]; then dynamic_spec="poetry-dynamic-versioning[plugin]==$POETRY_DYNAMIC_VERSIONING_PLUGIN_VERSION"; fi; \
33
-
export_spec="poetry-plugin-export"; \
34
-
if [ -n "${POETRY_PLUGIN_EXPORT_VERSION:-}" ]; then export_spec="poetry-plugin-export==$POETRY_PLUGIN_EXPORT_VERSION"; fi; \
0 commit comments