diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5ac358c..58ecc54 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,13 +12,13 @@ "extensions": [ "ms-python.python", "ms-python.vscode-pylance", - "ms-python.black-formatter", + "charliermarsh.ruff", "ms-python.flake8", "ms-python.mypy-type-checker" ], "settings": { "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python", - "python.formatting.provider": "black", + "python.formatting.provider": "ruff", "python.linting.enabled": true, "python.linting.flake8Enabled": true, "python.linting.mypyEnabled": true diff --git a/.github/workflows/lint-format-typecheck.yaml b/.github/workflows/lint-format-typecheck.yaml index 2e35360..13abedb 100644 --- a/.github/workflows/lint-format-typecheck.yaml +++ b/.github/workflows/lint-format-typecheck.yaml @@ -40,6 +40,6 @@ jobs: with: imageName: ghcr.io/${{ secrets.GH_DOCKER_REGISTRY_NAMESPACE }}/devcontainer-ghactions-poetry runCmd: | - poetry run black --check . poetry run ruff check --fix + poetry run ruff format . poetry run mypy src tests diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 23087e8..0a261ed 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,13 +17,13 @@ repos: pass_filenames: false language: system types: [python] - - id: black - name: black - entry: poetry run black + - id: ruff-check + name: ruff check + entry: poetry run ruff check --fix language: system types: [python] - - id: ruff - name: ruff - entry: poetry run ruff check --fix + - id: ruff-format + name: ruff format + entry: poetry run ruff format language: system - types: [python] \ No newline at end of file + types: [python] diff --git a/README.md b/README.md index 1602467..47b9c80 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This repository has a small yet instructive project that shows you how to create Specifically, the project is a simple Python app whose dependencies are managed by [Poetry](https://python-poetry.org/). * It contains some simple tests (for example purposes) that are run with pytest. -* It uses black, ruff, and mypy for linting, formatting, and type checking. +* It uses ruff for linting and formatting, and mypy for type checking. * Finally, it has two Github actions workflows for: 1. linting, formatting, and type checking. diff --git a/poetry.lock b/poetry.lock index b6ecfbb..42de7e2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,49 +1,5 @@ # This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. -[[package]] -name = "black" -version = "24.8.0" -description = "The uncompromising code formatter." -optional = false -python-versions = ">=3.8" -files = [ - {file = "black-24.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6"}, - {file = "black-24.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb"}, - {file = "black-24.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42"}, - {file = "black-24.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a"}, - {file = "black-24.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1"}, - {file = "black-24.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af"}, - {file = "black-24.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4"}, - {file = "black-24.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af"}, - {file = "black-24.8.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368"}, - {file = "black-24.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed"}, - {file = "black-24.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018"}, - {file = "black-24.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2"}, - {file = "black-24.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd"}, - {file = "black-24.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2"}, - {file = "black-24.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e"}, - {file = "black-24.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920"}, - {file = "black-24.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c"}, - {file = "black-24.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e"}, - {file = "black-24.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47"}, - {file = "black-24.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb"}, - {file = "black-24.8.0-py3-none-any.whl", hash = "sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed"}, - {file = "black-24.8.0.tar.gz", hash = "sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f"}, -] - -[package.dependencies] -click = ">=8.0.0" -mypy-extensions = ">=0.4.3" -packaging = ">=22.0" -pathspec = ">=0.9.0" -platformdirs = ">=2" - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2)"] - [[package]] name = "cfgv" version = "3.4.0" @@ -55,20 +11,6 @@ files = [ {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, ] -[[package]] -name = "click" -version = "8.1.7" -description = "Composable command line interface toolkit" -optional = false -python-versions = ">=3.7" -files = [ - {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, - {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} - [[package]] name = "colorama" version = "0.4.6" @@ -564,17 +506,6 @@ files = [ {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, ] -[[package]] -name = "pathspec" -version = "0.12.1" -description = "Utility library for gitignore style pattern matching of file paths." -optional = false -python-versions = ">=3.8" -files = [ - {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, - {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, -] - [[package]] name = "pillow" version = "10.4.0" @@ -949,4 +880,4 @@ visualization = ["matplotlib"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "4231d450cf2e5413e1802a0aafd3428f20b5eaa40efeeb05dde139423bfb8163" +content-hash = "3fbbd4fae77bbb2cf8ed40b293f18eccb8b694cd15d066cdbfc75596bf2e9572" diff --git a/pyproject.toml b/pyproject.toml index 2b1ad79..cd37dd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,6 @@ ml = ["scipy"] visualization = ["matplotlib"] [tool.poetry.group.dev.dependencies] -black = "^24.8.0" mypy = "^1.11.1" pre-commit = "^3.8.0" pytest = "^8.3.2" @@ -33,9 +32,6 @@ build-backend = "poetry.core.masonry.api" warn_unused_configs = true disallow_untyped_defs = true -[tool.black] -target-version = ["py311"] -line-length = 88 - [tool.ruff] -target-version = "py311" \ No newline at end of file +target-version = "py311" +line-length = 88 \ No newline at end of file