Skip to content

Commit 62750f8

Browse files
authored
Merge pull request #135 from ImageMarkup/uv
Switch to uv
2 parents 81e510d + 08cdce8 commit 62750f8

File tree

7 files changed

+873
-32
lines changed

7 files changed

+873
-32
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,25 @@ on:
44
push:
55
branches:
66
- master
7+
permissions:
8+
contents: read
79
jobs:
810
test:
911
runs-on: ubuntu-latest
1012
strategy:
1113
matrix:
12-
python-version: ['3.13']
14+
python-version: ["3.13"]
1315
steps:
14-
- uses: actions/checkout@v4
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
1518
with:
19+
# Tags are needed to compute the current version number
20+
fetch-depth: 0
1621
lfs: true
17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v5
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v6
1924
with:
2025
python-version: ${{ matrix.python-version }}
21-
- name: Install tox
22-
run: |
23-
pip install --upgrade pip
24-
pip install tox
2526
- name: Run tests
2627
run: |
27-
tox
28+
uv run tox

.github/workflows/release.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,19 @@ jobs:
77
runs-on: ubuntu-latest
88
environment: release
99
permissions:
10+
contents: read
1011
id-token: write
1112
steps:
12-
- uses: actions/checkout@v4
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
1315
with:
1416
# Tags are needed to compute the current version number
1517
fetch-depth: 0
16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18-
with:
19-
python-version: "3.x"
20-
- name: Install Python build
21-
run: |
22-
pip install --upgrade pip
23-
pip install build
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v6
2420
- name: Build the Python distribution
2521
run: |
26-
python -m build
22+
uv build
2723
- name: Publish the Python distributions to PyPI
28-
uses: pypa/gh-action-pypi-publish@release/v1
24+
run: |
25+
uv publish --trusted-publishing=always

.python-version

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

MANIFEST.in

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

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ Repository = "https://github.com/ImageMarkup/isic-challenge-scoring"
4444
isic-challenge-scoring = "isic_challenge_scoring.__main__:cli"
4545

4646
[dependency-groups]
47+
dev = [
48+
"tox",
49+
"tox-uv",
50+
]
4751
lint = [
4852
"flake8",
4953
"flake8-black",
@@ -60,8 +64,7 @@ format = [
6064
type = [
6165
"mypy",
6266
"pandas-stubs",
63-
"microsoft-python-type-stubs @ git+https://github.com/microsoft/python-type-stubs.git",
64-
{include-group = "test"},
67+
"microsoft-python-type-stubs",
6568
]
6669
test = [
6770
"pytest",
@@ -76,6 +79,9 @@ packages = [
7679
[tool.hatch.version]
7780
source = "vcs"
7881

82+
[tool.uv.sources]
83+
microsoft-python-type-stubs = { git = "https://github.com/microsoft/python-type-stubs.git" }
84+
7985
[tool.black]
8086
line-length = 100
8187
skip-string-normalization = true

tox.ini

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[tox]
22
min_version = 4.22
3+
requires =
4+
tox-uv
35
env_list =
46
lint,
57
type,
68
test,
79

810
[testenv]
9-
# Building and installing wheels is significantly faster
10-
package = wheel
11+
runner = uv-venv-lock-runner
1112

1213
[testenv:lint]
1314
package = skip
@@ -25,10 +26,9 @@ commands =
2526
black .
2627

2728
[testenv:type]
28-
# Editable ensures dependencies are installed, but full packaging isn't necessary
29-
package = editable
3029
dependency_groups =
3130
type
31+
test
3232
commands =
3333
mypy {posargs}
3434

@@ -50,3 +50,5 @@ ignore =
5050
W503,
5151
# Missing docstring in *
5252
D10,
53+
extend-exclude =
54+
.venv,

uv.lock

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

0 commit comments

Comments
 (0)