Skip to content

Commit 0856479

Browse files
authoredMar 10, 2025··
Migrate to poetry 2.0 (and PEP 621) (#1539)
* Migrate to poetry 2.0 (and PEP 621) * migrate tomls * Update dependency from pycryptodome to cryptography
1 parent 8b288fa commit 0856479

File tree

5 files changed

+66
-68
lines changed

5 files changed

+66
-68
lines changed
 

‎presidio-analyzer/pyproject.toml

+17-25
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
build-backend = "poetry.core.masonry.api"
33
requires = ["poetry-core"]
44

5-
[tool.poetry]
5+
[project]
66
name = "presidio_analyzer"
77
version = "2.2.357"
88
description = "Presidio Analyzer package"
9-
authors = ["Presidio <presidio@microsoft.com>"]
9+
authors = [{name = "Presidio", email = "presidio@microsoft.com"}]
1010
license = "MIT"
1111
classifiers = [
1212
"License :: OSI Approved :: MIT License",
@@ -21,34 +21,26 @@ urls = {Homepage = "https://github.com/Microsoft/presidio"}
2121
readme = "README.md"
2222
include = ["conf/*",]
2323

24-
[tool.poetry.dependencies]
25-
python = ">=3.9,<4.0"
26-
spacy= ">=3.4.4, <4.0.0, !=3.7.0"
27-
regex = "*"
28-
tldextract = "*"
29-
pyyaml = "*"
30-
phonenumbers = ">=8.12,<9.0.0"
31-
flask = { version = ">=1.1", optional = true }
32-
spacy_huggingface_pipelines = { version = "*", optional = true }
33-
stanza = { version = ">=1.10.1,<2.0.0", optional = true}
34-
azure-ai-textanalytics = { version = "*", optional = true }
35-
azure-core = { version = "*", optional = true }
36-
gliner = {version = ">=0.2.13,<1.0.0", markers = "python_version >= '3.10'", optional = true}
37-
transformers = { version = "*", optional = true }
38-
huggingface_hub = { version = "*", optional = true }
39-
gunicorn = {version = "*", optional = true}
40-
onnxruntime = [
41-
{version = ">=1.19", markers = "python_version >= '3.10'", optional = true },
24+
requires-python = ">=3.9,<4.0"
25+
dependencies = [
26+
"spacy (>=3.4.4, <4.0.0, !=3.7.0)",
27+
"regex",
28+
"tldextract",
29+
"pyyaml",
30+
"phonenumbers (>=8.12,<9.0.0)"
4231
]
4332

44-
[tool.poetry.extras]
45-
server = ["flask", "gunicorn"]
33+
[project.optional-dependencies]
34+
server = [
35+
"flask (>=1.1)",
36+
"gunicorn"
37+
]
4638
transformers = [
4739
"transformers",
4840
"huggingface_hub",
4941
"spacy_huggingface_pipelines"]
5042
stanza = [
51-
"stanza",
43+
"stanza (>=1.10.1,<2.0.0)",
5244
]
5345
azure-ai-language = [
5446
"azure-ai-textanalytics",
@@ -57,8 +49,8 @@ azure-ai-language = [
5749
gliner = [
5850
"transformers",
5951
"huggingface_hub",
60-
"gliner",
61-
"onnxruntime"
52+
"gliner (>=0.2.13,<1.0.0) ; python_version >= '3.10'",
53+
"onnxruntime (>=1.19) ; python_version >= '3.10'"
6254
]
6355

6456
[tool.poetry.group.dev.dependencies]

‎presidio-anonymizer/pyproject.toml

+11-9
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
build-backend = "poetry.core.masonry.api"
33
requires = ["poetry-core"]
44

5-
[tool.poetry]
5+
[project]
66
name = "presidio_anonymizer"
77
version = "2.2.357"
88
description = "Presidio Anonymizer package - replaces analyzed text with desired values."
9-
authors = ["Presidio <presidio@microsoft.com>"]
9+
authors = [{name = "Presidio", email = "presidio@microsoft.com"}]
1010
license = "MIT"
1111
classifiers = [
1212
"License :: OSI Approved :: MIT License",
@@ -20,14 +20,16 @@ keywords = ["presidio_anonymizer"]
2020
urls = {Homepage = "https://github.com/Microsoft/presidio"}
2121
readme = "README.md"
2222

23-
[tool.poetry.dependencies]
24-
python = ">=3.9,<4.0"
25-
cryptography = "<44.1"
26-
flask = { version = ">=1.1", optional = true }
27-
gunicorn = {version = "*", optional = true}
23+
requires-python = ">=3.9,<4.0"
24+
dependencies = [
25+
"cryptography (<44.1)"
26+
]
2827

29-
[tool.poetry.extras]
30-
server = ["flask", "gunicorn"]
28+
[project.optional-dependencies]
29+
server = [
30+
"flask (>=1.1)",
31+
"gunicorn"
32+
]
3133

3234
[tool.poetry.group.dev.dependencies]
3335
pip = "*"

‎presidio-cli/pyproject.toml

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
build-backend = "poetry.core.masonry.api"
33
requires = ["poetry-core"]
44

5-
[tool.poetry]
5+
[project]
66
name = "presidio-cli"
77
version = "0.0.8"
88
description = "CLI tool that analyzes text for PII Entities using Presidio Analyzer."
9-
authors = ["Presidio <presidio@microsoft.com>"]
9+
authors = [{name = "Presidio", email = "presidio@microsoft.com"}]
1010
license = "MIT"
1111
classifiers = [
1212
"License :: OSI Approved :: MIT License",
@@ -20,14 +20,15 @@ keywords = ["pii", "checker", "presidio_cli"]
2020
urls = {Homepage = "https://github.com/microsoft/presidio"}
2121
readme = "README.md"
2222
include = ["conf/*", ".presidiocli"]
23+
requires-python = ">=3.9,<4.0"
2324

24-
[tool.poetry.dependencies]
25-
python = ">=3.9,<4.0"
26-
presidio-analyzer = ">= 2.2"
27-
pyyaml = "*"
28-
pathspec = "*"
25+
dependencies = [
26+
"presidio-analyzer (>= 2.2)",
27+
"pyyaml",
28+
"pathspec"
29+
]
2930

30-
[tool.poetry.scripts]
31+
[project.scripts]
3132
presidio = "presidio_cli.cli:run"
3233

3334
[tool.poetry.group.dev.dependencies]

‎presidio-image-redactor/pyproject.toml

+20-18
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
build-backend = "poetry.core.masonry.api"
33
requires = ["poetry-core"]
44

5-
[tool.poetry]
5+
[project]
66
name = "presidio-image-redactor"
77
version = "0.0.55"
88
description = "Presidio image redactor package"
9-
authors = ["Presidio <presidio@microsoft.com>"]
9+
authors = [{name = "Presidio", email = "presidio@microsoft.com"}]
1010
license = "MIT"
1111
classifiers = [
1212
"License :: OSI Approved :: MIT License",
@@ -19,24 +19,26 @@ classifiers = [
1919
keywords = ["presidio_image_redactor"]
2020
urls = {Homepage = "https://github.com/Microsoft/presidio"}
2121
readme = "README.md"
22+
requires-python = ">=3.9,<4.0"
2223

23-
[tool.poetry.dependencies]
24-
python = ">=3.9,<4.0"
25-
pillow = ">=9.0"
26-
pytesseract = ">=0.3.7,<0.4"
27-
presidio-analyzer = ">=1.9.0"
28-
matplotlib = ">=3.6"
29-
pydicom = ">=2.3.0"
30-
pypng = ">=0.20220715.0"
31-
azure-ai-formrecognizer = ">=3.3.0,<4.0.0"
32-
opencv-python = ">=4.0.0,<5.0.0"
33-
python-gdcm = ">=3.0.24.1"
34-
spacy = { version = "<3.8.4", python = "<3.10" } #Remove once 3.9 is EOL
35-
flask = { version = ">=1.1", optional = true }
36-
gunicorn = {version = "*", optional = true}
24+
dependencies = [
25+
"pillow (>=9.0)",
26+
"pytesseract (>=0.3.7,<0.4)",
27+
"presidio-analyzer (>=1.9.0)",
28+
"matplotlib (>=3.6)",
29+
"pydicom (>=2.3.0)",
30+
"pypng (>=0.20220715.0)",
31+
"azure-ai-formrecognizer (>=3.3.0,<4.0.0)",
32+
"opencv-python (>=4.0.0,<5.0.0)",
33+
"python-gdcm (>=3.0.24.1)",
34+
"spacy (<3.8.4) ; python_version<'3.10'" #Remove once 3.9 is EOL
35+
]
3736

38-
[tool.poetry.extras]
39-
server = ["flask", "gunicorn"]
37+
[project.optional-dependencies]
38+
server = [
39+
"flask (>=1.1)",
40+
"gunicorn"
41+
]
4042

4143
[tool.poetry.group.dev.dependencies]
4244
pip = "*"

‎presidio-structured/pyproject.toml

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
build-backend = "poetry.core.masonry.api"
33
requires = ["poetry-core"]
44

5-
[tool.poetry]
5+
[project]
66
name = "presidio_structured"
77
version = "0.0.4-alpha"
88
description = "Presidio structured package - analyzes and anonymizes structured and semi-structured data."
9-
authors = ["Presidio <presidio@microsoft.com>"]
9+
authors = [{name = "Presidio", email = "presidio@microsoft.com"}]
1010
license = "MIT"
1111
classifiers = [
1212
"License :: OSI Approved :: MIT License",
@@ -19,13 +19,14 @@ classifiers = [
1919
keywords = ["presidio_structured"]
2020
urls = {Homepage = "https://github.com/microsoft/presidio"}
2121
readme = "README.md"
22+
requires-python = ">=3.9,<4.0"
2223

23-
[tool.poetry.dependencies]
24-
python = ">=3.9,<4.0"
25-
presidio-analyzer = ">=2.2"
26-
presidio-anonymizer = ">=2.2"
27-
pandas = ">=1.5.2"
28-
spacy = { version = "<3.8.4", python = "<3.10" } #Remove once 3.9 is EOL
24+
dependencies = [
25+
"presidio-analyzer (>=2.2)",
26+
"presidio-anonymizer (>=2.2)",
27+
"pandas (>=1.5.2)",
28+
"spacy (<3.8.4) ; python_version<'3.10'" #Remove once 3.9 is EOL
29+
]
2930

3031
[tool.poetry.group.dev.dependencies]
3132
pip = "*"

0 commit comments

Comments
 (0)
Please sign in to comment.