Skip to content

Commit bf8f339

Browse files
authored
Merge branch 'main' into shhart-microsoft-migrate-to-ghcr-packages
2 parents 7e465eb + ab9cca6 commit bf8f339

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ jobs:
8888
path: 'presidio-structured'
8989
extras: ''
9090
spacy-models: ''
91+
include:
92+
- python-version: '3.14'
93+
component:
94+
name: 'Analyzer'
95+
path: 'presidio-analyzer'
96+
extras: '--all-extras'
97+
spacy-models: 'en_core_web_lg en_core_web_sm'
9198
env:
9299
POETRY_CACHE_DIR: /mnt/poetry_cache
93100
COVERAGE_THRESHOLD: 90

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ All notable changes to this project will be documented in this file.
1313
- Custom operator `validate()` no longer calls the user-supplied lambda with a dummy `"PII"` value. Previously, stateful lambdas (e.g. those accumulating a token-to-original-value map for de-anonymization) would receive a spurious invocation during validation, inserting a junk entry (`{"TOKEN_1": "PII"}`) into the map and skewing all subsequent token counters. The return-type contract is now enforced in `operate()` when the lambda runs on real data. Fixes [#2024](https://github.com/microsoft/presidio/issues/2024).
1414

1515
### Analyzer
16+
#### Changed
17+
- Added Python 3.14 package support for `presidio-analyzer` by allowing Python `<3.15` and avoiding `spacy==3.8.14`, which does not provide compatible Python 3.14 wheels.
18+
1619
#### Added
1720
- Optional `countries` filter on `RecognizerRegistry.load_predefined_recognizers()` to scope predefined country-specific recognizers to a subset of locales (e.g. `countries=["us", "uk"]`). The same filter is also exposed as a top-level `supported_countries` field in the recognizer-registry YAML, mirroring `supported_languages`, and as an advisory per-recognizer `country_code:` field on every predefined country-specific entry in `default_recognizers.yaml` (cross-checked against the class attribute at load time). Country tagging works via two reconciled paths: the class-level `EntityRecognizer.COUNTRY_CODE` ClassVar (canonical for predefined recognizers) and the new `country_code` constructor kwarg on `EntityRecognizer` / `PatternRecognizer` (the path for custom recognizers without a subclass — flows through `PatternRecognizer.from_dict` so YAML `type: custom` entries can declare `country_code:` directly). Conflicting values raise `ValueError` at construction time so a predefined country recognizer can never be silently re-tagged. The resolved tag is read via the `country_code()` and `is_country_specific()` instance methods, and serialized through `to_dict()` / `from_dict()` for round-tripping. Inputs to the `countries` filter are validated up front (rejects bare strings, non-iterables, non-string elements, and blank codes). Locale-agnostic recognizers and untagged custom recognizers are always loaded regardless of the filter, preserving backwards compatibility. Adds `RecognizerRegistry.get_country_codes()` for introspection and a `WARNING` log when a requested country has no matching recognizer. See `docs/analyzer/filtering_by_country.md`. Fixes #1328.
1821
- Canadian SIN (`CA_SIN`) recognizer for the Canadian Social Insurance Number, using regex pattern matching, context words (English and French), and Luhn checksum validation. Disabled by default.

presidio-analyzer/pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ classifiers = [
1515
"Programming Language :: Python :: 3.11",
1616
"Programming Language :: Python :: 3.12",
1717
"Programming Language :: Python :: 3.13",
18+
"Programming Language :: Python :: 3.14",
1819
]
1920
keywords = ["presidio_analyzer"]
2021
urls = {Homepage = "https://github.com/Microsoft/presidio"}
2122
readme = "README.md"
2223
include = ["conf/*",]
2324

24-
requires-python = ">=3.10,<3.14"
25+
requires-python = ">=3.10,<3.15"
2526
dependencies = [
26-
"spacy (>=3.4.4,!=3.7.0,<4.0.0)",
27+
"spacy (>=3.4.4,!=3.7.0,!=3.8.14,<4.0.0)",
2728
"numpy (>=1.19.0,<2.5.0)",
2829
"click (>=8.1.0,<9.0.0)",
2930
"regex (>=2023.0.0)",

0 commit comments

Comments
 (0)