Skip to content

Commit

Permalink
Run tox with uv (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Oct 16, 2024
2 parents fb11d01 + 6067ed8 commit e7b49d7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip
- name: Install dependencies
run: |
python3 -m pip install -U tox
- name: Install uv
uses: hynek/setup-cached-uv@v2
- name: Mypy
run: tox -e mypy
run: uvx --with tox-uv tox -e mypy
14 changes: 5 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ permissions:

env:
FORCE_COLOR: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1

jobs:
test:
Expand All @@ -26,25 +25,22 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U tox
- name: Install uv
uses: hynek/setup-cached-uv@v2

- name: Tox tests
run: |
tox -e py
uvx --with tox-uv tox -e py
- name: Test CLI
run: |
tox -e cli
uvx --with tox-uv tox -e cli
- name: Cog
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
run: |
tox -e cog
uvx --with tox-uv tox -e cog
- name: Upload coverage
uses: codecov/codecov-action@v3.1.5
Expand Down
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ lint.select = [
"YTT", # flake8-2020
]
lint.ignore = [
"E203", # Whitespace before ':'
"E221", # Multiple spaces before operator
"E226", # Missing whitespace around arithmetic operator
"E241", # Multiple spaces after ','
"E203", # Whitespace before ':'
"E221", # Multiple spaces before operator
"E226", # Missing whitespace around arithmetic operator
"E241", # Multiple spaces after ','
"UP038", # Makes code slower and more verbose
]
lint.flake8-import-conventions.aliases.datetime = "dt"
lint.flake8-import-conventions.banned-from = [ "datetime" ]
Expand All @@ -100,3 +101,8 @@ filterwarnings = [
"ignore:sys.monitoring isn't available, using default core:coverage.exceptions.CoverageWarning",
]
testpaths = [ "tests" ]

[tool.mypy]
pretty = true
strict = true
show_error_codes = true
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ env_list =
cli
cog
lint
mypy
py{py3, 313, 312, 311, 310, 39}

[testenv]
extras =
tests
set_env =
COVERAGE_CORE = sysmon
commands =
{envpython} -m pytest \
--cov pepotron \
Expand Down Expand Up @@ -44,12 +47,12 @@ commands =

[testenv:mypy]
deps =
mypy==1.11.2
mypy==1.12
platformdirs
pytest
python-slugify
rapidfuzz
types-freezegun
urllib3
commands =
mypy --strict --pretty --show-error-codes . {posargs}
mypy . {posargs}

0 comments on commit e7b49d7

Please sign in to comment.