Skip to content

Commit 670ae77

Browse files
committed
feat: setup uv as dependency manager
1 parent 1726372 commit 670ae77

File tree

3 files changed

+162
-127
lines changed

3 files changed

+162
-127
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,28 @@ jobs:
2323
submodules: 'recursive'
2424
token: ${{ secrets.CI_PAT }}
2525

26-
- name: Setup Python
27-
uses: actions/setup-python@v4
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v5
2828
with:
29-
python-version: ${{ env.PYTHON_VERSION }}
29+
# Install a specific version of uv.
30+
version: "0.5.26"
3031

31-
- name: Install and configure Poetry
32-
uses: snok/install-poetry@v1
32+
- name: "Set up Python"
33+
uses: actions/setup-python@v5
3334
with:
34-
version: 1.6.1
35-
installer-parallel: true
35+
python-version-file: "pyproject.toml"
3636

37-
# Necessary to pull in dependencies specified as github repositories.
38-
- name: Authenticate with github.com
39-
run: |
40-
git config --global credential.helper store
41-
git config --global --add "url.https://github.com/.insteadOf" "git@github.com:"
42-
echo "${{ secrets.CI_GIT_CREDENTIALS }}" >> ~/.git-credentials
43-
44-
# # Necessary to pull in dependencies from our private Python repository.
45-
- name: Authenticate poetry with cloudsmith.com
46-
run: poetry config -- http-basic.rocsys token "${{ secrets.CLOUDSMITH_PYTHON_TOKEN }}"
47-
48-
- name: Install dependencies
49-
run: poetry install
50-
51-
- name: Lint and format
52-
run: poetry run flake8
53-
# continue-on-error: true
37+
- name: Install the project
38+
run: uv sync --all-extras --dev
39+
40+
- name: Run tests
41+
# For example, using `pytest`
42+
run: uv run pytest tests
5443

55-
- name: Type Checking
56-
run: poetry run mypy .
57-
# continue-on-error: true
44+
- name: Run linters
45+
# For example, using `flake8`
46+
run: uv run ruff check
5847

59-
- name: Run tests
60-
run: poetry run pytest
61-
48+
- name: Run type check
49+
# For example, using `mypy`
50+
run: uv run mypy src

pyproject.toml

Lines changed: 30 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,35 @@
1-
[tool.poetry]
2-
name = "research-ktree"
3-
version = "0.3.4"
4-
description = "Research python kinematic library"
5-
authors = ["Daniel Lemus <dlemus@rocsys.com>"]
1+
[project]
2+
name = "ktree"
3+
version = "0.1.0"
4+
description = "Add your description here"
65
readme = "README.md"
7-
packages = [{include = "ktree", from = "src"}]
8-
9-
[tool.poetry.dependencies]
10-
python = ">=3.10,<3.11"
11-
numpy = "^1.25.0"
12-
pyyaml = "^6.0.1"
13-
loguru = "^0.7.0"
14-
types-pyyaml = "^6.0.12.11"
15-
pydantic = "^2.3.0"
16-
ipython = "^8.14.0"
17-
networkx = "^3.1"
18-
19-
[[tool.poetry.source]]
20-
name = "rocsys"
21-
url = "https://dl.cloudsmith.io/basic/rocsys/python/python/simple/"
22-
priority = 'explicit'
23-
24-
25-
[tool.poetry.group.lint.dependencies]
26-
flake8 = "^6.1.0"
27-
flake8-isort = "^6.0.0"
28-
flake8-black = "^0.3.6"
29-
black = "^23.7.0"
30-
isort = "^5.12.0"
31-
mypy = "^1.5.0"
32-
33-
[tool.poetry.group.test.dependencies]
34-
pytest = "^7.4.0"
35-
scipy = "^1.11.3"
36-
pytest-loguru = "^0.3.0"
37-
38-
39-
[tool.poetry.group.debug.dependencies]
40-
debugpy = "^1.6.7.post1"
6+
authors = [
7+
{ name = "Daniel Lemus Perez", email = "dslemusp@gmail.com" }
8+
]
9+
requires-python = ">=3.12"
10+
dependencies = [
11+
"loguru>=0.7.3",
12+
"networkx>=3.4.2",
13+
"numpy>=2.2.2",
14+
"pydantic>=2.10.6",
15+
"pyyaml>=6.0.2",
16+
]
4117

4218
[build-system]
43-
requires = ["poetry-core"]
44-
build-backend = "poetry.core.masonry.api"
45-
46-
[tool.isort]
47-
profile = "black"
48-
# https://github.com/PyCQA/isort/issues/457
49-
no_sections = true
50-
51-
[tool.black]
52-
line-length = 120
53-
preview = true
19+
requires = ["hatchling"]
20+
build-backend = "hatchling.build"
21+
22+
[dependency-groups]
23+
lint = [
24+
"mypy>=1.14.1",
25+
"ruff>=0.9.4",
26+
"types-pyyaml>=6.0.12.20241230",
27+
]
28+
test = [
29+
"pytest>=8.3.4",
30+
"pytest-loguru>=0.4.0",
31+
"scipy>=1.15.1",
32+
]
5433

5534
[tool.mypy]
5635
plugins = [
@@ -68,4 +47,4 @@ files = [
6847
]
6948

7049
[tool.pytest.ini_options]
71-
pythonpath = ["src"]
50+
pythonpath = ["src"]

0 commit comments

Comments
 (0)