Skip to content

Commit cb443a1

Browse files
authored
support Python 3.14 (#899)
1 parent 91e0387 commit cb443a1

File tree

4 files changed

+75
-67
lines changed

4 files changed

+75
-67
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,21 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Check out the repository
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v5
2121
with:
2222
fetch-depth: 0
2323

24-
- name: Set up Python 3.10
25-
uses: actions/setup-python@v5
24+
- name: Set up Python 3.14
25+
uses: actions/setup-python@v6
2626
with:
27-
python-version: '3.10'
27+
python-version: '3.14'
2828

29-
- name: Upgrade pip
30-
run: |
31-
pip install --upgrade pip
32-
pip --version
33-
34-
- name: Install
35-
run: python -m pip install build setuptools
29+
- uses: astral-sh/setup-uv@v7
30+
- name: Install nox
31+
run: uv pip install --system nox --upgrade
3632

3733
- name: Build package
38-
run: python -m build
34+
run: nox -s build
3935

4036
- name: Upload package
4137
if: github.event_name == 'release'

.github/workflows/tests.yml

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,88 +14,81 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
test_full:
18-
timeout-minutes: 30
17+
lint:
1918
runs-on: ubuntu-latest
20-
2119
steps:
2220
- name: Check out the repository
23-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5
2422
with:
2523
fetch-depth: 0
2624

2725
- name: Set up Python
28-
uses: actions/setup-python@v5
26+
uses: actions/setup-python@v6
2927
with:
30-
python-version: "3.12"
28+
python-version: "3.13"
3129

32-
- uses: astral-sh/setup-uv@v6
30+
- uses: astral-sh/setup-uv@v7
3331
with:
34-
enable-cache: true
35-
cache-suffix: ${{ matrix.pyv }}
36-
cache-dependency-glob: pyproject.toml
32+
enable-cache: false
3733

38-
- name: Full install
39-
run: uv pip install -e '.[dev]' --system
34+
- name: Install nox
35+
run: uv pip install --system nox --upgrade
4036

4137
- uses: actions/cache@v4
4238
with:
4339
path: ~/.cache/pre-commit/
4440
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
4541

46-
- name: pre-commit
47-
run: uv tool run pre-commit run --show-diff-on-failure --color=always --all-files
48-
49-
- name: mypy
50-
run: mypy
51-
52-
- name: Run tests
53-
run: pytest -v tests --cov --cov-report=xml --cov-config=pyproject.toml
54-
55-
- name: Upload coverage report
56-
uses: codecov/codecov-action@v5
57-
with:
58-
token: ${{ secrets.CODECOV_TOKEN }}
59-
files: coverage.xml
60-
flags: dvclive
42+
- name: Lint code
43+
run: nox -s lint
6144

62-
test_core:
45+
tests:
6346
timeout-minutes: 30
64-
runs-on: ${{ matrix.os }}
6547
strategy:
6648
fail-fast: false
6749
matrix:
6850
os: [ubuntu-latest, windows-latest, macos-latest]
69-
pyv: ["3.9", "3.10", "3.11", "3.12"]
70-
51+
pyv: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
52+
type: [core_tests]
53+
include:
54+
- os: ubuntu-latest
55+
pyv: "3.13"
56+
type: tests
57+
exclude:
58+
- os: ubuntu-latest
59+
pyv: "3.13"
60+
type: core_tests
61+
runs-on: ${{ matrix.os }}
7162
steps:
7263
- name: Check out the repository
73-
uses: actions/checkout@v4
64+
uses: actions/checkout@v5
7465
with:
7566
fetch-depth: 0
7667

7768
- name: Set up Python ${{ matrix.pyv }}
78-
uses: actions/setup-python@v5
69+
uses: actions/setup-python@v6
7970
with:
8071
python-version: ${{ matrix.pyv }}
81-
cache: "pip"
82-
cache-dependency-path: setup.cfg
8372

84-
- name: Upgrade pip
85-
run: |
86-
python -m pip install --upgrade pip wheel
87-
pip --version
73+
- uses: astral-sh/setup-uv@v7
74+
with:
75+
enable-cache: false
8876

89-
- name: Install core
90-
run: |
91-
pip install -e '.[tests]'
77+
- name: Install nox
78+
run: uv pip install --system nox --upgrade
9279

9380
- name: Run tests
94-
run: pytest -v tests --ignore=tests/frameworks
81+
run: nox -s ${{ matrix.type }}-${{ matrix.pyv }} -- --cov-report=xml
82+
83+
- name: Build package
84+
run: nox -s build
85+
86+
- name: Upload coverage report
87+
uses: codecov/codecov-action@v5
9588

9689
check:
9790
if: always()
98-
needs: [test_full, test_core]
91+
needs: [lint, tests]
9992
runs-on: ubuntu-latest
10093
steps:
10194
- uses: re-actors/alls-green@release/v1

noxfile.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,32 @@
55

66
import nox
77

8+
nox.options.default_venv_backend = "uv|virtualenv"
89
nox.options.reuse_existing_virtualenvs = True
910
nox.options.sessions = "lint", "tests"
10-
locations = "src", "tests"
1111

12+
project = nox.project.load_toml()
13+
python_versions = nox.project.python_versions(project)
1214

13-
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"])
15+
16+
@nox.session(python=python_versions)
1417
def tests(session: nox.Session) -> None:
18+
session.install(".[dev]")
19+
session.run(
20+
"pytest",
21+
"--cov",
22+
"--cov-config=pyproject.toml",
23+
*session.posargs,
24+
env={"COVERAGE_FILE": f".coverage.{session.python}"},
25+
)
26+
27+
28+
@nox.session(python=python_versions)
29+
def core_tests(session: nox.Session) -> None:
1530
session.install(".[tests]")
1631
session.run(
1732
"pytest",
33+
"--ignore=tests/frameworks",
1834
"--cov",
1935
"--cov-config=pyproject.toml",
2036
*session.posargs,
@@ -42,8 +58,8 @@ def safety(session: nox.Session) -> None:
4258

4359
@nox.session
4460
def build(session: nox.Session) -> None:
45-
session.install("build", "setuptools", "twine")
46-
session.run("python", "-m", "build")
61+
session.install("twine", "uv")
62+
session.run("uv", "build")
4763
dists = glob.glob("dist/*")
4864
session.run("twine", "check", *dists, silent=True)
4965

pyproject.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ requires = ["setuptools>=77", "setuptools_scm[toml]>=8"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
description = "Experiments logger for ML projects."
76
name = "dvclive"
7+
description = "Experiments logger for ML projects."
88
readme = "README.md"
99
keywords = [
1010
"ai",
@@ -18,6 +18,7 @@ keywords = [
1818
"reproducibility"
1919
]
2020
license = "Apache-2.0"
21+
license-files = ["LICENSE"]
2122
maintainers = [{name = "Iterative", email = "[email protected]"}]
2223
authors = [{name = "Iterative", email = "[email protected]"}]
2324
requires-python = ">=3.9"
@@ -27,7 +28,9 @@ classifiers = [
2728
"Programming Language :: Python :: 3.9",
2829
"Programming Language :: Python :: 3.10",
2930
"Programming Language :: Python :: 3.11",
30-
"Programming Language :: Python :: 3.12"
31+
"Programming Language :: Python :: 3.12",
32+
"Programming Language :: Python :: 3.13",
33+
"Programming Language :: Python :: 3.14"
3134
]
3235
dynamic = ["version"]
3336
dependencies = [
@@ -59,11 +62,6 @@ tests = [
5962
"transformers[torch]",
6063
"tf-keras"
6164
]
62-
dev = [
63-
"dvclive[all,tests]",
64-
"mypy==1.17.1",
65-
"types-PyYAML"
66-
]
6765
mmcv = ["mmcv"]
6866
tf = ["tensorflow"]
6967
xgb = ["xgboost"]
@@ -75,6 +73,11 @@ optuna = ["optuna"]
7573
all = [
7674
"dvclive[image,mmcv,tf,xgb,lgbm,huggingface,fastai,lightning,optuna,plots,markdown]"
7775
]
76+
dev = [
77+
"dvclive[image,tf,xgb,lgbm,huggingface,fastai,lightning,optuna,plots,markdown,tests]",
78+
"mypy==1.17.1",
79+
"types-PyYAML"
80+
]
7881

7982
[project.urls]
8083
Homepage = "https://github.com/iterative/dvclive"

0 commit comments

Comments
 (0)