Skip to content

Commit

Permalink
working tox env + remove 'pip install -e' in CI.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Sep 20, 2024
1 parent 1cb40b0 commit 643d9a7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 44 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/check.yaml → .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ jobs:
allow-prereleases: true
- name: Install tox-uv
run: python -Im pip install tox-uv
- name: install
run: python -Im pip install -e .[test]

- run: >-
uvx --with=tox-uv
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/coverage.yaml

This file was deleted.

File renamed without changes.
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ docs = [
"towncrier",
]
test = [
"coverage[toml]>=5.3",
"coverage[toml]>=7",
"mypy",
"types-requests",
"types-beautifulsoup4",
Expand Down Expand Up @@ -162,10 +162,14 @@ omit = [
"subliminal/cli.py",
]

[tool.coverage.paths]
source = [".tox/py*/**/site-packages"]

[tool.coverage.run]
source = ["subliminal"]
branch = true
relative_files = false
parallel = true
relative_files = true


# https://docs.astral.sh/ruff/
Expand Down
3 changes: 2 additions & 1 deletion tests/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def test_video_exists_age(movies, tmpdir, monkeypatch):
video = movies['man_of_steel']
tmpdir.ensure(video.name).setmtime(timestamp(datetime.now(timezone.utc) - timedelta(days=3)))
assert video.exists
assert timedelta(days=3) <= video.age < timedelta(days=3, seconds=1)
with pytest.deprecated_call():
assert timedelta(days=3) <= video.age < timedelta(days=3, seconds=1)


def test_video_age(movies):
Expand Down
12 changes: 8 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ env_list =
docs,
changelog,


[testenv:.pkg]
pass_env = SETUPTOOLS_SCM_PRETEND_VERSION

Expand Down Expand Up @@ -44,7 +43,9 @@ usedevelop = true
deps = coverage[toml]>=7
set_env =
COVERAGE_PROCESS_START = pyproject.toml
commands = pytest --cov --cov-report=term-missing:skip-covered {posargs:-n auto}
commands =
python -m pytest --cov=subliminal --cov-report= --cov-fail-under=0 {posargs:-n auto}
coverage report --skip-covered --show-missing --fail-under=80


[testenv:py3{,.}{8,9,10,11,12}-coverage]
Expand All @@ -57,10 +58,13 @@ deps = coverage[toml]>=7
set_env =
COVERAGE_PROCESS_START = pyproject.toml
commands =
pytest --ignore=tests/refiners --ignore=tests/providers --cov --cov-report= --cov-fail-under=0 {posargs:-n auto}
python -m pytest \
--ignore=tests/refiners --ignore=tests/providers \
--cov=subliminal --cov-report= --cov-fail-under=0 \
{posargs:-n auto}
coverage report \
--omit='subliminal/cli.py,subliminal/converters/*,subliminal/providers/*,subliminal/refiners/*' \
--skip-covered --fail-under=100
--skip-covered --show-missing --fail-under=100


[testenv:py3{,.}{8,9,10,11,12}-coverage-core]
Expand Down

0 comments on commit 643d9a7

Please sign in to comment.