Skip to content

Commit 24181e4

Browse files
committed
refactor(template): remove pixi-specific template paths and normalize mise task locking
Simplify generated Python projects around the remaining uv workflow by dropping obsolete pixi configuration and migration entries. Resolve mise task lock collisions by keying locks to the git repository root and using the task form for install hooks so generated automation behaves consistently from any working directory.
1 parent 65ec8c3 commit 24181e4

5 files changed

Lines changed: 10 additions & 33 deletions

File tree

copier.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ _envops:
1313

1414
_migrations: &migrations
1515
- rm --force --recursive --verbose '.config/copier/mise/tasks'
16-
- rm --force --verbose '__builtins__.pyi'
1716
- rm --force --verbose '.config/copier/direnv/00-python.sh'
1817
- rm --force --verbose '.config/copier/direnv/10-python.sh'
18+
- rm --force --verbose '.config/copier/mise-tasks/bench.sh'
19+
- rm --force --verbose '.config/copier/mise-tasks/test.sh'
1920
- rm --force --verbose '.config/copier/mise/scripts/setup-python.sh'
2021
- rm --force --verbose '.config/copier/python.just'
2122
- rm --force --verbose '.config/direnv/10-python.sh'
@@ -37,6 +38,7 @@ _migrations: &migrations
3738
- rm --force --verbose 'docs/javascript/mathjax.js'
3839
- rm --force --verbose 'docs/scripts/gen-ref-pages.py'
3940
- rm --force --verbose 'docs/SUMMARY.md'
41+
- rm --force --verbose 'typings/__builtins__.pyi'
4042

4143
_skip_if_exists:
4244
- .config/mise/config.toml
@@ -124,10 +126,3 @@ wheel_package_dir:
124126
help: e.g. "namespace/", "project_name_slug/"
125127
default: |-
126128
{{ package_dir.split('/') | first }}
127-
128-
package_manager:
129-
type: str
130-
choices:
131-
- pixi
132-
- uv
133-
default: uv

template/.config/copier/mise-tasks/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ function has() {
1010
}
1111

1212
function lock() {
13-
local -r id="$(basename -- "$PWD")"
13+
local -r git_root="$(git rev-parse --show-toplevel)"
14+
local -r name="$(basename -- "$git_root")"
1415
mkdir --parents --verbose '/tmp/mise-flock'
15-
flock --nonblock "/tmp/mise-flock/$id.lock" "$@"
16+
flock --nonblock --verbose "/tmp/mise-flock/$name.lock" "$@"
1617
}
1718

1819
if [[ -f 'pixi.lock' ]]; then

template/.config/copier/mise-tasks/upgrade.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ function has() {
1111
}
1212

1313
function lock() {
14-
local -r name="$(basename -- "$PWD")"
14+
local -r git_root="$(git rev-parse --show-toplevel)"
15+
local -r name="$(basename -- "$git_root")"
1516
mkdir --parents --verbose '/tmp/mise-flock'
16-
flock --nonblock "/tmp/mise-flock/$name.lock" "$@"
17+
flock --nonblock --verbose "/tmp/mise-flock/$name.lock" "$@"
1718
}
1819

1920
if [[ -f 'pixi.lock' ]]; then

template/.config/mise/conf.d/10-python.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# DO NOT EDIT!
44

55
[hooks]
6-
enter = "mise run install"
6+
enter = { task = "install" }

template/pyproject.toml.jinja

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,6 @@ packages = ["src/{{ wheel_package_dir }}"]
6767
[tool.hatch.version]
6868
source = "vcs"
6969

70-
# %% if package_manager == "pixi":
71-
[tool.pixi.environments]
72-
default = { features = ["build", "dev", "docs", "test"] }
73-
74-
[tool.pixi.project]
75-
channel-priority = "disabled"
76-
channels = ["conda-forge"]
77-
platforms = ["linux-64"]
78-
79-
[tool.pixi.pypi-dependencies]
80-
"{{ package_name }}" = { editable = true, path = "." }
81-
82-
[tool.pixi.system-requirements]
83-
cuda = "12"
84-
libc = { family = "glibc", version = "2.42" }
85-
linux = "6.12"
86-
# %% endif
87-
8870
[tool.pytest]
8971
addopts = ["--doctest-modules", "--import-mode=importlib", "--showlocals"]
9072
consider_namespace_packages = true
@@ -97,7 +79,5 @@ extend = ".config/linters/.ruff.toml"
9779
[tool.ty.environment]
9880
python = ".venv" # ty-vscode does not work without this
9981

100-
# %% if package_manager == "uv":
10182
[tool.uv]
10283
default-groups = "all"
103-
# %% endif

0 commit comments

Comments
 (0)