Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .lefthook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ pre-commit:
- name: prettier
glob: "*.{md,yml,yaml}"
run: pixi {run} prettier --write --no-error-on-unmatched-pattern --list-different --ignore-unknown {staged_files}
- name: taplo
- name: tombi
glob: "*.toml"
run: pixi {run} taplo format {staged_files}
run: pixi {run} tombi format --offline {staged_files}
- name: trailing-whitespace-fixer
glob: "*"
file_types: text
Expand Down
109 changes: 53 additions & 56 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ lefthook = "*"
insert-license-header = "*"
ruff = "*"
prettier = "*"
taplo = "*"
tombi = "*"
pre-commit-hooks = "*"
typos = "*"
zizmor = "*"

[feature.lint.tasks]
pre-commit-install = "lefthook install"
lint = "lefthook run pre-commit --all-files"
Expand Down
4 changes: 2 additions & 2 deletions template/.lefthook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ pre-commit:
- name: prettier
glob: "*.{md,yml,yaml}"
run: pixi {run} prettier --write --no-error-on-unmatched-pattern --list-different --ignore-unknown {staged_files}
- name: taplo
- name: tombi
glob: "*.toml"
run: pixi {run} taplo format {staged_files}
run: pixi {run} tombi format --offline {staged_files}
- name: trailing-whitespace-fixer
glob: "*"
file_types: text
Expand Down
30 changes: 24 additions & 6 deletions template/pixi.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ preview = ["pixi-build"]

[package]
name = "{{ project_slug }}"

[package.build.backend]
name = "pixi-build-python"
version = "*"

[package.host-dependencies]
python = ">={{ minimal_python_version.replace('py3', '3.') }}"
hatchling = "*"
Expand All @@ -22,6 +24,7 @@ uv = "*"
pytest = "*"
pytest-cov = "*"
mypy = "*"

[feature.test.tasks]
test = "pytest"
test-coverage = "pytest --cov={{ project_slug_snake_case }} --cov-report=xml --cov-report=term-missing"
Expand All @@ -31,6 +34,7 @@ python = "*"
hatchling = "*"
python-build = "*"
twine = ">=6"

[feature.build.tasks]
build-wheel = "python -m build --no-isolation ."
check-wheel = "twine check dist/*"
Expand All @@ -39,23 +43,37 @@ check-wheel = "twine check dist/*"
lefthook = "*"
ruff = "*"
prettier = "*"
taplo = "*"
tombi = "*"
pre-commit-hooks = "*"
typos = "*"
zizmor = "*"

[feature.lint.tasks]
pre-commit-install = "lefthook install"
lint = "lefthook run pre-commit --all-files"
{%- if minimal_python_version <= "py310" %}

{% if minimal_python_version <= "py310" %}[feature.py310.dependencies]
[feature.py310.dependencies]
python = "3.10.*"
{% endif %}{% if minimal_python_version <= "py311" %}[feature.py311.dependencies]
{%- endif %}
{%- if minimal_python_version <= "py311" %}

[feature.py311.dependencies]
python = "3.11.*"
{% endif %}{% if minimal_python_version <= "py312" %}[feature.py312.dependencies]
{%- endif %}
{%- if minimal_python_version <= "py312" %}

[feature.py312.dependencies]
python = "3.12.*"
{% endif %}{% if minimal_python_version <= "py313" %}[feature.py313.dependencies]
{%- endif %}
{%- if minimal_python_version <= "py313" %}

[feature.py313.dependencies]
python = "3.13.*"
{% endif %}{% if minimal_python_version <= "py314" %}[feature.py314.dependencies]
{%- endif %}
{%- if minimal_python_version <= "py314" %}

[feature.py314.dependencies]
python = "3.14.*"
{%- endif %}

Expand Down
11 changes: 7 additions & 4 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ line-length = 88

[tool.ruff.lint]
ignore = [
"N803", # https://docs.astral.sh/ruff/rules/invalid-argument-name
"N806", # https://docs.astral.sh/ruff/rules/non-lowercase-variable-in-function
"E501", # https://docs.astral.sh/ruff/faq/#is-the-ruff-linter-compatible-with-black
"N803", # https://docs.astral.sh/ruff/rules/invalid-argument-name
"N806", # https://docs.astral.sh/ruff/rules/non-lowercase-variable-in-function
"E501", # https://docs.astral.sh/ruff/faq/#is-the-ruff-linter-compatible-with-black
]
select = [
# pyflakes
Expand All @@ -61,7 +61,7 @@ quote-style = "double"
indent-style = "space"

[tool.mypy]
python_version = '{{ minimal_python_version.replace('py3', '3.') }}'
python_version = "{{ minimal_python_version.replace('py3', '3.') }}"
no_implicit_optional = true
check_untyped_defs = true

Expand All @@ -72,5 +72,8 @@ check_untyped_defs = true
# module = ["my_module"]
# ignore_missing_imports = true

[tool.tombi]
schema.enabled = false

[tool.pytest.ini_options]
testpaths = ["tests"]
2 changes: 1 addition & 1 deletion tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_minimal_python_version(generate_project, minimal_python_version: str):
in pyproject_toml_content
)
assert (
f"[tool.mypy]\npython_version = '{minimal_python_version_str}'\nno_implicit"
f'[tool.mypy]\npython_version = "{minimal_python_version_str}"\nno_implicit'
in pyproject_toml_content
)

Expand Down
Loading