diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 06c37b3..d110b45 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,6 +14,9 @@ on: permissions: contents: read +env: + FORCE_COLOR: 1 + jobs: # Always build & lint package. build-package: 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 bc3bdd8..60a0f19 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,9 @@ name: Test on: [push, pull_request, workflow_dispatch] +permissions: + contents: read + env: FORCE_COLOR: 1 @@ -11,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] os: [windows-latest, macos-latest, ubuntu-latest] steps: @@ -26,7 +29,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 f5174a9..ed70e52 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,43 +1,55 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.1 + rev: v0.6.8 hooks: - id: ruff args: [--exit-non-zero-on-fix] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.1.1 + rev: 24.8.0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: + - id: check-added-large-files - id: check-case-conflict - id: check-merge-conflict - id: check-toml - id: check-yaml - id: debug-statements - id: end-of-file-fixer + - id: forbid-submodules - id: trailing-whitespace + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.29.2 + hooks: + - id: check-github-workflows + + - repo: https://github.com/rhysd/actionlint + rev: v1.7.2 + hooks: + - id: actionlint + - repo: https://github.com/tox-dev/pyproject-fmt - rev: 1.7.0 + rev: 2.2.4 hooks: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.16 + rev: v0.20.2 hooks: - id: validate-pyproject - repo: https://github.com/tox-dev/tox-ini-fmt - rev: 1.3.1 + rev: 1.4.1 hooks: - id: tox-ini-fmt - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 + - repo: https://github.com/rbubley/mirrors-prettier + rev: v3.3.3 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88] diff --git a/pyproject.toml b/pyproject.toml index cae0343..04d2749 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,15 +17,14 @@ keywords = [ "strava", "visualisation", ] -license = {text = "MIT"} -maintainers = [{name = "Hugo van Kemenade"}] -authors = [{name = "Marcus Volz"}] -requires-python = ">=3.8" +license = { text = "MIT" } +maintainers = [ { name = "Hugo van Kemenade" } ] +authors = [ { name = "Marcus Volz" } ] +requires-python = ">=3.9" classifiers = [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -34,9 +33,7 @@ classifiers = [ "Topic :: Multimedia :: Graphics", "Topic :: Scientific/Engineering :: Visualization", ] -dynamic = [ - "version", -] +dynamic = [ "version" ] dependencies = [ "calmap>=0.0.11", "fit2gpx", @@ -46,13 +43,11 @@ dependencies = [ "plotnine", "rich", "seaborn", - 'setuptools; python_version >= "3.12"', # TODO Remove when https://github.com/MarvinT/calmap/issues/22 is fixed + "setuptools; python_version>='3.12'", # TODO Remove when https://github.com/MarvinT/calmap/issues/22 is fixed ] -[project.urls] -Homepage = "https://github.com/marcusvolz/strava_py" -Source = "https://github.com/marcusvolz/strava_py" -[project.scripts] -stravavis = "stravavis.cli:main" +urls.Homepage = "https://github.com/marcusvolz/strava_py" +urls.Source = "https://github.com/marcusvolz/strava_py" +scripts.stravavis = "stravavis.cli:main" [tool.hatch] version.source = "vcs" @@ -63,28 +58,28 @@ local_scheme = "no-local-version" [tool.ruff] fix = true -[tool.ruff.lint] -select = [ - "C4", # flake8-comprehensions - "E", # pycodestyle errors - "EM", # flake8-errmsg - "F", # pyflakes errors - "I", # isort - "ISC", # flake8-implicit-str-concat - "LOG", # flake8-logging - "PGH", # pygrep-hooks +lint.select = [ + "C4", # flake8-comprehensions + "E", # pycodestyle errors + "EM", # flake8-errmsg + "F", # pyflakes errors + "I", # isort + "ICN", # flake8-import-conventions + "ISC", # flake8-implicit-str-concat + "LOG", # flake8-logging + "PGH", # pygrep-hooks + "RUF022", # unsorted-dunder-all "RUF100", # unused noqa (yesqa) - "UP", # pyupgrade - "W", # pycodestyle warnings - "YTT", # flake8-2020 + "UP", # pyupgrade + "W", # pycodestyle warnings + "YTT", # flake8-2020 ] -extend-ignore = [ - "E203", # Whitespace before ':' - "E221", # Multiple spaces before operator - "E226", # Missing whitespace around arithmetic operator - "E241", # Multiple spaces after ',' +lint.ignore = [ + "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 ] - -[tool.ruff.lint.isort] -known-first-party = ["stravavis"] -required-imports = ["from __future__ import annotations"] +lint.isort.known-first-party = [ "stravavis" ] +lint.isort.required-imports = [ "from __future__ import annotations" ] diff --git a/tox.ini b/tox.ini index 421f9fb..5c2a820 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ requires = tox>=4.2 env_list = lint - py{312, 311, 310, 39, 38} + py{312, 311, 310, 39} [testenv] pass_env =