Skip to content

Commit c03dc86

Browse files
committed
Small fixes
1 parent ba67d0a commit c03dc86

File tree

7 files changed

+288
-18
lines changed

7 files changed

+288
-18
lines changed

.github/workflows/ci-copier.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14-
pre-commit-checks:
15-
name: Pre-commit Checks
14+
pre-commit:
1615
timeout-minutes: 30
1716
runs-on: ubuntu-latest
1817
steps:
@@ -26,7 +25,6 @@ jobs:
2625
run: pixi run pre-commit-run --color=always --show-diff-on-failure
2726

2827
pytest:
29-
name: pytest
3028
timeout-minutes: 30
3129
runs-on: ubuntu-latest
3230
steps:
@@ -41,7 +39,10 @@ jobs:
4139
~/.cache/pre-commit
4240
key: project-generation-pre-commit-${{ hashFiles('template/.pre-commit-config.yaml.jinja') }}
4341
- name: Test
44-
run: pixi run test
42+
run: pixi run test --color=yes
43+
env:
44+
# needed for test_template_update
45+
GH_TOKEN: ${{ github.token }}
4546

4647
test-generated-package-ci:
4748
name: Test CI of generated package (minimal-python = ${{ matrix.minimal-python-version }})
@@ -69,7 +70,7 @@ jobs:
6970
git config --global user.email "landocalrissian@example.com"
7071
git config --global user.name "Lando Calrissian"
7172
# Generate package with default settings + Windows CI.
72-
copier copy \
73+
pixi run copier copy \
7374
--data project_name="Package" \
7475
--data project_short_description="Example Package" \
7576
--data github_user="LandoCalrissian" \

copier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ use_devcontainer:
6161
default: no
6262

6363
_tasks:
64-
- '"{{ _copier_python }}" -I -c "import sys; sys.path.insert(0, \"{{ _copier_conf.src_path }}\"); import runpy;
64+
- '"{{ _copier_python }}" -I -c "import sys; sys.path.insert(0, \"{{ _copier_conf.src_path }}\"); import runpy;
6565
runpy.run_module(\"tasks\", run_name=\"__main__\")"'

pixi.lock

Lines changed: 271 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ copier = ">=9.3.1,<10"
1010
pytest = ">=8.2,<9"
1111
"ruamel.yaml" = ">=0.17,<0.18"
1212
"ruamel.yaml.jinja2" = ">=0.2.4,<0.3"
13+
mypy = "*"
14+
pre-commit = "*"
15+
gh = "*"
1316

1417
[feature.lint.dependencies]
1518
pre-commit = "*"

template/.github/workflows/ci.yml.jinja

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
pre-commit-checks:
16-
name: Pre-commit Checks
15+
pre-commit:
1716
timeout-minutes: 30
1817
runs-on: ubuntu-latest
1918
steps:
@@ -26,9 +25,7 @@ jobs:
2625
- name: pre-commit
2726
run: pixi run pre-commit-run --color=always --show-diff-on-failure
2827
{%- endraw %}
29-
30-
unit-tests:
31-
name: pytest
28+
pytest:
3229
timeout-minutes: 30
3330
runs-on: {% if add_windows_tests_to_ci %}{% raw %}${{ matrix.os }}{% endraw %}{% else %}ubuntu-latest{% endif %}
3431
strategy:

tests/test_template.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ def test_precommit(generated_project):
3333
result.check_returncode()
3434

3535

36-
@pytest.mark.parametrize(
37-
"use_devcontainer", [True, False]
38-
)
36+
@pytest.mark.parametrize("use_devcontainer", [True, False])
3937
def test_devcontainer(generate_project, use_devcontainer):
4038
path = generate_project({"use_devcontainer": use_devcontainer})
4139
paths = [
@@ -65,9 +63,7 @@ def test_minimal_python_version(generate_project, minimal_python_version: str):
6563
: all_supported_python_versions.index(minimal_python_version_str)
6664
]
6765

68-
path = generate_project(
69-
{"minimal_python_version": minimal_python_version}
70-
)
66+
path = generate_project({"minimal_python_version": minimal_python_version})
7167
with open(path / "pyproject.toml") as f:
7268
pyproject_toml_content = f.read()
7369
assert (

tests/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def git_init_add(to_add="."):
4343

4444
@contextlib.contextmanager
4545
def remove_pixi_env_vars():
46-
pixi_vars = {key: value for key, value in os.environ.items() if key.startswith("PIXI_")}
46+
pixi_vars = {
47+
key: value for key, value in os.environ.items() if key.startswith("PIXI_")
48+
}
4749
for key in pixi_vars:
4850
del os.environ[key]
4951
yield

0 commit comments

Comments
 (0)