Skip to content

Commit 358a414

Browse files
authored
switch to uv from poetry (#24)
1 parent c72c4cf commit 358a414

File tree

7 files changed

+307
-367
lines changed

7 files changed

+307
-367
lines changed

.github/workflows/release.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,21 @@ jobs:
1919

2020
- name: Install GTK deps
2121
run: |
22-
sudo apt install libgirepository1.0-dev gcc libgtk-4-dev -y
22+
sudo apt install libgirepository1.0-dev libcairo2-dev gcc libgtk-4-dev -y
2323
24-
- name: Install Poetry and Deps
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install poetry && poetry --version
28-
poetry install --with dev
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v4
26+
with:
27+
enable-cache: true
28+
cache-dependency-glob: "uv.lock"
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install the dependencies
32+
run: uv sync --all-extras --dev
2933

3034
- name: Run Pyinstaller
3135
run: |
32-
poetry run pyinstaller keyboard.spec
36+
uv run pyinstaller keyboard.spec
3337
version=$(ldd --version | head -n 1 | awk '{print $NF}')
3438
pyversion=$(python --version 2>&1 | awk '{print $2}')
3539
mv ./dist/keyboard ./dist/virtual-keyboard-py$pyversion-glib$version-x86_64

.github/workflows/tests.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,23 @@ jobs:
2323

2424
- name: Install GTK deps
2525
run: |
26-
sudo apt install libgirepository1.0-dev -y
26+
sudo apt install libgirepository-1.0-dev libcairo2-dev -y
2727
28-
- name: Install Poetry and Deps
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install poetry && poetry --version
32-
poetry install --with dev
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v4
30+
with:
31+
enable-cache: true
32+
cache-dependency-glob: "uv.lock"
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Install the dependencies
36+
run: uv sync --all-extras --dev
3337

3438
- name: Ruff Format/Lint
3539
run: |
36-
poetry run ruff format --check
37-
poetry run ruff check
40+
uv run ruff format --check
41+
uv run ruff check
3842
3943
- name: Run Pytest
4044
run: |
41-
poetry run coverage run -m pytest -v && poetry run coverage report -m
45+
uv run coverage run -m pytest -v && uv run coverage report -m

.python-version

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

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,18 @@ I have been inspired by [this website](https://www.branah.com/) in my trilingual
1616
- GTK (>=4) download [here](https://gnome.pages.gitlab.gnome.org/pygobject/getting_started.html)
1717
- Sarabun font download [here](https://fonts.google.com/specimen/Sarabun)
1818

19-
Note: please don't do global system installation of python dependencies through pip, poetry can install it safely for you
20-
2119
Run with python
2220

2321
```shell
24-
poetry shell && poetry install
22+
uv sync
2523
python ./keyboard.py
2624
```
2725

2826
Or roll your own binary
2927

3028
```shell
31-
poetry shell && poetry install --with dev
32-
poetry run pyinstaller keyboard.spec
29+
uv sync --all-extras --dev
30+
uv run pyinstaller keyboard.spec
3331
./dist/keyboard
3432
```
3533

@@ -64,3 +62,7 @@ No, please use up-to-date software
6462
- [X] Add sub-menu to pick target languages
6563
- [X] Key Event presses follows target language mapping
6664
- [X] Port it to GTK 4
65+
66+
### References
67+
68+
- [PyGObject Docs](https://amolenaar.pages.gitlab.gnome.org/pygobject-docs/index.html)

poetry.lock

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

pyproject.toml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
1-
[tool.poetry]
1+
[project]
22
name = "virtual-keyboard"
3-
version = "0.0.1"
3+
version = "0.0.5"
44
description = "on-screen keyboard to help typing faster internationally"
55
authors = ["F. Talha Altinel <[email protected]>"]
66
license = "MIT"
77
readme = "README.md"
8+
requires-python = ">=3.12"
9+
dependencies = [
10+
"pygobject>=3.50.0",
11+
]
812

9-
[tool.poetry.dependencies]
10-
python = ">=3.11,<3.13"
11-
PyGObject = "^3.46.0"
13+
[dependency-groups]
14+
dev = [
15+
"coverage>=7.6.9",
16+
"pygobject-stubs>=2.12.0",
17+
"pyinstaller>=6.11.1",
18+
"pytest>=8.3.4",
19+
"ruff>=0.8.4",
20+
]
1221

1322
[tool.ruff]
1423
line-length = 180
1524

1625
[tool.ruff.lint]
1726
ignore = ["E402"]
18-
19-
20-
[tool.poetry.group.dev.dependencies]
21-
pygobject-stubs = "^2.10.0"
22-
pytest = "^8.2.0"
23-
coverage = "^7.5.3"
24-
ruff = "^0.4.8"
25-
pyinstaller = "^6.7.0"
26-
27-
[build-system]
28-
requires = ["poetry-core"]
29-
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)