Skip to content

Commit b0179af

Browse files
authored
Add warning for Python v3.14 (#348)
This PR adds warnings to the documentation that Python 3.14 is not yet supported and updates install instructions to pin Python (e.g., --python 3.13) when using uv so users don’t accidentally end up on 3.14. It also updates the CI workflows to run on Python 3.13. In this PR, we also remove the deprecated flags `--extra-index-url` and `--index-url` for `uv`-based installations and update to `--index` flag in the installation docs.
1 parent 299d612 commit b0179af

File tree

10 files changed

+123
-32
lines changed

10 files changed

+123
-32
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup UV
2828
uses: astral-sh/setup-uv@v6
2929
with:
30-
python-version: "3.12"
30+
python-version: "3.13"
3131

3232
- name: Build distributions
3333
run: |

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
enable-cache: false
2424

2525
- name: Set up Python
26-
run: uv python install 3.11
26+
run: uv python install 3.13
2727

2828
- name: Install dev dependencies and torch
2929
run: uv sync --extra dev --extra torch-cpu
@@ -49,7 +49,7 @@ jobs:
4949
runs-on: macos-14
5050
- os: self-hosted-gpu
5151
runs-on: [self-hosted, puma, gpu, 2xgpu]
52-
python: [3.12]
52+
python: [3.13]
5353

5454
name: Tests (${{ matrix.os }}, Python ${{ matrix.python }})
5555
runs-on: ${{ matrix.runs-on }}

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup UV
2929
uses: astral-sh/setup-uv@v6
3030
with:
31-
python-version: "3.12"
31+
python-version: "3.13"
3232

3333
- name: Install dependencies
3434
run: |

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ Thank you for your interest in contributing to sleap-nn! This guide will help yo
44

55
## Development Setup
66

7+
> **Python 3.14 is not yet supported**
8+
>
9+
> `sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**.
10+
> **Python 3.14 is not yet tested or supported.**
11+
> By default, `uv` will use your system-installed Python.
12+
> If you have Python 3.14 installed, you must specify the Python version (≤3.13) in the install command.
13+
>
14+
> For example:
15+
>
16+
> ```bash
17+
> uv sync --python 3.13 ...
18+
> ```
19+
> Replace `...` with the rest of your install command as needed.
20+
721
1. **Install [`uv`](https://github.com/astral-sh/uv) and development dependencies**
822
`uv` is a fast and modern package manager for `pyproject.toml`-based projects. Refer [installation docs](https://docs.astral.sh/uv/getting-started/installation/) to install uv.
923

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
3838

3939
3. **Install sleap-nn dependencies based on your platform**\
4040

41+
> **Python 3.14 is not yet supported**
42+
>
43+
> `sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**.
44+
> **Python 3.14 is not yet tested or supported.**
45+
> By default, `uv` will use your system-installed Python.
46+
> If you have Python 3.14 installed, you must specify the Python version (≤3.13) in the install command.
47+
>
48+
> For example:
49+
>
50+
> ```bash
51+
> uv sync --python 3.13 ...
52+
> ```
53+
> Replace `...` with the rest of your install command as needed.
54+
4155
- Sync all dependencies based on your correct wheel using `uv sync`. `uv sync` creates a `.venv` (virtual environment) inside your current working directory. This environment is only active within that directory and can't be directly accessed from outside. To use all installed packages, you must run commands with `uv run` (e.g., `uv run sleap-nn train ...` or `uv run pytest ...`).
4256
- **Windows/Linux with NVIDIA GPU (CUDA 11.8):**
4357

docs/index.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,22 @@ We use `uvx` here which automatically installs sleap-nn from PyPI with all depen
4343

4444
> **Quick Start Data:** Download sample training data from [here](https://storage.googleapis.com/sleap-data/datasets/BermanFlies/random_split1/train.pkg.slp) and validation data from [here](https://storage.googleapis.com/sleap-data/datasets/BermanFlies/random_split1/val.pkg.slp) for quick experimentation.
4545
46+
!!! warning "Python 3.14 is not yet supported"
47+
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.** If you have Python 3.14 installed, you must specify the Python version in the install commands by adding `--python 3.13`.
48+
For example:
49+
```bash
50+
uvx --python 3.13 ...
51+
```
52+
Replace `...` with the rest of your install command as needed.
53+
4654
=== "Windows/Linux (CUDA)"
4755
```bash
48-
uvx --from "sleap-nn[torch]" --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cu128 sleap-nn train --config-name config.yaml --config-dir /path/to/config_dir/ "data_config.train_labels_path=[train.pkg.slp]" "data_config.val_labels_path=[val.pkg.slp]"
56+
uvx --from "sleap-nn[torch]" --index https://download.pytorch.org/whl/cu128 --index https://pypi.org/simple sleap-nn train --config-name config.yaml --config-dir /path/to/config_dir/ "data_config.train_labels_path=[train.pkg.slp]" "data_config.val_labels_path=[val.pkg.slp]"
4957
```
5058

5159
=== "Windows/Linux (CPU)"
5260
```bash
53-
uvx --from "sleap-nn[torch]" --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cpu sleap-nn train --config-name config.yaml --config-dir /path/to/config_dir/ "data_config.train_labels_path=[train.pkg.slp]" "data_config.val_labels_path=[val.pkg.slp]"
61+
uvx --from "sleap-nn[torch]" --index https://download.pytorch.org/whl/cpu --index https://pypi.org/simple sleap-nn train --config-name config.yaml --config-dir /path/to/config_dir/ "data_config.train_labels_path=[train.pkg.slp]" "data_config.val_labels_path=[val.pkg.slp]"
5462
```
5563

5664
=== "macOS"
@@ -60,7 +68,7 @@ We use `uvx` here which automatically installs sleap-nn from PyPI with all depen
6068

6169
!!! info
6270
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
63-
The `--extra-index-url` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
71+
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
6472
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
6573

6674

@@ -70,12 +78,12 @@ To run inference:
7078

7179
=== "Windows/Linux (CUDA)"
7280
```bash
73-
uvx --from "sleap-nn[torch]" --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cu128 sleap-nn track --data-path video.mp4 --model-paths model_ckpt_dir/
81+
uvx --from "sleap-nn[torch]" --index https://download.pytorch.org/whl/cu128 --index https://pypi.org/simple sleap-nn track --data-path video.mp4 --model-paths model_ckpt_dir/
7482
```
7583

7684
=== "Windows/Linux (CPU)"
7785
```bash
78-
uvx --from "sleap-nn[torch]" --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cpu sleap-nn track --data-path video.mp4 --model-paths model_ckpt_dir/
86+
uvx --from "sleap-nn[torch]" --index https://download.pytorch.org/whl/cpu --index https://pypi.org/simple sleap-nn track --data-path video.mp4 --model-paths model_ckpt_dir/
7987
```
8088

8189
=== "macOS"
@@ -85,7 +93,7 @@ To run inference:
8593

8694
!!! info
8795
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
88-
The `--extra-index-url` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
96+
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
8997
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
9098

9199

docs/inference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SLEAP-NN provides powerful inference capabilities for pose estimation with suppo
1010

1111
- If you're using the `uvx` workflow, you do **not** need to install anything. (See [installation using uvx](installation.md#installation-using-uvx) for more details.)
1212

13-
- If you are using `uv sync` or `uv pip` installation methods, add `uv run` as a prefix to all CLI commands shown below, for example:
13+
- If you are using `uv sync` or `uv add` installation methods, add `uv run` as a prefix to all CLI commands shown below, for example:
1414

1515
`uv run sleap-nn track ...`
1616

docs/installation.md

Lines changed: 72 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22

33
**Prerequisites:** Python 3.11+ (required for all installation methods)
44

5+
!!! warning "Python 3.14 is not yet supported"
6+
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.** If you have Python 3.14 installed, you must specify the Python version in all `uv` install commands by adding `--python 3.13`.
7+
For example:
8+
```bash
9+
uv tool install --python 3.13 "sleap-nn[torch]" ...
10+
```
11+
Replace `...` with the rest of your install command as needed.
12+
513
!!! tip "Choose Your Installation Method"
614
- **[Installation as a system-wide tool with uv](#installation-as-a-system-wide-tool-with-uv)**: **(Recommended)** Use `uv tool install` to install sleap-nn globally as a CLI tool
715
- **[Installation with uvx](#installation-with-uvx)**: Use `uvx` for one-off commands (no installation needed)
8-
- **[Installation with uv pip](#installation-with-uv-pip)**: Use `uv pip` to install from pypi in a uv virtual env.
16+
- **[Installation with uv add](#installation-with-uv-add)**: Use `uv add` to install sleap-nn as a dependency in a uv virtual env.
917
- **[Installation with pip](#installation-with-pip)**: Use `pip` to install from pypi in a conda env. (Recommended to use with a conda env)
1018
- **[Installation from source](#installation-from-source)**: Use `uv sync` to install from source (for developmental purposes)
1119

@@ -27,18 +35,26 @@
2735

2836
### Platform-Specific Installation
2937

38+
!!! warning "Python 3.14 is not yet supported"
39+
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.** If you have Python 3.14 installed, you must specify the Python version in the install commands by adding `--python 3.13`.
40+
For example:
41+
```bash
42+
uv tool install --python 3.13 "sleap-nn[torch]" ...
43+
```
44+
Replace `...` with the rest of your install command as needed.
45+
3046
=== "Windows/Linux (CUDA)"
3147
```bash
3248
# CUDA 12.8
33-
uv tool install sleap-nn[torch] --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cu128
49+
uv tool install sleap-nn[torch] --index https://download.pytorch.org/whl/cu128 --index https://pypi.org/simple
3450

3551
# CUDA 11.8
36-
uv tool install sleap-nn[torch] --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cu118
52+
uv tool install sleap-nn[torch] --index https://download.pytorch.org/whl/cu118 --index https://pypi.org/simple
3753
```
3854

3955
=== "Windows/Linux (CPU)"
4056
```bash
41-
uv tool install sleap-nn[torch] --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cpu
57+
uv tool install sleap-nn[torch] --index https://download.pytorch.org/whl/cpu --index https://pypi.org/simple
4258
```
4359

4460
=== "macOS"
@@ -48,7 +64,7 @@
4864

4965
!!! info
5066
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
51-
The `--extra-index-url` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
67+
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
5268
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
5369

5470
### Verify installation
@@ -76,16 +92,24 @@ sleap-nn --help
7692

7793
### Platform-Specific Commands
7894

95+
!!! warning "Python 3.14 is not yet supported"
96+
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.** If you have Python 3.14 installed, you must specify the Python version in the install commands by adding `--python 3.13`.
97+
For example:
98+
```bash
99+
uvx --python 3.13 ...
100+
```
101+
Replace `...` with the rest of your install command as needed.
102+
79103
=== "Windows/Linux (CUDA)"
80104
```bash
81-
uvx --from "sleap-nn[torch]" --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cu128 sleap-nn train --config-name myconfig --config-dir /path/to/config_dir/
82-
uvx --from "sleap-nn[torch]" --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cu128 sleap-nn track --data_path video.mp4 --model_paths models/
105+
uvx --from "sleap-nn[torch]" --index https://download.pytorch.org/whl/cu128 --index https://pypi.org/simple sleap-nn train --config-name myconfig --config-dir /path/to/config_dir/
106+
uvx --from "sleap-nn[torch]" --index https://download.pytorch.org/whl/cu128 --index https://pypi.org/simple sleap-nn track --data_path video.mp4 --model_paths models/
83107
```
84108

85109
=== "Windows/Linux (CPU)"
86110
```bash
87-
uvx --from "sleap-nn[torch]" --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cpu sleap-nn train --config-name myconfig --config-dir /path/to/config_dir/
88-
uvx --from "sleap-nn[torch]" --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cpu sleap-nn track --data_path video.mp4 --model_paths models/
111+
uvx --from "sleap-nn[torch]" --index https://download.pytorch.org/whl/cpu --index https://pypi.org/simple sleap-nn train --config-name myconfig --config-dir /path/to/config_dir/
112+
uvx --from "sleap-nn[torch]" --index https://download.pytorch.org/whl/cpu --index https://pypi.org/simple sleap-nn track --data_path video.mp4 --model_paths models/
89113
```
90114

91115
=== "macOS"
@@ -96,7 +120,7 @@ sleap-nn --help
96120

97121
!!! note
98122
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
99-
The `--extra-index-url` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
123+
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
100124
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
101125

102126
!!! tip "How uvx Works"
@@ -110,9 +134,17 @@ sleap-nn --help
110134

111135
---
112136

113-
## Installation with uv pip
137+
## Installation with uv add
114138

115-
This method creates a dedicated project environment using uv's modern Python project management. It initializes a new project with `uv init`, creates an isolated virtual environment with `uv venv`, and installs sleap-nn using `uv pip`. To use all installed packages, you must run commands with `uv run` (e.g., `uv run sleap-nn train ...` or `uv run pytest ...`).
139+
This method creates a dedicated project environment using uv's modern Python project management. It initializes a new project with `uv init`, creates an isolated virtual environment with `uv venv`, and adds sleap-nn as a dependency using `uv add`. To use all installed packages, you must run commands with `uv run` (e.g., `uv run sleap-nn train ...` or `uv run pytest ...`).
140+
141+
!!! warning "Python 3.14 is not yet supported"
142+
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.** `uv` will use the system-installed python by default. If you have python 3.14 installed on your system, then specify the Python version (<=3.13) in the venv command.
143+
For example:
144+
```bash
145+
uv venv --python 3.13 ...
146+
```
147+
Replace `...` with the rest of your install command as needed.
116148

117149
!!! note "Install and set-up uv"
118150
Step-1: Install [`uv`](https://github.com/astral-sh/uv) - a fast Python package manager:
@@ -132,28 +164,39 @@ This method creates a dedicated project environment using uv's modern Python pro
132164

133165
### Platform-Specific Installation
134166

167+
!!! tip "How `uv add` works"
168+
- When you run `uv init`, it creates a `pyproject.toml` file in your working directory to manage your project's dependencies.
169+
- When you use `uv add sleap-nn[torch]`, it adds `sleap-nn[torch]` as a dependency in your `pyproject.toml` and installs it in your virtual environment.
170+
- To add other packages, simply run `uv add <package>`. After adding new packages, you should run `uv sync` to update your environment with all dependencies specified in `pyproject.toml`.
171+
- To install a local package (such as a local clone of sleap-nn) in editable mode, use:
172+
```bash
173+
uv add --editable "./sleap-nn[torch]" ...
174+
```
175+
This is useful for development, as changes to the code are immediately reflected in your environment.
176+
177+
135178
=== "Windows/Linux (CUDA)"
136179
```bash
137180
# CUDA 12.8
138-
uv pip install sleap-nn[torch] --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cu128
181+
uv add sleap-nn[torch] ---index https://download.pytorch.org/whl/cu128 --index https://pypi.org/simple
139182

140183
# CUDA 11.8
141-
uv pip install sleap-nn[torch] --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cu118
184+
uv add sleap-nn[torch] --index https://download.pytorch.org/whl/cu118 --index https://pypi.org/simple
142185
```
143186

144187
=== "Windows/Linux (CPU)"
145188
```bash
146-
uv pip install sleap-nn[torch] --index-url https://pypi.org/simple --extra-index-url https://download.pytorch.org/whl/cpu
189+
uv add sleap-nn[torch] --index https://download.pytorch.org/whl/cpu --index https://pypi.org/simple
147190
```
148191

149192
=== "macOS"
150193
```bash
151-
uv pip install "sleap-nn[torch]"
194+
uv add "sleap-nn[torch]"
152195
```
153196

154197
!!! info
155198
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
156-
The `--extra-index-url` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
199+
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
157200
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
158201

159202
### Verify Installation
@@ -182,9 +225,12 @@ uv run sleap-nn --help
182225

183226
We recommend creating a dedicated environment with [conda](https://docs.conda.io/en/latest/miniconda.html) or [mamba/miniforge](https://github.com/conda-forge/miniforge) before installing `sleap-nn` with pip. This helps avoid dependency conflicts and keeps your Python setup clean. After installing Miniconda or Miniforge, create and activate an environment, then run the pip install commands below inside the activated environment.
184227

228+
!!! warning "Python 3.14 is not yet supported"
229+
SLEAP currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.**
230+
185231
To create a conda environment, run:
186232
```bash
187-
conda create -n sleap-nn-env python=3.12
233+
conda create -n sleap-nn-env python=3.13
188234
conda activate sleap-nn-env
189235
```
190236

@@ -255,6 +301,14 @@ cd sleap-nn
255301

256302
#### 3. Install Dependencies
257303

304+
!!! warning "Python 3.14 is not yet supported"
305+
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.** `uv` will use the system-installed python by default. If you have python 3.14 installed on your system, then specify the Python version (<=3.13) in the installation command.
306+
For example:
307+
```bash
308+
uv sync --python 3.13 ...
309+
```
310+
Replace `...` with the rest of your install command as needed.
311+
258312
=== "Windows/Linux (CUDA 11.8)"
259313
```bash
260314
uv sync --extra dev --extra torch-cuda118

0 commit comments

Comments
 (0)