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

Switch to ruff #208

Merged
merged 3 commits into from
Mar 1, 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
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,23 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: poetry install
- name: Run linting
run: |
poetry run isort .
poetry run black . --check
poetry run flake8 .
poetry run pylint pylitterbot tests
poetry run pydocstyle pylitterbot tests
poetry run ruff check .
poetry run ruff format . --check
- name: Run mypy
run: poetry run mypy pylitterbot tests
- name: Test with pytest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.16
with:
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ To run tests, you must have `pytest`, `pytest-asyncio` and `pytest-cov` installe

```bash
mypy pylitterbot tests
pylint pylitterbot tests
ruff check
ruff format
pytest --cov --cov-report term-missing -vv
```
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2023 Nathan Spencer
Copyright (c) 2020-2024 Nathan Spencer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
576 changes: 121 additions & 455 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ PyJWT = "^2.7.0"
pytest = "^7.3.1"
pytest-asyncio = "^0.21.0"
pytest-cov = "^4.1.0"
pytest-freezegun = "^0.4.2"
aioresponses = "^0.7.4"
black = "^23.3.0"
isort = "^5.11.5"
mypy = "^1.3"
flake8 = ">=5.0.4,<7.0.0"
pylint = "^2.17.4"
tox = ">=3.28,<5.0"
pydocstyle = "^6.3.0"
pytest-timeout = "^2.1.0"
ruff = "^0.2.1"
pytest-freezer = "^0.4.8"

[tool.poetry-dynamic-versioning]
enable = true
Expand Down
10 changes: 4 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
[tox]
isolated_build = True
envlist = lint, mypy, py38, py39, py310, py311
envlist = lint, mypy, py39, py310, py311, py312
skip_missing_interpreters = True

[tox:.package]
basepython = python3

[testenv]
whitelist_externals = poetry
allowlist_externals = poetry
commands =
poetry run pytest --timeout=10 --cov=pylitterbot --cov-report=term-missing --asyncio-mode=auto

[testenv:lint]
ignore_errors = True
commands =
poetry run isort .
poetry run black . --check
poetry run flake8 .
poetry run pylint pylitterbot tests
poetry run pydocstyle pylitterbot tests
poetry run ruff check .
poetry run ruff format .

[testenv:mypy]
ignore_errors = True
Expand Down