Skip to content

Commit 2244465

Browse files
committed
chore: update CI for uv
1 parent 2ded7d4 commit 2244465

3 files changed

Lines changed: 31 additions & 59 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,15 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Check out repository
11-
uses: actions/checkout@v4
11+
uses: actions/checkout@v6
1212

13-
- name: Set up Python
14-
id: setup-python
15-
uses: actions/setup-python@v5
16-
with:
17-
python-version: 3.12
18-
19-
- name: Load cached Poetry installation
20-
id: cached-poetry
21-
uses: actions/cache@v3
22-
with:
23-
path: ~/.local
24-
key: poetry-0
25-
26-
- name: Install Poetry
27-
if: steps.cached-poetry.outputs.cache-hit != 'true'
28-
uses: snok/install-poetry@v1
29-
with:
30-
virtualenvs-create: true
31-
virtualenvs-in-project: true
32-
installer-parallel: true
13+
- name: Install uv
14+
uses: astral-sh/setup-uv@v7
3315

34-
- name: Load cached venv
35-
id: cached-poetry-dependencies
36-
uses: actions/cache@v3
37-
with:
38-
path: .venv
39-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
40-
41-
- name: Install dependencies if cache does not exist
42-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
43-
run: poetry install --no-interaction --no-root
44-
45-
- name: Install library
46-
run: poetry install --no-interaction
16+
- name: Set up Python
17+
run: uv python install
4718

48-
- name: Run tests
19+
- name: Run linter and tests
4920
run: |
50-
source .venv/bin/activate
51-
black . --check
52-
pytest tests/ --cov=virustotal_python
21+
uv run black . --check
22+
uv run pytest tests/ --cov=virustotal_python

.github/workflows/publish.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,26 @@ on:
55
- "*.*.*"
66

77
jobs:
8-
Publish:
8+
publish:
99
if: github.repository == 'dbrennand/virustotal-python' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
1010
runs-on: ubuntu-latest
11+
environment:
12+
name: publish
13+
permissions:
14+
id-token: write
15+
contents: read
1116
steps:
12-
- name: Check out repository
13-
uses: actions/checkout@v4
17+
- name: Checkout
18+
uses: actions/checkout@v6
1419

15-
- name: Set up Python
16-
uses: actions/setup-python@v5
17-
with:
18-
python-version: 3.12
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v7
1922

20-
- name: Load cached Poetry installation
21-
id: cached-poetry
22-
uses: actions/cache@v3
23-
with:
24-
path: ~/.local
25-
key: poetry-0
23+
- name: Install Python
24+
run: uv python install
2625

27-
- name: Install Poetry
28-
if: steps.cached-poetry.outputs.cache-hit != 'true'
29-
uses: snok/install-poetry@v1
26+
- name: Build
27+
run: uv build
3028

31-
- name: Configure Poetry
32-
run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}"
33-
34-
- name: Publish virustotal-python
35-
run: poetry publish --build
29+
- name: Publish
30+
run: uv publish

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 1.1.1
4+
5+
* chore(deps): Update all dependencies.
6+
* chore: update license year.
7+
* chore: ci maintenance.
8+
* chore: migrate to uv instead of poetry.
9+
310
## 1.1.0
411

512
* chore(deps): Update all dependencies.

0 commit comments

Comments
 (0)