Skip to content

Commit 1483fa0

Browse files
authored
chore: modernize pyproject.toml (#19)
1 parent 8fea807 commit 1483fa0

File tree

8 files changed

+104
-55
lines changed

8 files changed

+104
-55
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
cache: poetry
3333

3434
- name: Install Dependencies using Poetry
35-
run: poetry install
35+
run: poetry install --extras dev
3636

3737
- name: Check code
3838
run: poetry run pre-commit run --all
@@ -58,7 +58,7 @@ jobs:
5858
cache: poetry
5959

6060
- name: Install dependencies
61-
run: poetry install
61+
run: poetry install --extras dev
6262

6363
- name: Run pytest
6464
run: poetry run coverage run -m pytest tests/tests.py

.github/workflows/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
- name: Install Dependencies using Poetry
5050
run: |
51-
poetry install
51+
poetry install --extras dev
5252
5353
- name: Publish to PyPi
5454
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.coverage

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ An easy way to install all required software is to run
99
```bash
1010
conda create -n snakemake-storage-plugin-rucio-dev -c conda-forge python-gfal2 voms poetry
1111
conda activate snakemake-storage-plugin-rucio-dev
12-
poetry install --with=dev
12+
poetry install --extras dev
1313
pre-commit install
1414
```
1515

@@ -29,7 +29,7 @@ pre-commit run --all
2929
The tests can be run with the command:
3030

3131
```bash
32-
pytest tests/tests.py
32+
pytest tests/tests.py --cov
3333
```
3434

3535
If no [`RUCIO_CONFIG`](https://rucio.github.io/documentation/user/configuring_the_client#rucio_config)

poetry.lock

Lines changed: 65 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,49 @@
22
requires = [ "poetry-core",]
33
build-backend = "poetry.core.masonry.api"
44

5-
[tool.poetry]
5+
[project]
66
name = "snakemake-storage-plugin-rucio"
77
version = "0.1.1"
88
description = "A Snakemake storage plugin that handles files available through Rucio."
99
authors = [
10-
"Bouwe Andela <[email protected]>",
11-
"Valentin Pestel <[email protected]>",
10+
{ name = "Bouwe Andela", email = "[email protected]" },
11+
{ name = "Valentin Pestel", email = "[email protected]" },
1212
]
1313
readme = "README.md"
14-
repository = "https://github.com/bouweandela/snakemake-storage-plugin-rucio"
15-
documentation = "https://snakemake.github.io/snakemake-plugin-catalog/plugins/storage/rucio.html"
16-
license = "Apache-2.0"
14+
license = { text = "Apache-2.0" }
15+
requires-python = ">=3.11,<4.0"
1716
keywords = [
1817
"snakemake",
1918
"plugin",
2019
"storage",
2120
"rucio",
2221
]
22+
dependencies = [
23+
"rucio>=36",
24+
"snakemake>=9.5.1",
25+
"snakemake-interface-common>=1.18.0",
26+
"snakemake-interface-storage-plugins>=4.2.1",
27+
]
28+
29+
[project.optional-dependencies]
30+
dev = [
31+
"coverage>=7",
32+
"pre-commit>=4",
33+
"pytest>=8",
34+
"pytest-cov>=6",
35+
]
36+
37+
[project.urls]
38+
repository = "https://github.com/bouweandela/snakemake-storage-plugin-rucio"
39+
documentation = "https://snakemake.github.io/snakemake-plugin-catalog/plugins/storage/rucio.html"
40+
41+
42+
[tool.coverage.run]
43+
source = ["snakemake_storage_plugin_rucio"]
44+
branch = true
2345

24-
[tool.poetry.dependencies]
25-
python = ">=3.11,<4"
26-
snakemake = ">=9.5.1"
27-
snakemake-interface-common = ">=1.18.0"
28-
snakemake-interface-storage-plugins = ">=4.2.1"
29-
rucio = ">=36"
30-
31-
[tool.poetry.group.dev.dependencies]
32-
coverage = ">=7"
33-
pre-commit = ">=4"
34-
pytest = ">=8"
46+
[tool.coverage.report]
47+
show_missing = true
3548

3649
[tool.ruff.lint]
3750
select = ["ALL"]

snakemake_storage_plugin_rucio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ async def inventory(self, cache: IOCacheStorageInterface) -> None:
266266
def _handle(self, cache: IOCacheStorageInterface, files: Sequence[str]) -> None:
267267
"""Add a sequence of files to the cache."""
268268
dids = [{"scope": self.scope, "name": f} for f in files]
269-
for file, meta in zip(files, self.client.get_metadata_bulk(dids)):
269+
for file, meta in zip(files, self.client.get_metadata_bulk(dids), strict=True):
270270
key = self.cache_key(f"{self.scope}/{file}")
271271
cache.mtime[key] = Mtime(storage=meta["updated_at"].timestamp())
272272
cache.size[key] = meta["bytes"]

tests/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
import os
6-
from datetime import datetime, timezone
6+
from datetime import UTC, datetime
77
from pathlib import Path
88

99
import pytest
@@ -70,7 +70,7 @@ class TestStorageWrite(TestStorageRucioBase):
7070

7171
def get_query(self, tmp_path: Path) -> str: # noqa: ARG002
7272
"""Return a query for a new file with a unique name."""
73-
file = f"snakemake-storage-plugin-test-{datetime.now(timezone.utc):%Y%m%dT%H%M%S%f}.txt"
73+
file = f"snakemake-storage-plugin-test-{datetime.now(UTC):%Y%m%dT%H%M%S%f}.txt"
7474
scope = "testing"
7575
return f"rucio://{scope}/{file}"
7676

0 commit comments

Comments
 (0)