Skip to content

Commit fa13ae3

Browse files
committed
feat: Migrate to uv.
1 parent 0da47cf commit fa13ae3

46 files changed

Lines changed: 4229 additions & 6270 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,20 @@
77
"ppa": true,
88
"version": "system"
99
},
10-
"ghcr.io/devcontainers-contrib/features/pipenv:2": {
10+
"ghcr.io/devcontainers-extra/features/pipenv:2": {
1111
"version": "latest"
12+
},
13+
"ghcr.io/va-h/devcontainers-features/uv:1": {
14+
"shellautocompletion": true,
15+
"version": "latest"
16+
},
17+
"ghcr.io/devcontainers/features/nvidia-cuda:1": {
18+
"installCudnn": true,
19+
"installCudnnDev": true,
20+
"installNvtx": true,
21+
"installToolkit": true,
22+
"cudaVersion": "12.5",
23+
"cudnnVersion": "9.3.0.75"
1224
}
1325
},
1426

.devcontainer/install.sh

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,47 @@ export DEBIAN_FRONTEND=noninteractive
55
sudo apt update
66
sudo apt install -y libopenblas-dev libyaml-dev ffmpeg wget ca-certificates
77

8-
# Install CUDA and cuDNN if not already installed
9-
if ! command -v nvcc &> /dev/null; then
8+
# # Install CUDA and cuDNN if not already installed
9+
# if ! command -v nvcc &> /dev/null; then
1010

11-
CUDA_VERSION="12.3"
12-
CUDNN_VERSION="8.9.7.29-1+cuda12.2" # Not sure why no 12.3
11+
# CUDA_VERSION="12.3"
12+
# CUDNN_VERSION="8.9.7.29-1+cuda12.2" # Not sure why no 12.3
1313

14-
NVIDIA_REPO_URL="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64"
15-
KEYRING_PACKAGE="cuda-keyring_1.1-1_all.deb"
16-
KEYRING_PACKAGE_URL="$NVIDIA_REPO_URL/$KEYRING_PACKAGE"
17-
KEYRING_PACKAGE_PATH="$(mktemp -d)"
18-
KEYRING_PACKAGE_FILE="$KEYRING_PACKAGE_PATH/$KEYRING_PACKAGE"
19-
wget -O "$KEYRING_PACKAGE_FILE" "$KEYRING_PACKAGE_URL"
20-
sudo apt install -yq "$KEYRING_PACKAGE_FILE"
21-
sudo apt update -yq
14+
# NVIDIA_REPO_URL="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64"
15+
# KEYRING_PACKAGE="cuda-keyring_1.1-1_all.deb"
16+
# KEYRING_PACKAGE_URL="$NVIDIA_REPO_URL/$KEYRING_PACKAGE"
17+
# KEYRING_PACKAGE_PATH="$(mktemp -d)"
18+
# KEYRING_PACKAGE_FILE="$KEYRING_PACKAGE_PATH/$KEYRING_PACKAGE"
19+
# wget -O "$KEYRING_PACKAGE_FILE" "$KEYRING_PACKAGE_URL"
20+
# sudo apt install -yq "$KEYRING_PACKAGE_FILE"
21+
# sudo apt update -yq
2222

23-
# Install CUDA libraries
24-
cuda_pkg="cuda-libraries-${CUDA_VERSION/./-}"
25-
sudo apt install -yq "$cuda_pkg"
23+
# # Install CUDA libraries
24+
# cuda_pkg="cuda-libraries-${CUDA_VERSION/./-}"
25+
# sudo apt install -yq "$cuda_pkg"
2626

27-
# Install cuDNN
28-
cudnn_pkg="libcudnn8=${CUDNN_VERSION}"
29-
sudo apt install -yq "$cudnn_pkg_version"
27+
# # Install cuDNN
28+
# cudnn_pkg="libcudnn8=${CUDNN_VERSION}"
29+
# sudo apt install -yq "$cudnn_pkg_version"
3030

31-
# Install cuDNN dev
32-
cudnn_dev_pkg="libcudnn8-dev=${CUDNN_VERSION}"
33-
sudo apt install -yq "$cudnn_dev_pkg"
31+
# # Install cuDNN dev
32+
# cudnn_dev_pkg="libcudnn8-dev=${CUDNN_VERSION}"
33+
# sudo apt install -yq "$cudnn_dev_pkg"
3434

35-
# Install NVTX
36-
nvtx_pkg="cuda-nvtx-${CUDA_VERSION/./-}"
37-
sudo apt install -yq "$nvtx_pkg"
35+
# # Install NVTX
36+
# nvtx_pkg="cuda-nvtx-${CUDA_VERSION/./-}"
37+
# sudo apt install -yq "$nvtx_pkg"
3838

39-
# Install CUDA Toolkit
40-
toolkit_pkg="cuda-toolkit-${CUDA_VERSION/./-}"
41-
sudo apt install -yq "$toolkit_pkg"
39+
# # Install CUDA Toolkit
40+
# toolkit_pkg="cuda-toolkit-${CUDA_VERSION/./-}"
41+
# sudo apt install -yq "$toolkit_pkg"
4242

43-
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
44-
export LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
43+
# export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
44+
# export LD_LIBRARY_PATH=/usr/local/cuda-${CUDA_VERSION}/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
4545

46-
# Clean up
47-
sudo rm -rf /var/lib/apt/lists/*
48-
fi
49-
50-
# Install poetry
51-
pipx install poetry --pip-args '--no-cache-dir --force-reinstall'
46+
# # Clean up
47+
# sudo rm -rf /var/lib/apt/lists/*
48+
# fi
5249

5350
# Install project dependencies
54-
poetry install
51+
uv sync

.github/workflows/ci.yaml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,27 @@ name: HeartKit CI
22

33
on: [push]
44

5+
env:
6+
PYTHON_VERSION: '3.11'
7+
58
jobs:
69
build:
710

811
runs-on: ubuntu-latest
912

1013
steps:
11-
- uses: actions/checkout@v3
12-
- name: Install poetry
13-
run: pipx install poetry
14-
- uses: actions/setup-python@v4
14+
- name: Checkout 🛎️
15+
uses: actions/checkout@v4
16+
- name: Setup Python 🐍
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: ${{ env.PYTHON_VERSION }}
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
1522
with:
16-
python-version: '3.11'
17-
cache: 'poetry'
18-
- run: poetry install
19-
- run: poetry run task lint
20-
- run: poetry run task test
23+
enable-cache: true
24+
- name: Install dependencies 🔧
25+
run: |
26+
uv sync
27+
uv run ruff check
28+
uv run pytest tests/

.github/workflows/docs.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,21 @@ jobs:
2626

2727
steps:
2828
- name: Checkout 🛎️
29-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
3030
- name: Setup Pages
3131
id: pages
3232
uses: actions/configure-pages@v4
33-
- name: Install Poetry
34-
run: pipx install poetry
35-
- name: Install Python
36-
uses: actions/setup-python@v4
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v5
3735
with:
38-
python-version: '3.11'
39-
cache: 'poetry'
36+
enable-cache: true
4037
- name: Install and Build 🔧
4138
env:
4239
CI: ""
4340
PUBLIC_URL: "${{ steps.pages.outputs.base_url }}/"
4441
run: |
45-
poetry install --no-root --only docs
46-
poetry run mkdocs build
42+
uv sync --only-group docs
43+
uv run mkdocs build
4744
- name: Upload artifact
4845
uses: actions/upload-pages-artifact@v3
4946
with:

.github/workflows/release.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@ jobs:
1616
steps:
1717
- name: Checkout 🛎️
1818
uses: actions/checkout@v4
19-
- name: Install Poetry
20-
run: pipx install poetry
21-
- name: Install Python
22-
uses: actions/setup-python@v5
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
2321
with:
24-
python-version: '3.11'
25-
cache: 'poetry'
22+
enable-cache: true
2623
- name: Install and Build 🔧
2724
run: |
28-
poetry build
25+
uv build
2926
- name: Store the distribution packages
3027
uses: actions/upload-artifact@v4
3128
with:

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ repos:
2020
args: [ --config=pyproject.toml ]
2121
- id: ruff-format
2222
args: [ --config=pyproject.toml ]
23-
- repo: https://github.com/python-poetry/poetry
24-
rev: 1.8.3
25-
hooks:
26-
- id: poetry-check

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ HeartKit is an AI Development Kit (ADK) that enables developers to easily train
2424
## <span class="sk-h2-span">Requirements
2525

2626
* [Python ^3.11+](https://www.python.org)
27-
* [Poetry ^1.6.1+](https://python-poetry.org/docs/#installation)
27+
* [uv ^1.6.1+](https://docs.astral.sh/uv/getting-started/installation/)
2828

2929
The following are also required to compile/flash the binary for the EVB demo:
3030

@@ -47,7 +47,7 @@ Alternatively, you can install the package from source by cloning the repository
4747
```bash
4848
git clone https://github.com/AmbiqAI/heartkit.git
4949
cd heartkit
50-
poetry install
50+
uv sync
5151
```
5252

5353
---

0 commit comments

Comments
 (0)