Skip to content

Commit

Permalink
Update config (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Oct 31, 2024
2 parents 138ac05 + 791722a commit 98521ff
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 27 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
permissions:
contents: read

env:
FORCE_COLOR: 1

jobs:
# Always build & lint package.
build-package:
Expand All @@ -24,6 +27,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- uses: hynek/build-and-inspect-python-package@v2

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Sync labels

permissions:
pull-requests: write

on:
push:
branches:
Expand All @@ -13,9 +10,13 @@ on:

jobs:
sync:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: micnncim/action-label-syncer@v1
with:
prune: false
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,34 @@ on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1

permissions:
contents: read

jobs:
pre-commit:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip
- uses: pre-commit/[email protected]
- uses: tox-dev/action-pre-commit-uv@v1

mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- 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
11 changes: 4 additions & 7 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 @@ -20,6 +19,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand All @@ -30,18 +31,14 @@ jobs:
- name: Install uv
uses: hynek/setup-cached-uv@v2

- name: Install dependencies
run: |
uv pip install --system -U tox-uv
- name: Tox tests
run: |
tox -e py
uvx --with tox-uv tox -e py
- name: Cog
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
run: |
tox -e cog
uvx --with tox-uv tox -e cog
- name: Upload coverage
uses: codecov/[email protected]
Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ fix = true

lint.select = [
"C4", # flake8-comprehensions
"E", # pycodestyle errors
"E", # pycodestyle
"EM", # flake8-errmsg
"F", # pyflakes errors
"F", # pyflakes
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
Expand All @@ -74,14 +74,15 @@ lint.select = [
"RUF022", # unsorted-dunder-all
"RUF100", # unused noqa (yesqa)
"UP", # pyupgrade
"W", # pycodestyle warnings
"W", # pycodestyle
"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 Down
10 changes: 8 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ env_list =
extras =
tests
commands =
{envpython} -m pytest --cov linkotron --cov tests --cov-report html --cov-report term --cov-report xml {posargs}
{envpython} -m pytest \
--cov linkotron \
--cov tests \
--cov-report html \
--cov-report term \
--cov-report xml \
{posargs}
linky --version
linky --help

Expand All @@ -32,7 +38,7 @@ commands =
[testenv:mypy]
deps =
httpx
mypy==1.10.1
mypy==1.12
platformdirs
pyperclip
pytest
Expand Down

0 comments on commit 98521ff

Please sign in to comment.