Skip to content

Commit f044def

Browse files
authored
build: replace pdm with uv (#212)
## Summary by Sourcery Replace project dependency management from PDM to UV, updating project configuration and build system Enhancements: - Add dynamic version management - Simplify dependency management configuration Build: - Migrate from PDM to Hatchling as the build backend - Update project dependencies to use more specific version constraints CI: - Update GitHub Actions setup to use UV - Add UV pre-commit hooks Chores: - Remove PDM-specific configuration files - Update GitHub Actions and Makefile to use UV instead of PDM
1 parent 291db81 commit f044def

File tree

14 files changed

+2066
-2366
lines changed

14 files changed

+2066
-2366
lines changed

.github/actions/setup-python-environment/action.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@ runs:
1313
- name: Checkout code
1414
uses: actions/checkout@v4
1515

16-
- name: Setup python ${{ inputs.python-version }}
17-
uses: pdm-project/setup-pdm@v3
16+
- name: Set up Python ${{ inputs.python-version }}
17+
uses: astral-sh/setup-uv@v5
1818
with:
19-
python-version: ${{ inputs.python-version }} # Version range or exact version of a Python version to use, the same as actions/setup-python
20-
# architecture: x64 # The target architecture (x86, x64) of the Python interpreter. the same as actions/setup-python
21-
# version: 1.4.0 # The version of PDM to install. Leave it as empty to use the latest version from PyPI
22-
# prerelease: true # Allow prerelease versions to be installed
23-
enable-pep582: true # Enable PEP 582 package loading globally
24-
cache: true
19+
enable-cache: true
20+
python-version: ${{ inputs.python-version }}
2521

2622
- name: Install project and dependencies
2723
shell: bash
28-
run: pdm install
24+
run: uv sync

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
python-version: ['3.10']
1212
task:
13-
- make tox
13+
- make test
1414

1515
steps:
1616
- uses: actions/checkout@v4

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
- name: Run tests
2222
run: |
23-
make tox
23+
make TEST
2424
2525
release:
2626
name: Create release

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,3 @@ sandbox/
148148
!tox.ini
149149
.envrc
150150
__pypackages__
151-
.pdm-python

.pre-commit-config.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
repos:
2+
3+
- repo: https://github.com/astral-sh/uv-pre-commit
4+
rev: 0.6.9
5+
hooks:
6+
# Update the uv lockfile
7+
- id: uv-lock
8+
# Install all packages
9+
- id: uv-sync
10+
args: [--locked, --all-packages]
11+
212
- repo: https://github.com/compilerla/conventional-pre-commit
313
rev: v2.1.1
414
hooks:
@@ -45,9 +55,4 @@ repos:
4555
rev: v2.5.0
4656
hooks:
4757
- id: pretty-format-yaml
48-
args: [--autofix, --indent, '2']
49-
50-
- repo: https://github.com/floatingpurr/sync_with_pdm
51-
rev: 0.3.0
52-
hooks:
53-
- id: sync_with_pdm
58+
args: [--autofix, --indent, '2']

.sourcery.yaml

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

.tool-versions

Lines changed: 0 additions & 1 deletion
This file was deleted.

Makefile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,38 @@
11
.PROJECT = boiling_learning
22
.TESTS_FOLDER = tests
33

4-
.UNIMPORT = $(shell pdm run unimport --remove --gitignore --ignore-init --include-star-import $(.PROJECT) $(.TESTS_FOLDER))
5-
.BLACK = $(shell pdm run black $(.PROJECT) $(.TESTS_FOLDER))
6-
.ISORT = $(shell pdm run isort $(.PROJECT) $(.TESTS_FOLDER))
4+
.UNIMPORT = $(shell uv run unimport --remove --gitignore --ignore-init --include-star-import $(.PROJECT) $(.TESTS_FOLDER))
5+
.BLACK = $(shell uv run black $(.PROJECT) $(.TESTS_FOLDER))
6+
.ISORT = $(shell uv run isort $(.PROJECT) $(.TESTS_FOLDER))
77
.FORMAT = $(foreach command,.UNIMPORT .BLACK .ISORT,$(call $(command)))
88

99
.READD = $(shell git update-index --again)
1010
.CHECK = $(shell pre-commit run)
1111

1212
.PHONY: coverage
1313
coverage:
14-
@pdm run coverage run --source=$(.PROJECT)/ -m pytest $(.TESTS_FOLDER)
15-
@pdm run coverage report -m
14+
@uv run coverage run --source=$(.PROJECT)/ -m pytest $(.TESTS_FOLDER)
15+
@uv run coverage report -m
1616

1717
.PHONY: test
1818
test:
19-
@pdm run pytest --doctest-modules $(.PROJECT) $(.TESTS_FOLDER) -vv
20-
21-
.PHONY: tox
22-
tox:
23-
@pdm run tox
19+
@uv run pytest --doctest-modules $(.PROJECT) $(.TESTS_FOLDER) -vv
2420

2521
.PHONY: check
2622
check:
2723
@$(call $(.CHECK))
2824

2925
.PHONY: typecheck
3026
typecheck:
31-
@pdm run mypy $(.PROJECT)
27+
@uv run mypy $(.PROJECT)
3228

3329
.PHONY: format
3430
format:
3531
@$(call $(.FORMAT))
3632

3733
.PHONY: vulture
3834
vulture:
39-
@pdm run vulture --ignore-decorators @*.dispatch*,@*.instance* --ignore-names __*[!_][!_] $(.PROJECT) main.py
35+
@uv run vulture --ignore-decorators @*.dispatch*,@*.instance* --ignore-names __*[!_][!_] $(.PROJECT) main.py
4036

4137
.PHONY: autofix
4238
autofix:
@@ -54,10 +50,10 @@ release:
5450
# MINOR or PATCH -> PATCH (v0.2.3 -> v0.2.4)
5551
# effectively avoiding incrementing the MAJOR version number while the first
5652
# stable version (v1.0.0) is not released
57-
pdm run cz bump --increment $(shell pdm run cz bump --dry-run | grep -q "MAJOR" && echo "MINOR" || echo "PATCH")
53+
uv run cz bump --increment $(shell uv run cz bump --dry-run | grep -q "MAJOR" && echo "MINOR" || echo "PATCH")
5854
git push
5955
git push --tags
6056

6157
.PHONY: run
6258
run:
63-
pdm run python main.py
59+
uv run python main.py

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
Boiling Learning
33
</h1>
44

5+
[![uv-managed](https://img.shields.io/badge/managed-261230?label=uv&logo=uv&labelColor=gray)](https://github.com/astral-sh/uv)
6+
57
[![Github Actions](https://github.com/commitizen-tools/commitizen/workflows/Python%20package/badge.svg?style=flat-square)](https://github.com/ruancomelli/boiling-learning/actions)
68
[![Sourcery](https://img.shields.io/badge/Sourcery-enabled-brightgreen)](https://sourcery.ai)
79
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
810
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
911
[![SemVer](https://img.shields.io/badge/semver-2.0.0-green)](https://semver.org/spec/v2.0.0.html)
1012
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
11-
[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm.fming.dev)
1213
[![Author: ruancomelli](https://img.shields.io/badge/ruancomelli-blue?style=flat&label=author)](https://github.com/ruancomelli)
1314

1415
<h1 align="center">
@@ -26,8 +27,7 @@ _Image generated by [DALL-E mini](https://www.craiyon.com/) using the prompt "ro
2627

2728
---
2829

29-
About
30-
---
30+
## About
3131

3232
Project developed by [Ruan Comelli](https://github.com/ruancomelli) at [UFSC (Federal University of Santa Catarina)](https://ufsc.br/) in order to obtain a Master's degree in Mechanical Engineering.
3333

@@ -44,8 +44,7 @@ If you are curious about the evolution of this project, take a look at the [chan
4444
</a>
4545
</h1>
4646
47-
Versioning
48-
---
47+
## Versioning
4948

5049
This project uses [ZeroVer](https://0ver.org/), a versioning scheme in which software never leaves major version **0**. This means that breaking changes are expected frequently.
5150

@@ -145,7 +144,6 @@ The release scripts forwards all arguments to [Commitizen's bump command](https:
145144
. ./scripts/release.sh --prerelease [alpha|beta|rc]
146145
``` -->
147146

148-
Upcoming
149-
---
147+
## Upcoming
150148

151149
- Improved README.

boiling_learning/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Deep learning models for phase-change quantification and classification."""
2+
3+
__version__ = "0.39.0"

0 commit comments

Comments
 (0)