Skip to content

Commit 565f2fa

Browse files
committed
Hyperscan backend
1 parent e4977fc commit 565f2fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5462
-1312
lines changed

CHANGES.rst

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,29 @@ Change History
33
==============
44

55

6-
0.12.2 (TBD)
6+
0.13.0 (TBD)
77
-------------------
88

9+
Major changes:
10+
11+
- `Issue #91`_: Dropped support of EoL Python 3.8.
12+
13+
New features:
14+
15+
- Added optional `hyperscan`_ backend for faster regex matching. It will automatically be used when installed. The backend can be controlled using the `backend` argument to `PathSpec()`, `PathSpec.from_lines()`, `GitIgnoreSpec()`, or `GitIgnoreSpec.from_lines()`.
16+
17+
Bug fixes:
18+
19+
- `Issue #98`_: UnboundLocalError in RegexPattern when initialized with pattern=None.
20+
921
Improvements:
1022

11-
- Support Python 3.13, 3.14.
23+
- Mark Python 3.13 and 3.14 as supported.
24+
- No-op patterns are now filtered out when matching files, slightly improving performance.
25+
26+
.. _`hyperscan`: https://pypi.org/project/hyperscan/
27+
.. _`Issue #91`: https://github.com/cpburnz/python-pathspec/issues/91
28+
.. _`Issue #98`: https://github.com/cpburnz/python-pathspec/issues/98
1229

1330

1431
0.12.1 (2023-12-10)
@@ -27,8 +44,7 @@ Bug fixes:
2744

2845
Major changes:
2946

30-
- Dropped support of EOL Python 3.7. See `Pull #82`_.
31-
47+
- Dropped support of EoL Python 3.7. See `Pull #82`_.
3248

3349
API changes:
3450

@@ -182,7 +198,7 @@ Improvements:
182198

183199
Major changes:
184200

185-
- Dropped support of EOL Python 2.7, 3.5, 3.6. See `Issue #47`_.
201+
- Dropped support of EoL Python 2.7, 3.5, 3.6. See `Issue #47`_.
186202
- The *gitwildmatch* pattern `dir/*` is now handled the same as `dir/`. This means `dir/*` will now match all descendants rather than only direct children. See `Issue #19`_.
187203
- Added `pathspec.GitIgnoreSpec` class (see new features).
188204
- Changed build system to `pyproject.toml`_ and build backend to `setuptools.build_meta`_ which may have unforeseen consequences.

DEV.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ These are notes to myself for things to review before decommissioning EoL versio
1010

1111
### Python
1212

13-
**Python 3.8:**
14-
15-
- EoL as of 2024-10-07.
16-
- Cannot remove support until Hatchling stops supporting Python 3.8.
17-
1813
**Python 3.9:**
1914

2015
- Becomes EoL in 2025-10.
@@ -37,6 +32,10 @@ These are notes to myself for things to review before decommissioning EoL versio
3732

3833
- Becomes EoL in 2029-10.
3934

35+
**Python 3.14**
36+
37+
- Becomes EoL in 2030-10.
38+
4039
References:
4140

4241
- [Status of Python Versions](https://devguide.python.org/versions/)
@@ -46,10 +45,6 @@ References:
4645

4746
Review the following Linux distributions.
4847

49-
**CentOS:**
50-
51-
- TODO
52-
5348
**Debian:**
5449

5550
- Goal:
@@ -125,25 +120,25 @@ Review the following PyPI packages.
125120

126121
[ansible-lint](https://pypi.org/project/ansible-lint/)
127122

128-
- v25.6.1 (latest as of 2025-06-26) requires Python 3.10+.
123+
- v25.9.2 (latest as of 2025-10-20) requires Python 3.10+.
129124
- [ansible-lint on Wheelodex](https://www.wheelodex.org/projects/ansible-lint/).
130125

131126
[black](https://pypi.org/project/black/)
132127

133-
- v25.1.0 (latest as of 2025-06-26) requires Python 3.9+.
128+
- v25.9.0 (latest as of 2025-10-20) requires Python 3.9+.
134129
- [black on Wheelodex](https://www.wheelodex.org/projects/black/).
135130

136131
[dvc](https://pypi.org/project/dvc/)
137132

138-
- v3.60.1 (latest as of 2025-06-26) requires Python 3.9+.
133+
- v3.63.0 (latest as of 2025-10-20) requires Python 3.9+.
139134
- [dvc on Wheelodex](https://www.wheelodex.org/projects/dvc/).
140135

141136
[hatchling](https://pypi.org/project/hatchling/)
142137

143-
- v1.27.0 (latest as of 2025-06-26) requires Python 3.8+.
138+
- v1.27.0 (latest as of 2025-10-20) requires Python 3.8+, but next release will require Python 3.9+.
144139
- [hatchling on Wheelodex](https://www.wheelodex.org/projects/hatchling/).
145140

146141
[yamllint](https://pypi.org/project/yamllint/)
147142

148-
- v1.37.1 (latest as of 2025-06-26) requires Python 3.9+.
143+
- v1.37.1 (latest as of 2025-10-20) requires Python 3.9+.
149144
- [yamllint on Wheelodex](https://www.wheelodex.org/projects/yamllint/).

Makefile

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

README-dist.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,19 @@ Change History
170170
==============
171171

172172

173-
0.12.2 (TBD)
173+
0.13.0 (TBD)
174174
-------------------
175175

176+
Major changes:
177+
178+
- `Issue #91`_: Dropped support of EOL Python 3.8.
179+
176180
Improvements:
177181

178-
- Support Python 3.13, 3.14.
182+
- Mark Python 3.13 and 3.14 as supported.
183+
184+
185+
.. _`Issue #91`: https://github.com/cpburnz/python-pathspec/issues/91
179186

180187

181188
0.12.1 (2023-12-10)

benchmarks/__init__.py

Whitespace-only changes.

benchmarks/bench_fs.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
from pathlib import (
3+
Path)
4+
5+
import pytest
6+
from pytest_benchmark.fixture import (
7+
BenchmarkFixture)
8+
9+
from pathspec.util import (
10+
iter_tree_entries,
11+
iter_tree_files)
12+
13+
14+
@pytest.mark.benchmark(group="iter_tree_entries", warmup=True)
15+
def bench_iter_tree_entries(benchmark: BenchmarkFixture, cpython_dir: Path):
16+
benchmark(run_iter_tree_entries, cpython_dir)
17+
18+
19+
@pytest.mark.benchmark(group="iter_tree_files", warmup=True)
20+
def bench_iter_tree_files_v0(benchmark: BenchmarkFixture, cpython_dir: Path):
21+
benchmark(run_iter_tree_files_v0, cpython_dir)
22+
23+
24+
@pytest.mark.benchmark(group="iter_tree_files", warmup=True)
25+
def bench_iter_tree_files_v1(benchmark: BenchmarkFixture, cpython_dir: Path):
26+
benchmark(run_iter_tree_files_v1, cpython_dir)
27+
28+
29+
def run_iter_tree_entries(path: Path):
30+
for _ in iter_tree_entries(path):
31+
pass
32+
33+
34+
def run_iter_tree_files_v0(path: Path):
35+
for entry in iter_tree_entries(path):
36+
if not entry.is_dir():
37+
pass
38+
39+
40+
def run_iter_tree_files_v1(path: Path):
41+
for _ in iter_tree_files(path):
42+
pass

0 commit comments

Comments
 (0)