Skip to content

Commit 911aa51

Browse files
committed
refactor: migrate python setup from mise to direnv
- replaces mise-specific python setup script with direnv version - removes obsolete mise configuration and tasks - simplifies python environment activation logic
1 parent 77a1113 commit 911aa51

5 files changed

Lines changed: 26 additions & 38 deletions

File tree

.cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"asyncio",
77
"cuda",
88
"cython",
9+
"direnv",
910
"dmypy",
1011
"dsanders",
1112
"elif",

copier.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _external_data:
88
shared: "{{ answers_file_shared }}"
99

1010
_migrations:
11+
- rm --force --verbose ".config/copier/mise/scripts/00-setup-python.sh"
1112
- rm --force --verbose ".config/copier/python.just"
1213
- rm --force --verbose ".github/copier/.copier-answers.python.yaml"
1314
- rm --force --verbose ".github/copier/mkdocs.yaml"
@@ -20,13 +21,11 @@ _migrations:
2021

2122
_skip_if_exists:
2223
- .config/mise/config.toml
23-
- .envrc
2424
- .gitignore
2525
- .ruff.toml
2626
- .vscode/settings.json
2727
- docs/README.md
2828
- docs/SUMMARY.md
29-
- Justfile
3029
- mkdocs.yaml
3130
- pyproject.toml
3231
- pyrightconfig.json
@@ -39,6 +38,7 @@ _skip_if_exists:
3938
_subdirectory: template
4039

4140
_tasks:
41+
- rm --force --verbose ".config/copier/mise/scripts/00-setup-python.sh"
4242
- rm --force --verbose ".config/copier/python.just"
4343
- rm --force --verbose ".github/copier/.copier-answers.python.yaml"
4444
- rm --force --verbose ".github/copier/mkdocs.yaml"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# This file is @generated by <https://github.com/liblaf/copier-python>.
3+
# DO NOT EDIT!
4+
5+
pushd "$(git rev-parse --show-toplevel)" > /dev/null || return 1
6+
7+
if [[ -f "pixi.lock" ]]; then
8+
options=()
9+
if [[ -t 2 ]]; then
10+
options+=(--color=always)
11+
fi
12+
eval "$(pixi shell-hook "${options[@]}")"
13+
fi
14+
15+
if [[ -f "uv.lock" ]]; then
16+
uv sync --all-extras --all-groups
17+
sed --in-place --regexp-extended \
18+
"s|\s*(include-system-site-packages)\s*=\s*.*\s*|\1 = true|" ".venv/pyvenv.cfg"
19+
# shellcheck disable=SC1091
20+
source ".venv/bin/activate"
21+
fi
22+
23+
popd > /dev/null || return 1

template/.config/copier/mise/scripts/setup-python.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

template/.config/mise/conf.d/00-python.toml.jinja

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
# This file is @generated by <https://github.com/liblaf/copier-python>.
44
# DO NOT EDIT!
55

6-
[env]
7-
_.source = { path = ".config/copier/mise/scripts/setup-python.sh", tools = true }
8-
96
[settings]
107
jobs = 1
118

0 commit comments

Comments
 (0)