Skip to content

Commit 2d6e4df

Browse files
chore: Update copier template to v0.5.1
1 parent 8264bd6 commit 2d6e4df

10 files changed

Lines changed: 136 additions & 113 deletions

File tree

.claude/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../AGENTS.md

.copier-answers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This file is managed by Copier; DO NOT EDIT OR REMOVE.
2-
_commit: v0.4.1
2+
_commit: v0.5.1
33
_src_path: https://github.com/quantco/copier-template-python-open-source
44
add_autobump_workflow: false
55
author_email: noreply@quantco.com
66
author_name: QuantCo, Inc.
77
github_url: https://github.com/quantco/multiregex
88
github_user: pavelzw
9-
minimal_python_version: py39
9+
minimal_python_version: py310
1010
project_short_description: Quickly match many regexes against a string. Provides 2-10x
1111
speedups over naïve regex matching.
1212
project_slug: multiregex

.github/workflows/build.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,28 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919
- name: Set up pixi
20+
<<<<<<< before updating
2021
uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
21-
with:
22-
environments: build
22+
||||||| last update
23+
uses: prefix-dev/setup-pixi@19eac09b398e3d0c747adc7921926a6d802df4da # v0.8.8
24+
=======
25+
uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
26+
>>>>>>> after updating
27+
- name: Derive version
28+
id: version
29+
if: startsWith(github.ref, 'refs/tags/')
30+
shell: bash
31+
run: echo "version=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_OUTPUT
32+
- name: Replace version
33+
if: startsWith(github.ref, 'refs/tags/')
34+
run: |
35+
sed -i -e "s/0.0.0/${STEPS_VERSION_OUTPUTS_VERSION}/g" pyproject.toml
36+
env:
37+
STEPS_VERSION_OUTPUTS_VERSION: ${{ steps.version.outputs.version }}
2338
- name: Build project
24-
run: pixi run -e build build-wheel
39+
run: pixi run build-wheel
2540
- name: Check package
26-
run: pixi run -e build check-wheel
41+
run: pixi run check-wheel
2742
- name: Upload package
2843
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
2944
with:

.github/workflows/ci.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,25 @@ permissions:
1414
contents: read
1515

1616
jobs:
17-
pre-commit:
17+
lint:
18+
name: Lint
1819
timeout-minutes: 30
1920
runs-on: ubuntu-latest
2021
steps:
2122
- name: Checkout branch
2223
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2324
- name: Set up pixi
25+
<<<<<<< before updating
2426
uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
25-
with:
26-
environments: default lint
27-
- name: pre-commit
28-
run: pixi run pre-commit-run --color=always --show-diff-on-failure
27+
||||||| last update
28+
uses: prefix-dev/setup-pixi@19eac09b398e3d0c747adc7921926a6d802df4da # v0.8.8
29+
=======
30+
uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
31+
>>>>>>> after updating
32+
- name: Run linting
33+
run: pixi run lint
34+
env:
35+
CLICOLOR_FORCE: 1
2936

3037
pytest:
3138
timeout-minutes: 30
@@ -34,11 +41,11 @@ jobs:
3441
fail-fast: false
3542
matrix:
3643
environment:
37-
- py39
3844
- py310
3945
- py311
4046
- py312
4147
- py313
48+
- py314
4249
os:
4350
- ubuntu-latest
4451
- macos-latest
@@ -49,10 +56,14 @@ jobs:
4956
with:
5057
fetch-depth: 0
5158
- name: Set up pixi
59+
<<<<<<< before updating
5260
uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
61+
||||||| last update
62+
uses: prefix-dev/setup-pixi@19eac09b398e3d0c747adc7921926a6d802df4da # v0.8.8
63+
=======
64+
uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
65+
>>>>>>> after updating
5366
with:
5467
environments: ${{ matrix.environment }}
55-
- name: Install repository
56-
run: pixi run -e ${{ matrix.environment }} postinstall
5768
- name: Run pytest
5869
run: pixi run -e ${{ matrix.environment }} test-coverage --color=yes

.github/workflows/scorecard.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ jobs:
7474
# Upload the results to GitHub's code scanning dashboard (optional).
7575
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7676
- name: "Upload to code-scanning"
77+
<<<<<<< before updating
7778
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
79+
||||||| last update
80+
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
81+
=======
82+
uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
83+
>>>>>>> after updating
7884
with:
7985
sarif_file: results.sarif

.lefthook.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/evilmartians/lefthook/refs/heads/master/schema.json
2+
output: [summary]
3+
templates:
4+
run: run --quiet --no-progress
5+
no_auto_install: true
6+
pre-commit:
7+
fail_on_changes: always
8+
exclude:
9+
- assets/**/*
10+
jobs:
11+
- name: pixi-install
12+
run: pixi install
13+
- group:
14+
parallel: true
15+
jobs:
16+
- name: ruff-check
17+
glob: "*.{py,pyi}"
18+
run: pixi {run} ruff check --fix --exit-non-zero-on-fix --force-exclude
19+
- name: ruff-format
20+
glob: "*.{py,pyi}"
21+
run: pixi {run} ruff format --force-exclude
22+
- name: mypy
23+
glob: "*.py"
24+
run: pixi {run} mypy {staged_files}
25+
- name: prettier
26+
glob: "*.{md,yml,yaml}"
27+
run: pixi {run} prettier --write --no-error-on-unmatched-pattern --list-different --ignore-unknown {staged_files}
28+
- name: taplo
29+
glob: "*.toml"
30+
run: pixi {run} taplo format {staged_files}
31+
- name: trailing-whitespace-fixer
32+
glob: "*"
33+
file_types: text
34+
run: pixi {run} trailing-whitespace-fixer {staged_files}
35+
- name: end-of-file-fixer
36+
glob: "*"
37+
file_types: text
38+
run: pixi {run} end-of-file-fixer {staged_files}
39+
- name: check-merge-conflict
40+
glob: "*"
41+
file_types: text
42+
run: pixi {run} check-merge-conflict --assume-in-merge {staged_files}
43+
- name: typos
44+
glob: "*"
45+
file_types: text
46+
run: pixi {run} typos --force-exclude {staged_files}
47+
- name: zizmor
48+
glob: "*.{yml,yaml}"
49+
run: pixi {run} zizmor --no-progress --min-severity high --fix .

.pre-commit-config.yaml

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

AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Lockfiles must be consistent with package metadata. After any change to `pixi.toml`, run `pixi lock`.
2+
3+
Everything runs in a pixi environment. Any command (like `pytest`) must be prefixed with `pixi run` (e.g. `pixi run pytest`).
4+
5+
Code formatting must align with our standards. Run `pixi run lint` before `git commit`s to ensure this.

pixi.toml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
1-
[project]
1+
[workspace]
22
name = "multiregex"
33
channels = ["conda-forge"]
44
platforms = ["osx-arm64", "osx-64", "linux-64", "win-64"]
5+
preview = ["pixi-build"]
56

6-
[tasks]
7-
postinstall = "pip install --no-build-isolation --no-deps --disable-pip-version-check -e ."
7+
[package]
8+
name = "multiregex"
9+
[package.build.backend]
10+
name = "pixi-build-python"
11+
version = "*"
12+
[package.host-dependencies]
13+
python = ">=3.10"
14+
hatchling = "*"
815

916
[dependencies]
10-
python = ">=3.9"
17+
multiregex = { path = "." }
1118
pyahocorasick = "*"
1219

13-
[host-dependencies]
14-
pip = "*"
15-
setuptools = ">=61"
16-
setuptools-scm = "*"
17-
1820
[feature.test.dependencies]
21+
<<<<<<< before updating
1922
pytest = ">=6,<8"
23+
||||||| last update
24+
pytest = ">=6"
25+
=======
26+
pytest = "*"
27+
>>>>>>> after updating
2028
pytest-cov = "*"
2129
mypy = "*"
2230
[feature.test.tasks]
2331
test = "pytest"
2432
test-coverage = "pytest --cov=multiregex --cov-report=xml --cov-report=term-missing"
2533

2634
[feature.build.dependencies]
35+
python = "*"
36+
hatchling = "*"
2737
python-build = "*"
28-
twine = "*"
29-
wheel = "*"
38+
twine = ">=6"
3039
[feature.build.tasks]
3140
build-wheel = "python -m build --no-isolation ."
3241
check-wheel = "twine check dist/*"
3342

3443
[feature.lint.dependencies]
35-
pre-commit = "*"
36-
insert-license-header = "*"
37-
docformatter = "*"
44+
lefthook = "*"
3845
ruff = "*"
3946
prettier = "*"
4047
taplo = "*"
4148
pre-commit-hooks = "*"
4249
typos = "*"
50+
zizmor = "*"
4351
[feature.lint.tasks]
44-
pre-commit-install = "pre-commit install"
45-
pre-commit-run = "pre-commit run -a"
52+
pre-commit-install = "lefthook install"
53+
lint = "lefthook run pre-commit --all-files"
4654

47-
[feature.py39.dependencies]
48-
python = "3.9.*"
4955
[feature.py310.dependencies]
5056
python = "3.10.*"
5157
[feature.py311.dependencies]
@@ -54,13 +60,13 @@ python = "3.11.*"
5460
python = "3.12.*"
5561
[feature.py313.dependencies]
5662
python = "3.13.*"
63+
[feature.py314.dependencies]
64+
python = "3.14.*"
5765

5866
[environments]
59-
default = ["test"]
60-
py39 = ["py39", "test"]
67+
default = ["test", "build", "lint"]
6168
py310 = ["py310", "test"]
6269
py311 = ["py311", "test"]
6370
py312 = ["py312", "test"]
6471
py313 = ["py313", "test"]
65-
build = ["build"]
66-
lint = { features = ["lint"], no-default-feature = true }
72+
py314 = ["py314", "test"]

pyproject.toml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[build-system]
2-
requires = ["setuptools", "setuptools-scm", "wheel"]
3-
4-
[tool.setuptools_scm]
5-
version_scheme = "post-release"
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
64

75
[project]
86
name = "multiregex"
@@ -11,17 +9,18 @@ authors = [
119
{ name = "QuantCo, Inc.", email = "noreply@quantco.com" },
1210
{ name = "Jonas Haag", email = "jonas@lophus.org" },
1311
]
14-
dynamic = ["version"]
12+
# replaced in CI
13+
version = "0.0.0"
1514
maintainers = [{ name = "Bela Stoyan", email = "bela.stoyan@quantco.com" }]
1615
classifiers = [
1716
"Programming Language :: Python :: 3",
18-
"Programming Language :: Python :: 3.9",
1917
"Programming Language :: Python :: 3.10",
2018
"Programming Language :: Python :: 3.11",
2119
"Programming Language :: Python :: 3.12",
2220
"Programming Language :: Python :: 3.13",
21+
"Programming Language :: Python :: 3.14",
2322
]
24-
requires-python = ">=3.9"
23+
requires-python = ">=3.10"
2524
readme = "README.md"
2625
dependencies = ["pyahocorasick"]
2726

@@ -61,7 +60,7 @@ quote-style = "double"
6160
indent-style = "space"
6261

6362
[tool.mypy]
64-
python_version = '3.9'
63+
python_version = '3.10'
6564
no_implicit_optional = true
6665
check_untyped_defs = true
6766
allow_redefinition = true

0 commit comments

Comments
 (0)