Skip to content

Commit 76d438d

Browse files
committed
build: migrate dependency management from poetry to uv
- migrate pyproject metadata to PEP 621 with hatchling backend - replace poetry commands in CI/publish workflows with uv - add uv.lock and remove poetry.lock/poetry.toml
1 parent f1ae04d commit 76d438d

File tree

8 files changed

+1178
-974
lines changed

8 files changed

+1178
-974
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ jobs:
1010
matrix:
1111
python-version: ["3.10", "3.11", "3.12"]
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- name: Set up Python ${{ matrix.python-version }}
15-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
1616
with:
1717
python-version: ${{ matrix.python-version }}
18+
- name: Install uv
19+
run: python -m pip install --upgrade pip uv
1820
- name: Install dependencies
1921
run: |
20-
python -m pip install --upgrade pip
21-
pip install -U pycodestyle poetry
22-
poetry install
22+
uv sync --locked --dev
2323
- name: pycodestyle
24-
run: pycodestyle --max-line-length=200 starred
24+
run: uv run pycodestyle --max-line-length=200 starred
2525
- name: Build test
26-
run: poetry build
26+
run: uv build
2727
- name: test
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
run: |
31-
poetry run starred --username maguowei --token ${GITHUB_TOKEN} --sort
31+
uv run starred --username maguowei --token ${GITHUB_TOKEN} --sort
3232
3333
# - name: Lint with flake8
3434
# run: |

.github/workflows/publish.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ jobs:
99
deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- name: Set up Python
14-
uses: actions/setup-python@v4
14+
uses: actions/setup-python@v5
1515
with:
1616
python-version: '3.x'
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install poetry
17+
- name: Install uv
18+
run: python -m pip install --upgrade pip uv
2119
- name: Build and publish
22-
env:
23-
POETRY_PYPI_TOKEN_PYPI : ${{ secrets.PYPI_TOKEN }}
2420
run: |
25-
poetry publish --build
21+
uv build
22+
uv publish --token "${{ secrets.PYPI_TOKEN }}"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ celerybeat-schedule
8181
# virtualenv
8282
venv/
8383
ENV/
84+
.venv/
85+
.uv-cache/
8486

8587
# Spyder project settings
8688
.spyderproject

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@ click `Run workflow` button
9898
2. Install the master branch version
9999

100100
```bash
101-
$ poetry build
101+
$ uv build
102102
$ pip install dist/starred-${x.x.x}.tar.gz
103103
```
104104
3. Dev & Run
105105
```bash
106-
poetry run starred --help
107-
```
106+
uv sync --dev
107+
uv run starred --help
108+
```

poetry.lock

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

poetry.toml

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

pyproject.toml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
[tool.poetry]
1+
[project]
22
name = "starred"
33
version = "4.3.0"
44
description = "creating your own Awesome List used GitHub stars!"
5-
authors = ["maguowei <imaguowei@gmail.com>"]
6-
homepage = "https://github.com/maguowei/starred"
7-
repository = "https://github.com/maguowei/starred"
8-
documentation = "https://github.com/maguowei/starred"
5+
readme = "README.md"
6+
requires-python = ">=3.10"
7+
license = { text = "MIT" }
8+
authors = [{ name = "maguowei", email = "imaguowei@gmail.com" }]
99
keywords = ["GitHub starred", "starred"]
1010
classifiers = [
1111
"Development Status :: 5 - Production/Stable",
@@ -18,23 +18,31 @@ classifiers = [
1818
"Programming Language :: Python :: 3.11",
1919
"Programming Language :: Python :: 3.12",
2020
]
21-
include = ["README.md"]
22-
readme = "README.md"
23-
license = "MIT"
21+
dependencies = [
22+
"click>=8.1.7",
23+
"requests>=2.31.0",
24+
"github3.py>=4.0.1",
25+
"gql>=3.5.0",
26+
"aiohttp>=3.9.4",
27+
]
2428

25-
[tool.poetry.scripts]
26-
starred = "starred.starred:starred"
29+
[project.urls]
30+
Homepage = "https://github.com/maguowei/starred"
31+
Repository = "https://github.com/maguowei/starred"
32+
Documentation = "https://github.com/maguowei/starred"
2733

28-
[tool.poetry.dependencies]
29-
python = "^3.10"
30-
click = "^8.1.7"
31-
"requests" = "^2.31.0"
32-
"github3.py" = "^4.0.1"
33-
gql = "^3.5.0"
34-
aiohttp = "^3.9.4"
34+
[project.scripts]
35+
starred = "starred.starred:starred"
3536

36-
[tool.poetry.dev-dependencies]
37+
[dependency-groups]
38+
dev = ["pycodestyle>=2.12.1"]
3739

3840
[build-system]
39-
requires = ["poetry-core>=1.0.0", "setuptools"]
40-
build-backend = "poetry.core.masonry.api"
41+
requires = ["hatchling>=1.27.0"]
42+
build-backend = "hatchling.build"
43+
44+
[tool.hatch.build.targets.wheel]
45+
packages = ["starred"]
46+
47+
[tool.hatch.build.targets.sdist]
48+
exclude = [".venv", ".uv-cache"]

uv.lock

Lines changed: 1130 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)