Skip to content

Commit f5800cf

Browse files
committed
🔙 Back to using PDM.
Improved the github actions.
1 parent 07ae1a3 commit f5800cf

File tree

4 files changed

+231
-31
lines changed

4 files changed

+231
-31
lines changed

.github/workflows/format.yaml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: Format
22
on: [push]
33
jobs:
4-
format-check:
4+
format-cpp:
5+
defaults:
6+
run:
7+
working-directory: ./cpp/
58
name: 📀 Formatting
69
runs-on: ubuntu-latest
710
steps:
@@ -17,25 +20,42 @@ jobs:
1720
extensions: h,c,hpp,cpp
1821
clangFormatVersion: 17
1922

20-
# Python part
21-
- name: 🏗️ python 3.11
23+
formta-py:
24+
defaults:
25+
run:
26+
working-directory: ./python
27+
name: 📀 Formatting
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: 🔔 Check out
31+
uses: actions/checkout@v3
32+
33+
- name: 🏗️ python
2234
uses: actions/setup-python@v4
2335
with:
24-
python-version: "3.11"
36+
python-version: "3.12"
2537

26-
- name: ⬇️ Python Poetry
27-
uses: snok/install-poetry@v1
38+
- name: ⬇️ Python PDM
39+
uses: pdm-project/setup-pdm@v4
2840
with:
29-
version: 1.8.4
30-
installer-parallel: true
41+
cache: true
3142

3243
- name: ⬇️ Python Dependencies
33-
run: poetry install
34-
working-directory: ./python
44+
run: pdm sync -G:all
45+
46+
- name: 🚂 Activate environment
47+
run: echo "$(pdm venv --path in-project)/bin" >> $GITHUB_PATH
3548

3649
- name: 🏃 autoflake, isort, black
37-
working-directory: ./python
50+
run: autoflake --check .
51+
52+
- name: 🏃 isort
53+
run: isort --check .
54+
55+
- name: 🏃 black
56+
run: black --diff .
57+
58+
- name: 🏃 mypy
3859
run: |
39-
poetry run autoflake --check .
40-
poetry run isort --check .
41-
poetry run black --check .
60+
mypy --install-types --non-interactive .
61+
mypy .

python/pdm.lock

Lines changed: 176 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/poetry.toml

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

python/pyproject.toml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
[tool.poetry]
1+
[project]
22
name = "snippets"
3-
version = "0.0.0"
43
description = "Python scripts"
5-
authors = ["RenChu Wang <[email protected]>"]
6-
license = "MIT"
4+
authors = [
5+
{name = "RenChu Wang",email = "[email protected]"}
6+
]
7+
license = {text = "MIT"}
78
readme = "README.md"
8-
package-mode = false
9+
dynamic = ["version"]
10+
requires-python = ">=3.13"
911

10-
[tool.poetry.dependencies]
11-
python = "^3.11"
12+
[build-system]
13+
requires = ["setuptools", "wheel", "setuptools-scm"]
14+
build-backend = "setuptools.build_meta"
1215

13-
[tool.poetry.group.dev.dependencies]
14-
black = "^24.10.0"
15-
isort = "^5.13.2"
16-
autoflake = "^2.3.1"
17-
mypy = "^1.13.0"
16+
[tool.setuptools_scm]
1817

19-
[build-system]
20-
requires = ["poetry-core"]
21-
build-backend = "poetry.core.masonry.api"
18+
[tool.pdm]
19+
distribution = false
20+
21+
[dependency-groups]
22+
dev = [
23+
"autoflake>=2.3.1",
24+
"black>=25.1.0",
25+
"isort>=6.0.1",
26+
"mypy>=1.16.0",
27+
]
2228

2329
[tool.autoflake]
2430
in-place = true

0 commit comments

Comments
 (0)