Skip to content

Commit bb2f3cc

Browse files
committed
build: utilize uv as the package manager
Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
1 parent 602e875 commit bb2f3cc

14 files changed

Lines changed: 317 additions & 317 deletions

File tree

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
poetry.lock -diff linguist-generated
1+
uv.lock -diff linguist-generated

.github/dependabot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ updates:
88
prefix: chore
99
labels: []
1010

11-
- package-ecosystem: pip
11+
- package-ecosystem: uv
1212
directory: /
1313
schedule:
1414
interval: daily

.github/workflows/build.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,20 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v4.2.2
1414

15-
- name: Setup Python
16-
uses: actions/setup-python@v5.6.0
17-
with:
18-
python-version: 3.11
19-
20-
- name: Setup Poetry
21-
uses: threeal/setup-poetry-action@v1.2.0
15+
- name: Setup uv
16+
uses: astral-sh/setup-uv@v6.1.0
2217

2318
- name: Install Dependencies
24-
run: poetry install --with dev
19+
run: uv sync --locked
2520

2621
- name: Check Format
27-
run: poetry run ruff format --diff
22+
run: uv run ruff format --diff
2823

2924
- name: Check Lint
30-
run: poetry run ruff check
25+
run: uv run ruff check
3126

3227
- name: Test Package
33-
run: poetry run pytest -v --cov
28+
run: uv run pytest -v --cov
3429

3530
- name: Build Package
36-
run: poetry build
31+
run: uv build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.*
22
!.git*
3+
!.python-version
34

45
*.egg-info
56
__pycache__

.python-version

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The Python Starter is a [GitHub repository template](https://docs.github.com/en/
55
## Key Features
66

77
- Organized file structure for Python projects, featuring a sample `pyproject.toml`, a sample module, and associated testing files.
8-
- Project and dependency management with [Poetry](https://python-poetry.org/), supplemented by [Poe the Poet](https://poethepoet.natn.io/index.html) for task management.
8+
- Project and dependency management with [uv](https://docs.astral.sh/uv/).
99
- Code formatting and linting with [Ruff](https://github.com/astral-sh/ruff), leveraging all recommended rules for enhanced code quality.
1010
- Testing framework powered by [Pytest](https://docs.pytest.org/en/7.4.x/), complete with support for test coverage checks.
1111
- [GitHub Actions](https://github.com/features/actions) support with multiple workflows for continuous integration (CI) and continuous delivery (CD).

lefthook.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,27 @@ pre-commit:
22
piped: true
33
jobs:
44
- name: install dependencies
5-
run: poetry install --with dev
5+
run: uv sync
66
glob:
7-
- poetry.lock
8-
- poetry.toml
7+
- .python-version
98
- pyproject.toml
9+
- uv.lock
1010

1111
- name: fix formatting
12-
run: poetry run ruff format
13-
glob: "*.py"
12+
run: uv run ruff format
13+
glob:
14+
- "*.py"
15+
- .python-version
16+
- pyproject.toml
17+
- uv.lock
1418

1519
- name: fix lint
16-
run: poetry run ruff check --fix
17-
glob: "*.py"
20+
run: uv run ruff check --fix
21+
glob:
22+
- "*.py"
23+
- .python-version
24+
- pyproject.toml
25+
- uv.lock
1826

1927
- name: check diff
20-
run: git diff --exit-code dist {staged_files}
28+
run: git diff --exit-code {staged_files}

poetry.lock

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

poetry.toml

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

pyproject.toml

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,41 @@
1-
[build-system]
2-
requires = ["poetry-core >= 1.0.0"]
3-
build-backend = "poetry.core.masonry.api"
4-
5-
[tool.poetry]
1+
[project]
62
name = "my_fibonacci"
73
version = "0.0.0"
8-
description = "A starter python module for generating a Fibonacci sequence."
9-
license = "Unlicense"
4+
dependencies = []
5+
requires-python = ">=3.10"
106
authors = [
11-
"Alfi Maulana <alfi.maulana.f@gmail.com>",
7+
{name = "Alfi Maulana", email = "alfi.maulana.f@gmail.com"},
128
]
9+
description = "A starter python module for generating a Fibonacci sequence."
1310
readme = "README.md"
14-
repository = "https://github.com/threeal/python-starter"
11+
license = "Unlicense"
1512
keywords = ["python", "starter", "fibonacci"]
1613
classifiers = [
1714
"Development Status :: 1 - Planning",
1815
"Intended Audience :: Developers",
19-
"License :: OSI Approved :: The Unlicense (Unlicense)",
2016
"Operating System :: OS Independent",
2117
"Programming Language :: Python :: 3 :: Only",
22-
"Topic :: Software Development :: Libraries :: Python Modules"
18+
"Topic :: Software Development :: Libraries :: Python Modules",
2319
]
24-
packages = [
25-
{ include = "my_fibonacci", from = "lib" }
26-
]
27-
28-
[tool.poetry.dependencies]
29-
python = "^3.10"
3020

31-
[tool.poetry.group.dev]
32-
optional = true
21+
[project.scripts]
22+
my_fibonacci = "my_fibonacci.__main__:main"
3323

34-
[tool.poetry.group.dev.dependencies]
35-
lefthook = "^1.11.14"
36-
pytest = "^8.4.0"
37-
pytest-cov = "^6.2.1"
38-
ruff = "^0.11.13"
24+
[project.urls]
25+
repository = "https://github.com/threeal/python-starter.git"
26+
issues = "https://github.com/threeal/python-starter/issues"
3927

40-
[tool.poetry.scripts]
41-
my_fibonacci = "my_fibonacci.__main__:main"
28+
[build-system]
29+
requires = ["hatchling"]
30+
build-backend = "hatchling.build"
31+
32+
[dependency-groups]
33+
dev = [
34+
"lefthook>=1.11.14",
35+
"pytest>=8.4.0",
36+
"pytest-cov>=6.2.1",
37+
"ruff>=0.11.13",
38+
]
4239

4340
[tool.coverage.report]
4441
fail_under = 100

0 commit comments

Comments
 (0)