Skip to content

Commit e7e8792

Browse files
GlassOfWhiskeycolonne
andauthored
Migrate to uv package manager (#198)
This commit configures the project to use the `uv` package manager, a modern, solid, and faster alterative to `pip`. Note that this change only affects the development toolchain: the plugin can still be installed with `pip`. However, now the `bandit`, `lint` and `test` optional dependencies became dependency groups, meaning that the `pip install streamflow-postgresql[lint]` command does not work anymore, and should be substituted with `pip install --group lint` with `pip>=25.1`. Co-authored-by: colonne <colonne@di.unito.it>
1 parent c700c77 commit e7e8792

File tree

10 files changed

+2480
-53
lines changed

10 files changed

+2480
-53
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "daily"
7-
- package-ecosystem: "pip"
7+
- package-ecosystem: "uv"
88
directory: "/"
99
schedule:
1010
interval: "daily"

.github/workflows/ci-tests.yaml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,14 @@ jobs:
3232
TOXENV: ${{ matrix.step }}
3333
steps:
3434
- uses: actions/checkout@v6
35+
- uses: astral-sh/setup-uv@v7
36+
with:
37+
version: "0.9.16"
3538
- uses: actions/setup-python@v6
3639
with:
3740
python-version: "3.13"
38-
cache: pip
39-
cache-dependency-path: |
40-
requirements.txt
41-
test-requirements.txt
42-
tox.ini
43-
- name: "Install Python Dependencies and plugin"
44-
run: |
45-
python -m pip install tox --user
46-
python -m pip install . --user
41+
- name: "Install Tox"
42+
run: uv tool install tox --with tox-uv
4743
- name: "Run static analysis via Tox"
4844
run: tox
4945
unit-tests:
@@ -64,13 +60,12 @@ jobs:
6460
TOXENV: ${{ format('py{0}-unit', matrix.python) }}
6561
steps:
6662
- uses: actions/checkout@v6
63+
- uses: astral-sh/setup-uv@v7
64+
with:
65+
version: "0.9.16"
6766
- uses: actions/setup-python@v6
6867
with:
6968
python-version: ${{ matrix.python }}
70-
cache: pip
71-
cache-dependency-path: |
72-
requirements.txt
73-
tox.ini
7469
- uses: actions/setup-node@v6
7570
with:
7671
node-version: "20"
@@ -93,12 +88,10 @@ jobs:
9388
- name: "Install Postgresql client"
9489
run: brew install libpq@17
9590
if: ${{ startsWith(matrix.on, 'macos-') }}
96-
- name: "Install Python Dependencies and plugin"
97-
run: |
98-
python -m pip install tox --user
99-
python -m pip install . --user
91+
- name: "Install Tox"
92+
run: uv tool install tox --with tox-uv
10093
- name: "Run tests via Tox"
101-
run: python -m tox
94+
run: tox
10295
- name: "Upload coverage report for unit tests"
10396
uses: actions/upload-artifact@v6
10497
with:

MANIFEST.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
include LICENSE
22
include README.md
3-
include requirements.txt
4-
include bandit-requirements.txt
5-
include lint-requirements.txt
6-
include test-requirements.txt

bandit-requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

lint-requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ classifiers = [
2727
"Topic :: Scientific/Engineering",
2828
"Topic :: System :: Distributed Computing",
2929
]
30-
dynamic = ["dependencies", "optional-dependencies", "version"]
30+
dependencies = [
31+
"asyncpg==0.31.0",
32+
"streamflow==0.2.0.dev13"
33+
]
34+
dynamic = ["version"]
35+
3136

3237
[project.urls]
3338
Package = "https://pypi.org/project/streamflow-postgresql"
@@ -36,6 +41,29 @@ Repository = "https://github.com/alpha-unito/streamflow-postgresql"
3641
[project.entry-points]
3742
"unito.streamflow.plugin" = {"unito.postgresql" = "streamflow.plugins.unito.postgresql.plugin:PostgreSQLStreamFlowPlugin"}
3843

44+
[dependency-groups]
45+
dev = [
46+
{include-group = "bandit"},
47+
{include-group = "lint"},
48+
{include-group = "test"}
49+
]
50+
bandit = [
51+
"bandit==1.9.2"
52+
]
53+
lint = [
54+
"black==25.11.0",
55+
"codespell==2.4.1",
56+
"flake8-bugbear==25.11.29",
57+
"isort==6.1.0",
58+
"pyupgrade==3.21.0"
59+
]
60+
test = [
61+
"pytest==9.0.2",
62+
"pytest-asyncio==1.3.0",
63+
"pytest-cov==7.0.0",
64+
"pytest-xdist==3.8.0"
65+
]
66+
3967
[tool.setuptools]
4068
packages = [
4169
"streamflow.plugins.unito.postgresql"
@@ -46,13 +74,7 @@ zip-safe = true
4674
"streamflow.plugins.unito.postgresql" = ["schemas/*.json", "schemas/*.sql"]
4775

4876
[tool.setuptools.dynamic]
49-
dependencies = {file = "requirements.txt"}
5077
version = {attr = "streamflow.plugins.unito.postgresql.version.VERSION"}
5178

52-
[tool.setuptools.dynamic.optional-dependencies]
53-
bandit = {file = "bandit-requirements.txt"}
54-
lint = {file = "lint-requirements.txt"}
55-
test = {file = "test-requirements.txt"}
56-
5779
[tool.isort]
5880
profile = "black"

requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

test-requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

tox.ini

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ testpaths = tests
1313

1414
[testenv]
1515
allowlist_externals = make
16-
commands_pre =
17-
py3.{10,11,12,13}-unit: python -m pip install -U pip setuptools wheel
1816
commands =
1917
py3.{10,11,12,13}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
20-
deps =
21-
py3.{10,11,12,13}-unit: -rrequirements.txt
22-
py3.{10,11,12,13}-unit: -rtest-requirements.txt
18+
dependency_groups =
19+
py3.{10,11,12,13}-unit: test
2320
description =
2421
py3.{10,11,12,13}-unit: Run the unit tests
2522
passenv =
@@ -30,9 +27,7 @@ setenv =
3027

3128
[testenv:bandit]
3229
commands = bandit -r streamflow
33-
deps =
34-
-rrequirements.txt
35-
-rbandit-requirements.txt
30+
dependency_groups = bandit
3631
description = Search for common security issues
3732
passenv =
3833
CI
@@ -41,7 +36,5 @@ passenv =
4136
[testenv:lint]
4237
allowlist_externals = make
4338
commands = make flake8 format-check codespell-check pyupgrade
44-
deps =
45-
-rrequirements.txt
46-
-rlint-requirements.txt
39+
dependency_groups = lint
4740
description = Lint the Python code

0 commit comments

Comments
 (0)