Skip to content
Open
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
9 changes: 4 additions & 5 deletions .github/workflows/ci-copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ jobs:
# Replace actions trigger with on: [push]
yq eval '.on = ["push"]' -i .github/workflows/ci.yml
yq eval '.on = ["push"]' -i .github/workflows/build.yml
git add .github/workflows/ci.yml .github/workflows/build.yml
git commit -m "Replace actions trigger with on: [push]"
git init
# create pixi.lock
pixi list --manifest-path pixi.toml --color=always
git add pixi.lock
git commit -m "Create pixi.lock"
pixi lock --manifest-path pixi.toml --color=always
git add .
git commit -m "Initial commit"
# Push the generated package's HEAD commit to a `ci/*` branch
cid=$(git rev-parse HEAD)
git push -f "${GITHUB_SERVER_URL/https:\/\//git@}:$GITHUB_REPOSITORY" $cid:refs/heads/${STEPS_BRANCH_OUTPUTS_NAME}
Expand Down
4 changes: 0 additions & 4 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,3 @@ add_autobump_workflow:
type: bool
help: Do you want to add a GitHub Workflow to automatically bump `pixi.lock`?
default: true

_tasks:
- '"{{ _copier_python }}" -I -c "import sys; sys.path.insert(0, \"{{ _copier_conf.src_path }}\"); import runpy;
runpy.run_module(\"tasks\", run_name=\"__main__\")"'
6 changes: 0 additions & 6 deletions tasks/__init__.py

This file was deleted.

19 changes: 0 additions & 19 deletions tasks/__main__.py

This file was deleted.

27 changes: 0 additions & 27 deletions tasks/git_init.py

This file was deleted.

17 changes: 13 additions & 4 deletions template/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,21 @@ jobs:
fetch-depth: 0
- name: Set up pixi
uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
with:
environments: build
- name: Derive version
id: version
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: echo "version=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_OUTPUT
- name: Replace version
if: startsWith(github.ref, 'refs/tags/')
run: |
sed -i -e "s/0.0.0/${STEPS_VERSION_OUTPUTS_VERSION}/g" pyproject.toml
env:
STEPS_VERSION_OUTPUTS_VERSION: ${{ steps.version.outputs.version }}
- name: Build project
run: pixi run -e build build-wheel
run: pixi run build-wheel
- name: Check package
run: pixi run -e build check-wheel
run: pixi run check-wheel
- name: Upload package
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
Expand Down
2 changes: 0 additions & 2 deletions template/.github/workflows/ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ jobs:
uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
with:
environments: ${{ matrix.environment }}
- name: Install repository
run: pixi run -e ${{ matrix.environment }} postinstall
- name: Run pytest
run: pixi run -e ${{ matrix.environment }} test-coverage --color=yes
{%- endraw %}
30 changes: 15 additions & 15 deletions template/pixi.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,39 @@
name = "{{ project_slug }}"
channels = ["conda-forge"]
platforms = ["osx-arm64", "osx-64", "linux-64", "win-64"]
preview = ["pixi-build"]

[tasks]
postinstall = "pip install --no-build-isolation --no-deps --disable-pip-version-check -e ."
[package]
name = "{{ project_slug }}"
[package.build.backend]
name = "pixi-build-python"
version = "*"
[package.host-dependencies]
python = ">={{ minimal_python_version.replace('py3', '3.') }}"
hatchling = "*"
Comment on lines +7 to +14
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run dependencies should be automatically picked up from pyproject.toml


[dependencies]
python = ">={{ minimal_python_version.replace('py3', '3.') }}"
pip = "*"
setuptools = ">=61"
setuptools-scm = "*"
{{ project_slug if "." not in project_slug else ('"' ~ project_slug ~ '"') }} = { path = "." }

[feature.test.dependencies]
pytest = ">=6"
pytest = "*"
pytest-cov = "*"
mypy = "*"
[feature.test.tasks]
test = "pytest"
test-coverage = "pytest --cov={{ project_slug_snake_case }} --cov-report=xml --cov-report=term-missing"

[feature.build.dependencies]
python = "*"
hatchling = "*"
python-build = "*"
twine = "*"
wheel = "*"
twine = ">=6"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

putting this in default results in a very old version (1.*) being selected if nothing else is specified. i think this is a bug in rattler_solve but not 100% sure

[feature.build.tasks]
build-wheel = "python -m build --no-isolation ."
check-wheel = "twine check dist/*"

[feature.lint.dependencies]
lefthook = "*"
insert-license-header = "*"
docformatter = "*"
ruff = "*"
prettier = "*"
Expand All @@ -55,7 +59,7 @@ python = "3.14.*"
{%- endif %}

[environments]
default = ["test", "lint"]
default = ["test", "build", "lint"]
{%- if minimal_python_version <= "py310" %}
py310 = ["py310", "test"]
{%- endif %}
Expand All @@ -71,7 +75,3 @@ py313 = ["py313", "test"]
{%- if minimal_python_version <= "py314" %}
py314 = ["py314", "test"]
{%- endif %}
{%- if build_docs %}
docs = ["docs"]
{%- endif %}
build = ["build"]
9 changes: 4 additions & 5 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[build-system]
requires = ["setuptools", "setuptools-scm", "wheel"]

[tool.setuptools_scm]
version_scheme = "post-release"
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "{{ project_slug }}"
description = "{{ project_short_description }}"
authors = [{ name = "{{ author_name }}", email = "{{ author_email }}" }]
dynamic = ["version"]
# replaced in CI
version = "0.0.0"
classifiers = [
"Programming Language :: Python :: 3",
{%- if minimal_python_version <= "py310" %}
Expand Down
26 changes: 0 additions & 26 deletions tests/test_tasks.py

This file was deleted.