Skip to content

Commit 4149778

Browse files
authored
Upgraded Dependencies and Converted to UV (#40)
* Upgraded Dependencies and Converted to UV Added mapping fix Updated presidio version Mapper docs update * Updated PR template
1 parent 2e1481c commit 4149778

33 files changed

Lines changed: 5668 additions & 5855 deletions

.github/pull_request_template.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ PR description. Explain what it's doing and why.
88
### Checklist
99

1010
- [ ] New PII Detection Service Added (Optional)
11-
- [ ] New PII Mappings added (Optional)
12-
- [ ] New citations added (if using other open source or research software) (Optional)
13-
- [ ] New PII types added to new version file under pii_codex/data (and JSON file generated) (Optional)
11+
- [ ] New PII types added to pii_type_mappings (Optional)
1412
- [ ] Tests added
1513
- [ ] CI passed
1614
- [ ] Commits Squashed

.github/workflows/checks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414
- name: setup - python
15-
uses: actions/setup-python@v3
15+
uses: actions/setup-python@v4
1616
with:
17-
python-version: 3.9
17+
python-version: 3.12
1818
- name: Install Global Dependencies
19-
run: pip install -U pip && pip install poetry wheel
19+
run: pip install -U pip && pip install uv
2020
- name: install
2121
run: make install
2222
- name: typecheck

.github/workflows/draft-pdf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
journal: joss
1414
paper-path: ./joss/paper.md
1515
- name: Upload
16-
uses: actions/upload-artifact@v1
16+
uses: actions/upload-artifact@v4
1717
with:
1818
name: paper
1919
path: ./joss/paper.pdf

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Setup Python
19-
uses: actions/setup-python@v3
19+
uses: actions/setup-python@v4
2020
with:
21-
python-version: 3.9
21+
python-version: 3.12
2222
- name: Checkout branch "main"
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
with:
2525
ref: 'main'
2626
fetch-depth: 0
2727
- name: Install Global Dependencies
28-
run: pip install -U pip && pip install poetry wheel
28+
run: pip install -U pip && pip install uv
2929
- name: Build project for distribution
30-
run: poetry build
30+
run: uv build
3131
- name: Get Current Version
3232
id: get_version
3333
run: |
34-
TAG_NAME=$(poetry version -s)
34+
TAG_NAME=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
3535
echo "TAG_NAME=v$TAG_NAME" >> $GITHUB_ENV
3636
echo "$TAG_NAME"
3737
- name: Check Released Versions
@@ -59,5 +59,5 @@ jobs:
5959
prerelease: false
6060
- name: Publish to PyPI
6161
env:
62-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PII_CODEX_PYPI_TOKEN }}
63-
run: poetry publish
62+
UV_PYPI_TOKEN_PYPI: ${{ secrets.PII_CODEX_PYPI_TOKEN }}
63+
run: uv publish

.github/workflows/test.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
push:
66
paths:
77
- "pii_codex/**"
8-
- "poetry.lock"
8+
- "uv.lock"
99
- "pyproject.toml"
1010
- ".github/workflows/test.yml"
1111

@@ -17,27 +17,24 @@ jobs:
1717
name: Run Tests
1818
strategy:
1919
matrix:
20-
python-version: [ "3.9", "3.10" ]
21-
os: [ubuntu-22.04, macos-latest]
20+
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
21+
os: [ubuntu-latest, macos-latest]
2222
runs-on: ${{ matrix.os }}
2323

2424
# Checkout the code, install poetry, install dependencies,
2525
# and run test with coverage
2626
steps:
2727
- name: Environment Setup
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929
- name: Setup Python
30-
uses: actions/setup-python@v3
30+
uses: actions/setup-python@v4
3131
with:
3232
python-version: ${{ matrix.python-version }}
3333
- name: Install Global Dependencies
34-
run: pip install -U pip && pip install poetry wheel
34+
run: pip install -U pip && pip install uv
3535
- name: Install Project Dependencies
3636
run: |
37-
poetry config virtualenvs.create true
3837
make install
39-
make install.extras
40-
- uses: actions/checkout@master
4138
- name: Run Tests
4239
run: |
4340
make test.coverage

.zenodo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"access_right": "open",
3-
"version": "0.4.6",
3+
"version": "0.5.0",
44
"creators": [
55
{
66
"orcid": "0000-0003-0665-098X",

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ authors:
55
given-names: Eidan J.
66
orcid: https://orcid.org/0000-0003-0665-098X
77
title: "pii-codex: a Python library for PII detection, categorization, and severity assessment"
8-
version: 0.4.6
8+
version: 0.5.0
99
doi: 10.5281/zenodo.7212576
10-
date-released: 2023-06-18
10+
date-released: 2025-08-24

Makefile

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ test: lint test.all
66
test.cov: test.coverage
77

88
install:
9-
@poetry update
10-
@poetry install
11-
$(MAKE) install.extras
9+
@uv sync
10+
@uv sync --all-extras
11+
@uv sync --extra dev
1212
$(MAKE) install.pre_commit
13+
@echo "Installation complete!"
1314

1415
install.pre_commit:
15-
@poetry run pre-commit install
16+
@uv run pre-commit install || (echo "Warning: pre-commit installation failed. You may need to run 'uv sync --extra dev' first." && exit 1)
1617

1718
install.extras:
18-
@poetry install --extras="detections"
19+
@echo "Installing detection dependencies (spaCy, Presidio, etc.)..."
20+
@uv sync --extra detections
1921

2022
install_spacy_en_core_web_lg:
2123
@python3 -m spacy download en_core_web_lg
@@ -27,14 +29,14 @@ test.all:
2729
@pytest tests
2830

2931
test.coverage:
30-
@poetry run coverage run -m pytest -vv tests && poetry run coverage report -m --omit="*/test*,config/*.conf" --fail-under=95
31-
@poetry run coverage xml
32+
@uv run coverage run -m pytest -vv tests && uv run coverage report -m --omit="*/test*,config/*.conf" --fail-under=95
33+
@uv run coverage xml
3234

3335
lint:
34-
@poetry run pylint pii_codex tests
36+
@uv run pylint pii_codex tests
3537

3638
typecheck:
37-
@poetry run mypy pii_codex tests
39+
@uv run mypy pii_codex tests
3840

3941
format.check:
4042
@black . --check
@@ -49,16 +51,16 @@ docs:
4951
@pdoc --html pii_codex --force -o ./docs/dev
5052

5153
version.bump.patch:
52-
@poetry version patch
53-
$(MAKE) bump.citation.date
54+
@uv run bumpver update --patch
55+
# $(MAKE) bump.citation.date
5456

5557
version.bump.minor:
56-
@poetry version minor
58+
@uv run bumpver update --minor
5759
$(MAKE) bump.citation.date
5860

5961
version.bump.major:
60-
@poetry version major
62+
@uv run bumpver update --major
6163
$(MAKE) bump.citation.date
6264

6365
package:
64-
@poetry build
66+
@uv build

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PII Detection, Categorization, and Severity Assessment
99
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/EdyVision/pii-codex/graphs/commit-activity)
1010
[![codecov](https://codecov.io/gh/EdyVision/pii-codex/branch/main/graph/badge.svg?token=QO7DNMP87X)](https://codecov.io/gh/EdyVision/pii-codex)
1111
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
12-
[![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-390/)
12+
[![Python 3.9-3.12](https://img.shields.io/badge/python-3.9--3.12-blue.svg)](https://www.python.org/downloads/)
1313
[![DOI](https://zenodo.org/badge/533554671.svg)](https://zenodo.org/badge/latestdoi/533554671)
1414
[![status](https://joss.theoj.org/papers/5296a84bba0925e682dcddf14bec5880/status.svg)](https://joss.theoj.org/papers/5296a84bba0925e682dcddf14bec5880)
1515

@@ -36,17 +36,17 @@ Potential usages include sanitizing of dataset strings (e.g. a collection of soc
3636

3737
<hr/>
3838

39-
## Running Locally with Poetry
40-
This project uses Poetry. To run this project, install `poetry` and proceed to follow the instructions under `/docs/LOCAL_SETUP.md`.
39+
## Running Locally with uv
40+
This project uses `uv` for dependency management. To run this project, install `uv` and proceed to follow the instructions under `/docs/LOCAL_SETUP.md`.
4141

42-
`Note: This project has only been tested with Ubuntu and MacOS and with Python versions 3.9 and 3.10. You may need to upgrade pip ahead of installation.`
42+
`Note: This project has only been tested with Ubuntu and MacOS and with Python versions 3.11 and 3.12. You may need to upgrade pip ahead of installation.`
4343

4444
## Installing with PIP
45-
Video capture of install provided in LOCAL_SETUP.md file. Make sure you set up a virtual environment with either python 3.9 or 3.10 and upgrade pip with:
45+
Video capture of install provided in LOCAL_SETUP.md file. Make sure you set up a virtual environment with either python 3.11 or 3.12 and upgrade pip with:
4646

4747
```bash
4848
pip install --upgrade pip
49-
pip install -U pip setuptools wheel # only needed if you haven't already done so
49+
pip install -U pip uv # only needed if you haven't already done so
5050
```
5151

5252
Before adding `pii-codex` on your project, download the spaCy `en_core_web_lg` model:
@@ -67,12 +67,12 @@ pip install "pii-codex[detections]"
6767

6868
`Note: The extras installed with pii-codex[detections] are the spaCy, Micrisoft Presidio Analyzer, and Microsoft Anonymzer packages.`
6969

70-
Using Poetry:
70+
Using uv:
7171

7272
```bash
73-
poetry update
74-
poetry add pii-codex
75-
poetry install pii-codex --extras="detections"
73+
uv sync
74+
uv add pii-codex
75+
uv add "pii-codex[detections]"
7676
```
7777

7878
For those using Google Collab, check out the example notebook:
@@ -162,7 +162,7 @@ For more information on usage, check out the respective documentation for guidan
162162
<hr/>
163163

164164
## Attributions
165-
This project benefited greatly from a number of PII research works like that from Milne et al (2016) with the definition of the types and categories, Schwartz and Solove (2012) with the severity levels of Non-Identifiable, Semi-Identifiable, and Identifiable, and the documentation by NIST, DHS (2012), and HIPAA (full list of foundational publications provided below). A special thanks to all the open source projects, and frameworks that made the setup and structuring of this project much easier like Poetry, Microsoft Presidio, spaCy (2017), Jupyter, and several others.
165+
This project benefited greatly from a number of PII research works like that from Milne et al (2016) with the definition of the types and categories, Schwartz and Solove (2012) with the severity levels of Non-Identifiable, Semi-Identifiable, and Identifiable, and the documentation by NIST, DHS (2012), and HIPAA (full list of foundational publications provided below). A special thanks to all the open source projects, and frameworks that made the setup and structuring of this project much easier like uv, Microsoft Presidio, spaCy (2017), Jupyter, and several others.
166166

167167
### Foundational Publications
168168
The following publications that inspired and provided a foundation for this repository:

docs/LOCAL_SETUP.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,17 @@ Video Demo of package import and usage:
1414
For those contributing or modifying the source, use the following to set up locally.
1515

1616
## Environment Config
17-
You'll need the Python (^3.9) and Poetry configured on your machine. Once those are configured, create a virtual
17+
You'll need Python (^3.11) and `uv` configured on your machine. Once those are configured, create a virtual
1818
environment and install dependencies.
1919

2020
```bash
21-
python3.9 -m venv venv
22-
23-
. venv/bin/activate
24-
25-
pip install --upgrade pip
26-
27-
make install
21+
uv sync
2822
```
2923

3024
Installing dependencies will vary by usage. For those in need of the PII-Codex integration of the MSFT Presidio Analyzer, it is recommended to install the `detections` extras:
3125

3226
```bash
33-
poetry install --extras="detections"
27+
uv sync --extra detections
3428
```
3529

3630
As part of the `detections` extras installation, the download for the `en_core_web_lg` spaCy model will be enabled on first use of the `PresidioPIIAnalyzer()`. If more language support is needed, you'll need to download it separately. Reference <a href="https://github.com/explosion/spacy-models/releases?q=en_core_web_lg&expanded=true">explosion/spacy-models</a>.

0 commit comments

Comments
 (0)