Skip to content

Commit a66bce1

Browse files
committed
chore: migrate to uv for dependency management
Replace `pip`/`setuptools` with `uv` across the entire development and release workflow. Related-Task: INTER-2009
1 parent 12da681 commit a66bce1

17 files changed

Lines changed: 1764 additions & 196 deletions

.github/workflows/check-templates-consistency.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
check-template-consistency:
1111
uses: fingerprintjs/dx-team-toolkit/.github/workflows/check-template-consistency.yml@v1
1212
with:
13-
generate-command: 'python3 -m pip install ruff && bash ./generate.sh'
13+
generate-command: 'pip install uv && uv sync --only-group dev && bash ./generate.sh'

.github/workflows/coverage-diff.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12-
- uses: actions/setup-python@v5
12+
- uses: astral-sh/setup-uv@v5
1313
with:
14+
enable-cache: true
1415
python-version: "3.12"
1516
- name: "Install dependencies"
16-
run: |
17-
python -m pip install --upgrade pip
18-
pip install -r requirements.txt
19-
pip install -r test-requirements.txt
17+
run: uv sync
2018
- name: "Generate coverage"
2119
run: |
22-
coverage run --source=fingerprint_server_sdk -m pytest
23-
coverage xml
20+
uv run coverage run --source=fingerprint_server_sdk -m pytest
21+
uv run coverage xml
2422
- name: Get Cover
2523
uses: orgoro/coverage@3f13a558c5af7376496aa4848bf0224aead366ac
2624
with:

.github/workflows/coverage-report.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- uses: actions/setup-python@v5
15+
- uses: astral-sh/setup-uv@v5
1616
with:
17+
enable-cache: true
1718
python-version: "3.13"
1819
- name: "Install dependencies"
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install -r requirements.txt
22-
pip install -r test-requirements.txt
20+
run: uv sync
2321
- name: "Generate coverage"
2422
run: |
25-
coverage run --source=fingerprint_server_sdk -m pytest
26-
coverage html
27-
coverage json
28-
python ./generate_coverage_summary.py
23+
uv run coverage run --source=fingerprint_server_sdk -m pytest
24+
uv run coverage html
25+
uv run coverage json
26+
uv run python ./generate_coverage_summary.py
2927
rm ./htmlcov/.gitignore
3028
3129
- name: Create Coverage Badges

.github/workflows/functional_tests.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@ jobs:
2626

2727
steps:
2828
- uses: actions/checkout@v4
29-
- uses: actions/setup-python@v5
29+
- uses: astral-sh/setup-uv@v5
3030
with:
31+
enable-cache: true
3132
python-version: ${{ matrix.python-version }}
3233
- name: "Install dependencies"
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install -r requirements.txt
36-
pip install -r test-requirements.txt
34+
run: uv sync
3735

3836
- name: "Try to get data using SDK"
39-
run: "python ./run_checks.py"
37+
run: "uv run python ./run_checks.py"
4038
env:
4139
PRIVATE_KEY: "${{ secrets.PRIVATE_KEY }}"

.github/workflows/lint.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,18 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v4
16-
- uses: actions/setup-python@v5
16+
- uses: astral-sh/setup-uv@v5
1717
with:
18+
enable-cache: true
1819
python-version: "3.11"
1920
- name: "Install dependencies"
20-
run: |
21-
python -m pip install --upgrade pip
22-
pip install -r requirements.txt
23-
pip install -r test-requirements.txt
21+
run: uv sync
2422

2523
- name: "Run Ruff format check"
26-
run: "ruff format --check ."
24+
run: "uv run ruff format --check ."
2725

2826
- name: "Run Ruff linter"
29-
run: "ruff check ."
27+
run: "uv run ruff check ."
3028

3129
- name: "Run MyPy type checker"
32-
run: "mypy fingerprint_server_sdk"
30+
run: "uv run mypy fingerprint_server_sdk"

.github/workflows/publish.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,13 @@ jobs:
3232
with:
3333
ref: ${{ github.event.inputs.tag }}
3434

35-
- name: 'Install Python'
36-
uses: actions/setup-python@v5
35+
- name: 'Install uv'
36+
uses: astral-sh/setup-uv@v5
3737
with:
3838
python-version: '3.12'
3939

4040
- name: 'Build'
41-
run: |
42-
python -m pip install --upgrade pip
43-
pip install -r requirements.txt
44-
pip install wheel
45-
pip install twine
46-
pip install ruff
47-
python setup.py sdist bdist_wheel
41+
run: uv build
4842

4943
- name: Publish package distributions to PyPI
5044
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc

.github/workflows/release.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ jobs:
1717
language: python
1818
language-version: '3.12'
1919
prepare-command: |
20-
python -m pip install --upgrade pip
21-
pip install -r requirements.txt
22-
pip install wheel
23-
pip install twine
24-
pip install ruff
20+
pip install uv
21+
uv sync
2522
secrets:
2623
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
2724
RUNNER_APP_PRIVATE_KEY: ${{ secrets.RUNNER_APP_PRIVATE_KEY }}

.github/workflows/test.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18-
- uses: actions/setup-python@v5
18+
- uses: astral-sh/setup-uv@v5
1919
with:
20+
enable-cache: true
2021
python-version: "${{ matrix.python-version }}"
2122
- name: "Install dependencies"
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install -r requirements.txt
25-
pip install -r test-requirements.txt
23+
run: uv sync
2624

2725
- name: "Run tests for ${{ matrix.python-version }}"
28-
run: "pytest"
26+
run: "uv run pytest"

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.8.6
3+
rev: v0.15.0
44
hooks:
55
- id: ruff-format
66
- id: ruff
77
args: [--fix]
8-
- repo: https://github.com/pre-commit/mirrors-mypy
9-
rev: v1.14.1
8+
- repo: local
109
hooks:
1110
- id: mypy
12-
additional_dependencies:
13-
- pydantic>=2
14-
- types-python-dateutil>=2.8.19.14
11+
name: mypy
12+
entry: uv run mypy
13+
language: system
14+
types: [python]
1515
args: [--config-file=pyproject.toml]

contributing.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ This project uses [Ruff](https://docs.astral.sh/ruff/) for linting and formattin
3434

3535
```bash
3636
# Format code
37-
ruff format .
37+
uv run ruff format .
3838

3939
# Run linter
40-
ruff check --fix .
40+
uv run ruff check --fix .
4141

4242
# Run type checker
43-
mypy fingerprint_server_sdk
43+
uv run mypy fingerprint_server_sdk
4444
```
4545

4646
### Updating templates
@@ -75,24 +75,23 @@ To make requests using the local source code of the SDK:
7575
2. Run the following commands:
7676

7777
```shell
78-
pip install -r requirements.txt
79-
python run_checks.py
78+
uv sync
79+
uv run python run_checks.py
8080
```
8181

8282
#### Test environment
8383

84-
You need to install `python` and `pip`.
84+
You need to install [uv](https://docs.astral.sh/uv/getting-started/installation/).
8585
Then you can run:
8686

8787
```shell
88-
pip install -r requirements.txt
89-
pip install -r test-requirements.txt
88+
uv sync
9089
```
9190

9291
#### Running tests
9392

9493
```shell
95-
pytest
94+
uv run pytest
9695
```
9796

9897
### How to publish

0 commit comments

Comments
 (0)