diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0dc0bab..d553e49 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,6 +4,7 @@ on: [push, pull_request, workflow_dispatch] env: FORCE_COLOR: 1 + PIP_DISABLE_PIP_VERSION_CHECK: 1 permissions: contents: read diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7bfe825..3e5e99f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,8 +2,12 @@ name: Test on: [push, pull_request, workflow_dispatch] +permissions: + contents: read + env: FORCE_COLOR: 1 + PIP_DISABLE_PIP_VERSION_CHECK: 1 jobs: test: @@ -11,12 +15,7 @@ jobs: strategy: fail-fast: false matrix: - # Will be fixed in 3.13.0a6: Tuesday, 2024-04-09 - # qs = bytes(qs) - # ~~~~~^^^^ - # TypeError: cannot convert 'NoneType' object to bytes - python-version: - ["pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0-alpha.4"] + python-version: ["pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] os: [windows-latest, macos-latest, ubuntu-latest] steps: @@ -32,7 +31,6 @@ jobs: - name: Install dependencies run: | python -m pip install -U pip - python -m pip install -U wheel python -m pip install -U tox - name: Tox tests diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 20305eb..b9949c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,6 +32,11 @@ repos: - id: check-github-workflows - id: check-renovate + - repo: https://github.com/rhysd/actionlint + rev: v1.7.1 + hooks: + - id: actionlint + # - repo: https://github.com/pre-commit/mirrors-mypy # rev: v1.7.0 # hooks: diff --git a/pyproject.toml b/pyproject.toml index 39e2227..21de2d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,20 +78,27 @@ lint.select = [ "EM", # flake8-errmsg "F", # pyflakes errors "I", # isort + "ICN", # flake8-import-conventions "ISC", # flake8-implicit-str-concat "LOG", # flake8-logging "PGH", # pygrep-hooks + "PYI", # flake8-pyi + "RUF022", # unsorted-dunder-all "RUF100", # unused noqa (yesqa) "UP", # pyupgrade "W", # pycodestyle warnings "YTT", # flake8-2020 ] -lint.extend-ignore = [ +lint.ignore = [ "E203", # Whitespace before ':' "E221", # Multiple spaces before operator "E226", # Missing whitespace around arithmetic operator "E241", # Multiple spaces after ',' ] +lint.flake8-import-conventions.aliases.datetime = "dt" +lint.flake8-import-conventions.banned-from = [ + "datetime", +] lint.isort.known-first-party = [ "norwegianblue", ] @@ -104,3 +111,10 @@ max_supported_python = "3.13" [tool.pytest.ini_options] addopts = "--color=yes" +filterwarnings = [ + # Python <= 3.11 + "ignore:sys.monitoring isn't available, using default core:coverage.exceptions.CoverageWarning", +] +testpaths = [ + "tests", +] diff --git a/tox.ini b/tox.ini index d85d446..47c14c3 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,8 @@ env_list = [testenv] extras = tests +set_env = + COVERAGE_CORE = sysmon commands = {envpython} -m pytest \ --cov norwegianblue \