Skip to content
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
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ jobs:
with:
python-version: '3.10'

- name: Upgrade pip and nox
- name: Upgrade pip
run: |
pip install --upgrade pip nox
pip install --upgrade pip
pip --version
nox --version

- name: Install
run: python -m pip install build setuptools

- name: Build package
run: nox -s build
run: python -m build

- name: Upload package
if: github.event_name == 'release'
Expand Down
77 changes: 58 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,57 @@ concurrency:
cancel-in-progress: true

jobs:
tests:
test_full:
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
cache-dependency-path: setup.cfg

- name: Upgrade pip
run: |
python -m pip install --upgrade pip wheel
pip --version

- run: python -m pip install pre-commit

- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: pre-commit
run: |
pre-commit run --show-diff-on-failure --color=always --all-files

- name: Full install
run: pip install -e '.[dev]'

- name: pylint
run: |
python -m pylint src tests

- name: mypy
run: |
python -m mypy --install-types --non-interactive

- name: Run tests
run: pytest -v tests --cov --cov-report=xml --cov-config=pyproject.toml

- name: Upload coverage report
uses: codecov/codecov-action@v3.1.1

test_core:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -33,28 +83,17 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyv }}
cache: 'pip'
cache-dependency-path: setup.cfg

- name: Upgrade pip and nox
- name: Upgrade pip
run: |
python -m pip install --upgrade pip nox
python -m pip install --upgrade pip wheel
pip --version
nox --version

- name: install libomp
# required for xgboost
if: runner.os == 'macOS'
- name: Install core
run: |
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/679923b4eb48a8dc7ecc1f05d06063cd79b3fc00/Formula/libomp.rb -O $(find $(brew --repository) -name libomp.rb)
brew install ninja libomp
brew pin libomp
- name: Lint code and check dependencies
run: nox -s lint safety
pip install -e '.[tests]'

- name: Run tests
run: nox -s tests-${{ matrix.nox_pyv || matrix.pyv }} -- --cov-report=xml

- name: Upload coverage report
uses: codecov/codecov-action@v3.1.1

- name: Build package
run: nox -s build
run: pytest -v tests --ignore=tests/test_frameworks
21 changes: 15 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ install_requires=
ruamel.yaml>=0.17.11

[options.extras_require]
dvc =
dvc>=2.37.0
image =
numpy
pillow
sklearn =
scikit-learn
plots =
%(sklearn)s
markdown =
matplotlib
tests =
pytest==7.2.0
pytest-sugar==0.9.5
Expand All @@ -40,15 +51,13 @@ tests =
pylint==2.15.0
pylint-plugin-utils>=0.6
mypy==0.981
%(image)s
%(plots)s
%(dvc)s
%(markdown)s
dev =
%(tests)s
%(all)s
image =
pillow
sklearn =
scikit-learn
plots =
%(sklearn)s
mmcv =
mmcv
tf =
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os

import pytest
from funcy import last

from dvclive import Live, env
from dvclive.error import (
Expand Down Expand Up @@ -218,7 +217,7 @@ def test_continue(tmp_dir, resume, steps, metrics):
dvclive.next_step()

assert read_history(dvclive, "metric") == (steps, metrics)
assert read_latest(dvclive, "metric") == (last(steps), last(metrics))
assert read_latest(dvclive, "metric") == (steps[-1], metrics[-1])


def test_resume_on_first_init(tmp_dir):
Expand Down Expand Up @@ -259,7 +258,7 @@ def test_custom_steps(tmp_dir):
dvclive.make_summary()

assert read_history(dvclive, "m") == (steps, metrics)
assert read_latest(dvclive, "m") == (last(steps), last(metrics))
assert read_latest(dvclive, "m") == (steps[-1], metrics[-1])


def test_log_reset_with_set_step(tmp_dir):
Expand Down