Skip to content

Commit e75d548

Browse files
author
spencer@primus
committed
Migrate to UV
1 parent d6ac6cf commit e75d548

23 files changed

Lines changed: 2758 additions & 7028 deletions
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish a release to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
env:
9+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
10+
11+
jobs:
12+
# the tests must pass before release is to be made
13+
test:
14+
name: Run unit tests on a branch
15+
uses: avstack-lab/workflows/.github/workflows/test_on_branch_with_uv.yml@main
16+
with:
17+
branch: $BRANCH_NAME
18+
os: ubuntu-22.04
19+
python-versions: "[ '3.10' ]"
20+
uv-versions: "[ '0.6.14' ]"
21+
22+
# now we run the publishing protocol
23+
publish:
24+
name: Run publishing protocol
25+
needs: test
26+
uses: avstack-lab/workflows/.github/workflows/publish_to_index.yml@main
27+
with:
28+
os: ubuntu-22.04
29+
python-version: "3.10"
30+
uv-version: "0.6.14"
31+
index: "pypi"
32+
secrets:
33+
token: ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish a release to TestPyPI
2+
3+
on:
4+
push:
5+
branches: [ test-release ]
6+
7+
env:
8+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
9+
10+
jobs:
11+
# the tests must pass before release is to be made
12+
test:
13+
name: Run unit tests on a branch
14+
uses: avstack-lab/workflows/.github/workflows/test_on_branch_with_uv.yml@main
15+
with:
16+
branch: $BRANCH_NAME
17+
os: ubuntu-22.04
18+
python-versions: "[ '3.10' ]"
19+
uv-versions: "[ '0.6.14' ]"
20+
21+
# now we run the publishing protocol
22+
publish:
23+
name: Run publishing protocol
24+
needs: test
25+
uses: avstack-lab/workflows/.github/workflows/publish_to_index.yml@main
26+
with:
27+
os: ubuntu-22.04
28+
python-version: "3.10"
29+
uv-version: "0.6.14"
30+
index: "testpypi"
31+
secrets:
32+
token: ${{ secrets.TESTPYPI_API_TOKEN }}

.github/workflows/unit_test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Run tests on a branch when pushed or PR'd
2+
3+
env:
4+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
5+
6+
on:
7+
push:
8+
branches: [ main, workflows ]
9+
pull_request:
10+
branches: [ main, workflows ]
11+
12+
jobs:
13+
call_tester:
14+
name: Run unit tests on a branch
15+
uses: avstack-lab/workflows/.github/workflows/test_on_branch_with_uv.yml@main
16+
with:
17+
branch: $BRANCH_NAME
18+
os: ubuntu-22.04
19+
python-versions: "[ '3.10' ]"

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ do so.
3737

3838

3939
[kitto]: https://github.com/kittiframework/kitto
40-
[issue-tracker]: https://github.com/avstack-lab/lib-avstack-api/issues
40+
[issue-tracker]: https://github.com/avstack-lab/avstack-api/issues
4141
[fork-how]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request
4242
[git-style-guide]: https://github.com/agis-/git-style-guide
4343
[using-pull-requests]: https://help.github.com/articles/using-pull-requests

Makefile

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
NAME := avapi
22
INSTALL_STAMP := .install.stamp
3-
POETRY := $(shell command -v poetry 2> /dev/null)
3+
UV := $(shell command -v uv 2> /dev/null)
44
PYFOLDERS := avapi tests
55
.DEFAULT_GOAL := help
66

@@ -17,10 +17,9 @@ help:
1717
@echo "Check the Makefile to know exactly what each target is doing."
1818

1919
install: $(INSTALL_STAMP)
20-
$(INSTALL_STAMP): pyproject.toml poetry.lock
21-
@if [ -z $(POETRY) ]; then echo "Poetry could not be found. See https://python-poetry.org/docs/"; exit 2; fi
22-
# $(POETRY) install --all-extras
23-
$(POETRY) install
20+
$(INSTALL_STAMP): pyproject.toml uv.lock
21+
@if [ -z $(UV) ]; then echo "uv could not be found. See https://docs.astral.sh/uv/"; exit 2; fi
22+
# $(UV) sync --all-extras
2423
touch $(INSTALL_STAMP)
2524

2625
.PHONY: clean
@@ -30,18 +29,18 @@ clean:
3029

3130
.PHONY: lint
3231
lint: $(INSTALL_STAMP)
33-
$(POETRY) run isort --profile=black --lines-after-imports=2 --check-only $(PYFOLDERS)
34-
$(POETRY) run black --check $(PYFOLDERS) --diff
35-
$(POETRY) run flake8 --ignore=W503,E501 $(PYFOLDERS)
36-
$(POETRY) run mypy $(PYFOLDERS) --ignore-missing-imports
37-
$(POETRY) run bandit -r $(NAME) -s B608
32+
$(UV) run isort --profile=black --lines-after-imports=2 --check-only $(PYFOLDERS)
33+
$(UV) run black --check $(PYFOLDERS) --diff
34+
$(UV) run flake8 --ignore=W503,E501 $(PYFOLDERS)
35+
$(UV) run mypy $(PYFOLDERS) --ignore-missing-imports
36+
$(UV) run bandit -r $(NAME) -s B608
3837

3938
.PHONY: format
4039
format: $(INSTALL_STAMP)
41-
$(POETRY) run autoflake --remove-all-unused-imports -i -r $(PYFOLDERS) --exclude=__init__.py
42-
$(POETRY) run isort --profile=black --lines-after-imports=2 $(PYFOLDERS)
43-
$(POETRY) run black $(PYFOLDERS)
40+
$(UV) run autoflake --remove-all-unused-imports -i -r $(PYFOLDERS) --exclude=__init__.py
41+
$(UV) run isort --profile=black --lines-after-imports=2 $(PYFOLDERS)
42+
$(UV) run black $(PYFOLDERS)
4443

4544
.PHONY: test
4645
test: $(INSTALL_STAMP)
47-
$(POETRY) run pytest ./tests/ --cov-report term-missing --cov-fail-under 0 --cov $(NAME)
46+
$(UV) run pytest ./tests/ --cov-report term-missing --cov-fail-under 0 --cov $(NAME)

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ See [`avstack-core`][avstack-core]
1212

1313
First, clone the repositry and submodules.
1414
```
15-
git clone --recurse-submodules https://github.com/avstack-lab/lib-avstack-api.git
15+
git clone --recurse-submodules https://github.com/avstack-lab/avstack-api.git
1616
```
1717
Dependencies are managed with [`poetry`][poetry]. This uses the `pyproject.toml` file to create a `poetry.lock` file.
1818

1919
You must already have downloaded [`avstack-core`][avstack-core] and placed it in a location commensurate with this repository's `pyproject.toml` file. For example, if `pyproject.toml` says
2020
```
21-
lib-avstack-core = { path = "../lib-avstack-core", develop = true }
21+
avstack-core = { path = "../avstack-core", develop = true }
2222
```
23-
then `lib-avstack-core` must be placed in the same folder as `lib-avstack-api`.
23+
then `avstack-core` must be placed in the same folder as `avstack-api`.
2424

2525
### Datasets
2626

27-
See [the dataset README file](https://github.com/avstack-lab/lib-avstack-api/data/README.md)
27+
See [the dataset README file](https://github.com/avstack-lab/avstack-api/data/README.md)
2828

2929
### Simulators
3030

@@ -50,7 +50,7 @@ in the project root, you can use our pre-made pre-commit hook.
5050

5151
# Contributing
5252

53-
See [CONTRIBUTING.md](https://github.com/avstack-lab/lib-avstack-core/CONTRIBUTING.md) for further details.
53+
See [CONTRIBUTING.md](https://github.com/avstack-lab/avstack-core/CONTRIBUTING.md) for further details.
5454

5555
# LICENSE
5656

@@ -60,6 +60,6 @@ AVstack specific code is distributed under the MIT License.
6060

6161

6262
[poetry]: https://github.com/python-poetry/poetry
63-
[avstack-core]: https://github.com/avstack-lab/lib-avstack-core
63+
[avstack-core]: https://github.com/avstack-lab/avstack-core
6464
[avstack-preprint]: https://arxiv.org/pdf/2212.13857.pdf
6565
[carla-sandbox]: https://github.com/avstack-lab/carla-sandbox

avapi/__init__.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +0,0 @@
1-
import avapi.carla
2-
import avapi.evaluation
3-
import avapi.kitti
4-
import avapi.mot15
5-
import avapi.nuimages
6-
import avapi.nuscenes
7-
import avapi.opv2v
8-
import avapi.ugv
9-
import avapi.visualize
10-
11-
12-
def get_scene_manager(dataset, data_dir, split, verbose=False):
13-
ds = dataset.lower()
14-
if ds == "mot15":
15-
SM = avapi.mot15.MOT15SceneManager
16-
elif ds == "kitti":
17-
SM = avapi.kitti.KittiScenesManager
18-
elif ds == "nuscenes":
19-
SM = avapi.nuscenes.nuScenesManager
20-
elif ds == "carla":
21-
SM = avapi.carla.CarlaScenesManager
22-
else:
23-
raise NotImplementedError
24-
return SM(data_dir, split, verbose=verbose)

avapi/evaluation/__init__.py

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

0 commit comments

Comments
 (0)