Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update config #27

Merged
merged 3 commits into from
Oct 31, 2024
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
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/action@v3.0.1
- 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/codecov-action@v3.1.5
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
Loading