Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace poetry by uv #83

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,17 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install poetry
run: pip install poetry

- name: Setup python (with pip)
uses: actions/setup-python@v5
- name: Define a cache dependency glob
uses: astral-sh/setup-uv@v5
with:
cache: "poetry"
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Install dependencies
run: poetry install
- name: Install the project
run: uv sync --all-extras

- name: Run tests
run: poetry run pytest --cov-report xml:coverage.xml --cov=t4_devkit
run: uv run pytest --cov-report xml:coverage.xml --cov=t4_devkit

- name: Get test coverage
uses: orgoro/[email protected]
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/deploy-document.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install poetry
- uses: actions/setup-python@v5

- name: Define a cache dependency glob
uses: astral-sh/setup-uv@v5
with:
cache: "poetry"
python-version: "3.10"
- run: poetry install
- run: poetry run mkdocs gh-deploy --force
enable-cache: true

- name: Install the project
run: uv sync --all-extras

- name: Create the document
run: uv run mkdocs gh-deploy --force
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,8 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# uv
uv.lock

# Editor configurations
.vscode
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,27 @@ A toolkit to load and operate T4 dataset.

#### Install via GitHub

Note that the following command installs the latest `main` branch:

```shell
# e.g) with pip
pip install git+https://github.com/tier4/t4-devkit.git
```

By specifying `@<TAG_OR_BRANCH>`, you can install the particular version of `t4-devkit`:

```shell
# e.g) with poetry
poetry add git+https://github.com/tier4/t4-devkit.git
# e.g) with pip
pip install git+https://github.com/tier4/t4-devkit.git@main
```

#### Install from source

```shell
git clone [email protected]:tier4/t4-devkit.git
cd t4-devkit
poetry install
uv venv --python 3.10
uv sync --all-extras
```

## Dataset Format
Expand Down
16 changes: 13 additions & 3 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
## Install via GitHub

Note that the following command installs the latest `main` branch:

```shell
# e.g) with pip
pip install git+https://github.com/tier4/t4-devkit.git
```

By specifying `@<TAG_OR_BRANCH>`, you can install the particular version of `t4-devkit`:

```shell
# e.g) with poetry
poetry add git+https://github.com/tier4/t4-devkit.git
# e.g) with pip
pip install git+https://github.com/tier4/t4-devkit.git@main
```

## Install from source

```shell
git clone [email protected]:tier4/t4-devkit.git
cd t4-devkit
poetry install
uv venv --python 3.10
uv sync --all-extras
```
1,819 changes: 0 additions & 1,819 deletions poetry.lock

This file was deleted.

47 changes: 22 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
[tool.poetry]
[project]
name = "t4-devkit"
version = "0.0.7"
description = "A toolkit to load and operate T4 dataset."
authors = ["Kotaro Uetake <[email protected]>"]
authors = [{ name = "Kotaro Uetake", email = "[email protected]" }]
readme = "README.md"
packages = [{ include = "t4_devkit" }]
requires-python = ">=3.10,<3.13"
dependencies = [
"rerun-sdk==0.20.0",
"pyquaternion>=0.9.9",
"matplotlib>=3.9.2",
"shapely<2.0.0",
"pycocotools>=2.0.8",
]

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
rerun-sdk = "0.20.0"
pyquaternion = "^0.9.9"
matplotlib = "^3.9.2"
shapely = "<2.0.0"
pycocotools = "^2.0.8"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2.2"
pytest-asyncio = "^0.23.7"
pytest-mock = "^3.14.0"
pytest-cov = "^6.0.0"
lark = "^1.1.9"
mkdocs = "^1.6.0"
mkdocstrings = { extras = ["python"], version = "^0.25.1" }
mkdocs-material = "^9.5.27"
ruff = "^0.6.8"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[project.optional-dependencies]
dev = [
"pytest>=8.2.2",
"pytest-asyncio>=0.23.7",
"pytest-mock>=3.14.0",
"pytest-cov>=6.0.0",
"lark>=1.1.9",
"mkdocs>=1.6.0",
"mkdocs-material>=9.5.47",
"mkdocstrings[python]>=0.18",
"ruff>=0.8",
]

[tool.ruff]
line-length = 100
Expand Down
Loading