You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Have poetry create a virtualenv forthe project and install all requirementsin the pyproject.toml,
41
+
2. Have uv create a virtualenv forthe project and install all requirementsin the pyproject.toml,
42
42
including dev requirements.
43
43
44
44
For example, in the `presidio-analyzer` folder, run:
45
45
46
46
```
47
-
poetry install --all-extras
47
+
uv sync --all-extras --group dev
48
48
```
49
49
50
+
Add `--locked` to install the exact locked dependency graph (matching CI behavior).
51
+
50
52
3. Run all tests:
51
53
52
54
```
53
-
poetry run pytest
55
+
uv run pytest
54
56
```
55
57
56
58
4. To run arbitrary scripts within the virtual env, start the command with
57
-
`poetry run`. For example:
58
-
1. `poetry run ruff check`
59
-
2. `poetry run pip freeze`
60
-
3. `poetry run python -m spacy download en_core_web_lg`
59
+
`uv run`. For example:
60
+
1. `uv run ruff check`
61
+
2. `uv run pip freeze`
62
+
3. `uv run python -m spacy download en_core_web_lg`
61
63
62
-
Command 3 downloads the default spacy model needed for Presidio Analyzer.`
64
+
Command 3 downloads the default spacy model needed for Presidio Analyzer.
63
65
64
-
#### Alternatively, activate the virtual environment and use the commands using [this method](https://python-poetry.org/docs/basic-usage/#activating-the-virtual-environment).
66
+
#### Alternatively, [activate the virtual environment](https://docs.astral.sh/uv/pip/environments/#using-a-virtual-environment) and run the commands without the `uv run` prefix.
65
67
66
68
### Development guidelines
67
69
@@ -93,9 +95,9 @@ use docker-compose ps:
93
95
```bash
94
96
>docker-compose ps
95
97
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
96
-
6d5a258d19c2 presidio-anonymizer "/bin/sh -c 'poetry …" 6 minutes ago Up 6 minutes 0.0.0.0:5001->5001/tcp presidio_presidio-anonymizer_1
97
-
9aad2b68f93c presidio-analyzer "/bin/sh -c 'poetry …" 2 days ago Up 6 minutes 0.0.0.0:5002->5001/tcp presidio_presidio-analyzer_1
98
-
1448dfb3ec2b presidio-image-redactor "/bin/sh -c 'poetry …" 2 seconds ago Up 2 seconds 0.0.0.0:5003->5001/tcp presidio_presidio-image-redactor_1
98
+
6d5a258d19c2 presidio-anonymizer "./entrypoint.sh" 6 minutes ago Up 6 minutes 0.0.0.0:5001->5001/tcp presidio_presidio-anonymizer_1
99
+
9aad2b68f93c presidio-analyzer "./entrypoint.sh" 2 days ago Up 6 minutes 0.0.0.0:5002->5001/tcp presidio_presidio-analyzer_1
100
+
1448dfb3ec2b presidio-image-redactor "./entrypoint.sh" 2 seconds ago Up 2 seconds 0.0.0.0:5003->5001/tcp presidio_presidio-image-redactor_1
99
101
```
100
102
101
103
Edit docker-compose.yml configuration file to change the default ports.
@@ -138,7 +140,7 @@ Running the tests locally can be done in two ways:
138
140
1. Using cli, from each service directory, run:
139
141
140
142
```sh
141
-
poetry run pytest
143
+
uv run pytest
142
144
```
143
145
144
146
2. Using your IDE.
@@ -202,7 +204,7 @@ Running the e2e-tests locally can be done in two ways:
202
204
203
205
Presidio services are PEP8 compliant and continuously enforced on style guide issues during the build process using `ruff`, in turn running `flake8` and other linters.
204
206
205
-
Running ruff locally, using `poetry run ruff check`, you can check for those issues prior to committing a change.
207
+
Running ruff locally, using `uv run ruff check`, you can check for those issues prior to committing a change.
206
208
207
209
Ruff runs linters in addition to the basic `flake8` functionality, Presidio uses linters as part as ruff such as:
Copy file name to clipboardExpand all lines: presidio-analyzer/presidio_analyzer/predefined_recognizers/country_specific/korea/kr_driver_license_recognizer.py
Copy file name to clipboardExpand all lines: presidio-analyzer/presidio_analyzer/predefined_recognizers/country_specific/korea/kr_passport_recognizer.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,12 @@ class KrPassportRecognizer(PatternRecognizer):
18
18
the previous passport number format:
19
19
- one letter 'M' or 'm' or 'S' or 's' or 'R' or 'r' or 'O' or 'o' or 'D' or 'd'
20
20
- eight digits
21
+
22
+
:param patterns: List of patterns to be used by this recognizer
23
+
:param context: List of context words to increase confidence in detection
24
+
:param supported_language: Language this recognizer supports
25
+
:param supported_entity: The entity this recognizer can detect
0 commit comments