diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 11d37e28..00000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,68 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/primer.yml b/.github/workflows/primer.yml index 1832c8be..24d3e85a 100644 --- a/.github/workflows/primer.yml +++ b/.github/workflows/primer.yml @@ -16,29 +16,54 @@ jobs: primer: name: sqlfmt primer runs-on: ubuntu-latest + env: + POETRY_VIRTUALENVS_IN_PROJECT: 1 + POETRY_INSTALLER_PARALLEL: 1 + POETRY_VIRTUALENVS_CREATE: 1 + steps: - name: Check out Repo uses: actions/checkout@v4 - - name: Set up Python 3.10 + with: + persist-credentials: false + + - name: Set up Python 3.8 uses: actions/setup-python@v5 + id: setup-python + with: + python-version: "3.8" + + - name: Load cached Poetry installation + id: cached-poetry-install + uses: actions/cache@v4 with: - python-version: "3.10" + path: ~/.local + key: ${{ runner.os }}-poetry-183 # increment to reset cache + + - name: Add cached Poetry to PATH + if: steps.cached-poetry-install.outputs.cache-hit == 'true' + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install Poetry + if: steps.cached-poetry-install.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 with: - version: 1.2.2 - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true + version: 1.8.3 + - name: Load cached venv id: cached-poetry-dependencies uses: actions/cache@v4 with: path: .venv - key: primer-venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + key: static-venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Install python dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --sync --all-extras --no-interaction --only main + run: | + poetry env use ${{ steps.setup-python.outputs.python-version }} + poetry install --sync --all-extras --no-interaction --only main + poetry env info + - name: Run primer run: | source .venv/bin/activate diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c54a9037..038a03bf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,33 +11,56 @@ jobs: publish-package: if: ${{ github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/v') }} runs-on: ubuntu-latest + environment: publish + env: + POETRY_VIRTUALENVS_IN_PROJECT: 1 + POETRY_INSTALLER_PARALLEL: 1 + POETRY_VIRTUALENVS_CREATE: 1 + permissions: + id-token: write steps: - - name: Check out sqlfmt main branch + - name: Check out project main branch uses: actions/checkout@v4 with: ref: main + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: python-version: "3.10" + + - name: Load cached Poetry installation + id: cached-poetry-install + uses: actions/cache@v4 + with: + path: ~/.local + key: ${{ runner.os }}-poetry-183 # increment to reset cache + + - name: Add cached Poetry to PATH + if: steps.cached-poetry-install.outputs.cache-hit == 'true' + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install Poetry + if: steps.cached-poetry-install.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 with: - version: 1.2.2 - - name: Configure poetry - run: poetry config --no-interaction pypi-token.pypi ${{ secrets.SQLFMT_PYPI_TOKEN }} - - name: Get sqlfmt Version - id: sqlfmt_version - run: echo "sqlfmt_version=$(poetry version --short)" >> $GITHUB_OUTPUT + version: 1.8.3 + + - name: Get project Version + id: project_version + run: echo "project_version=$(poetry version --short)" >> $GITHUB_OUTPUT + - name: Build package run: poetry build --no-interaction + - name: Publish package to PyPI - run: poetry publish --no-interaction + uses: pypa/gh-action-pypi-publish@release/v1 + - name: Create a Github Release uses: softprops/action-gh-release@v2 with: - tag_name: v${{ steps.sqlfmt_version.outputs.sqlfmt_version }} + tag_name: v${{ steps.project_version.outputs.project_version }} target_commitish: main token: ${{ secrets.SQLFMT_RELEASE_TOKEN }} body_path: CHANGELOG.md @@ -67,4 +90,4 @@ jobs: push: true tags: | ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:v${{ steps.sqlfmt_version.outputs.sqlfmt_version }} + ghcr.io/${{ github.repository }}:v${{ steps.project_version.outputs.project_version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index efd9b0c3..883a4163 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,38 +10,65 @@ on: jobs: prepare-release: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + env: + POETRY_VIRTUALENVS_IN_PROJECT: 1 + POETRY_INSTALLER_PARALLEL: 1 + POETRY_VIRTUALENVS_CREATE: 1 steps: - - name: Check out sqlfmt main branch + - name: Check out project main branch uses: actions/checkout@v4 with: ref: main + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: python-version: "3.10" + + - name: Load cached Poetry installation + id: cached-poetry-install + uses: actions/cache@v4 + with: + path: ~/.local + key: ${{ runner.os }}-poetry-171 # increment to reset cache + + - name: Add cached Poetry to PATH + if: steps.cached-poetry-install.outputs.cache-hit == 'true' + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install Poetry + if: steps.cached-poetry-install.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 with: - version: 1.2.2 + version: 1.8.3 + - name: Create release branch run: | git checkout -b release/v${{ github.event.inputs.newVersion }} git push --set-upstream origin release/v${{ github.event.inputs.newVersion }} + - name: Bump version run: poetry version ${{ github.event.inputs.newVersion }} --no-interaction + - name: Ensure package can be built run: poetry build --no-interaction + - name: Update CHANGELOG uses: thomaseizinger/keep-a-changelog-new-release@v3 with: version: ${{ github.event.inputs.newVersion }} + - name: Commit Changes uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Bumps version to ${{ github.event.inputs.newVersion }} + - name: Create pull request into main - uses: thomaseizinger/create-pull-request@1.3.1 + uses: thomaseizinger/create-pull-request@1.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index d62ee4c5..ce366657 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -10,37 +10,57 @@ concurrency: jobs: static: - name: Static Analysis - 3.10 + name: Static Analysis - 3.8 runs-on: ubuntu-latest + env: + POETRY_VIRTUALENVS_IN_PROJECT: 1 + POETRY_INSTALLER_PARALLEL: 1 + POETRY_VIRTUALENVS_CREATE: 1 steps: - name: Check out Repo uses: actions/checkout@v4 with: persist-credentials: false - - name: Set up Python 3.10 + + - name: Set up Python 3.8 uses: actions/setup-python@v5 + id: setup-python with: - python-version: "3.10" + python-version: "3.8" + + - name: Load cached Poetry installation + id: cached-poetry-install + uses: actions/cache@v4 + with: + path: ~/.local + key: ${{ runner.os }}-poetry-183 # increment to reset cache + + - name: Add cached Poetry to PATH + if: steps.cached-poetry-install.outputs.cache-hit == 'true' + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install Poetry + if: steps.cached-poetry-install.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 with: - version: 1.2.2 - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true + version: 1.8.3 + - name: Load cached venv id: cached-poetry-dependencies uses: actions/cache@v4 with: path: .venv key: static-venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Install python dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --sync --no-interaction --all-extras --without dev + run: | + poetry env use ${{ steps.setup-python.outputs.python-version }} + poetry install --sync --no-interaction --all-extras --without dev + poetry env info + - name: Run analysis run: | - source .venv/bin/activate - isort . --check - black . --check - flake8 . - mypy . \ No newline at end of file + poetry run ruff format . --diff + poetry run ruff check . + poetry run mypy --no-incremental diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index fd90707b..da05b901 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -15,42 +15,57 @@ jobs: coverage: name: Test Coverage - 3.10 runs-on: ubuntu-latest + env: + POETRY_VIRTUALENVS_IN_PROJECT: 1 + POETRY_INSTALLER_PARALLEL: 1 + POETRY_VIRTUALENVS_CREATE: 1 steps: - name: Check out Repo uses: actions/checkout@v4 with: persist-credentials: false + - name: Set up Python 3.10 uses: actions/setup-python@v5 + id: setup-python with: python-version: "3.10" - # - name: Load cached Poetry installation - # id: cached-poetry-install - # uses: actions/cache@v3 - # with: - # path: ~/.local - # key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - name: Load cached Poetry installation + id: cached-poetry-install + uses: actions/cache@v4 + with: + path: ~/.local + key: ${{ runner.os }}-poetry-183 # increment to reset cache + + - name: Add cached Poetry to PATH + if: steps.cached-poetry-install.outputs.cache-hit == 'true' + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install Poetry - # if: steps.cached-poetry-install.outputs.cache-hit != 'true' + if: steps.cached-poetry-install.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 with: - version: 1.2.2 - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true - # - name: Load cached venv - # id: cached-poetry-dependencies - # uses: actions/cache@v3 - # with: - # path: .venv - # key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + version: 1.8.3 + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v4 + with: + path: .venv + key: static-venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Install python dependencies - # if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --sync --no-interaction -E jinjafmt --only main,test + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: | + poetry env use ${{ steps.setup-python.outputs.python-version }} + poetry install --sync --no-interaction -E jinjafmt --only main,test + poetry env info + - name: Run unit tests and generate cov report run: | - source .venv/bin/activate - pytest --cov=sqlfmt --cov-report xml:tests/.coverage/cov.xml tests/unit_tests + poetry run pytest --cov=sqlfmt --cov-report xml:tests/.coverage/cov.xml tests/unit_tests + - name: Report coverage to CodeClimate uses: paambaati/codeclimate-action@v6.0.0 env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9fb3037d..ef885a60 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,34 +18,62 @@ jobs: test-windows: name: Windows - 3.9 runs-on: Windows-latest + env: + POETRY_VIRTUALENVS_IN_PROJECT: 1 + POETRY_INSTALLER_PARALLEL: 1 + POETRY_VIRTUALENVS_CREATE: 1 steps: - name: Check out Repo uses: actions/checkout@v4 with: persist-credentials: false + - name: Set up Python 3.9 + id: setup-python uses: actions/setup-python@v5 with: python-version: "3.9" + + - name: Load cached Poetry installation + id: cached-poetry-install + uses: actions/cache@v4 + with: + path: ~\.local + key: ${{ runner.os }}-poetry-183 + + - name: Add cached Poetry to PATH + if: steps.cached-poetry-install.outputs.cache-hit == 'true' + run: echo "$HOME\.local\bin" >> $GITHUB_PATH + - name: Install Poetry + if: steps.cached-poetry-install.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 with: - version: 1.2.2 + version: 1.8.3 + - name: Install python dependencies - run: poetry install --sync --no-interaction -E jinjafmt --only main,test + run: | + poetry install --sync --no-interaction -E jinjafmt --only main,test + - name: Run tests run: poetry run pytest + test: name: ${{ matrix.os }} - ${{ matrix.py }} - runs-on: ${{ matrix.os }}-latest + runs-on: ${{ matrix.os }} + env: + POETRY_VIRTUALENVS_IN_PROJECT: 1 + POETRY_INSTALLER_PARALLEL: 1 + POETRY_VIRTUALENVS_CREATE: 1 strategy: fail-fast: false matrix: os: - - ubuntu - - MacOs + - ubuntu-latest + - MacOs-13 py: + - "3.12" - "3.11" - "3.10" - "3.9" @@ -55,35 +83,43 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false + - name: Set up Python ${{ matrix.py }} id: setup-python uses: actions/setup-python@v5 with: python-version: ${{ matrix.py }} + - name: Load cached Poetry installation id: cached-poetry-install uses: actions/cache@v4 with: path: ~/.local - key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + key: ${{ runner.os }}-poetry-183 + + - name: Add cached Poetry to PATH + if: steps.cached-poetry-install.outputs.cache-hit == 'true' + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install Poetry if: steps.cached-poetry-install.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 with: - version: 1.2.2 - virtualenvs-create: true - virtualenvs-in-project: true - installer-parallel: true + version: 1.8.3 + - name: Load cached venv id: cached-poetry-dependencies uses: actions/cache@v4 with: path: .venv key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Install python dependencies if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --sync --no-interaction -E jinjafmt --only main,test + run: | + poetry env use ${{ steps.setup-python.outputs.python-version }} + poetry install --sync --no-interaction -E jinjafmt --only main,test + - name: Run tests run: | - source .venv/bin/activate - pytest + poetry run pytest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 05aefa53..04c04311 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,28 +1,24 @@ -default_language_version: - python: python3.10 repos: - - repo: https://github.com/psf/black - rev: 23.12.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.5.1 hooks: - - id: black - - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 - hooks: - - id: flake8 - - repo: https://github.com/PyCQA/isort - rev: 5.13.2 - hooks: - - id: isort + - id: ruff-format + - id: ruff + args: [ --fix, --exit-non-zero-on-fix ] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.1 + rev: v1.11.0 hooks: - id: mypy additional_dependencies: - click + - tqdm - platformdirs + - importlib_metadata - tomli - - gitpython + - jinja2 + - black - pytest + - gitpython args: - "--disallow-untyped-calls" - "--disallow-untyped-defs" diff --git a/Makefile b/Makefile index 555bf8b0..5001282b 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,9 @@ .PHONY: check check: - isort . - black . + ruff format . + ruff check . --fix pytest - flake8 . - mypy --disallow-any-unimported + mypy .PHONY: unit unit: @@ -12,11 +11,9 @@ unit: .PHONY: lint lint: - isort . - black . - flake8 . - mypy --disallow-any-unimported - + ruff format . + ruff check . --fix + mypy .PHONY: profiling profiling: .profiling/all.rstats diff --git a/poetry.lock b/poetry.lock index 0b76331e..0f3957e4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "black" @@ -84,63 +84,63 @@ files = [ [[package]] name = "coverage" -version = "7.4.4" +version = "7.6.0" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" files = [ - {file = "coverage-7.4.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0be5efd5127542ef31f165de269f77560d6cdef525fffa446de6f7e9186cfb2"}, - {file = "coverage-7.4.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ccd341521be3d1b3daeb41960ae94a5e87abe2f46f17224ba5d6f2b8398016cf"}, - {file = "coverage-7.4.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09fa497a8ab37784fbb20ab699c246053ac294d13fc7eb40ec007a5043ec91f8"}, - {file = "coverage-7.4.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b1a93009cb80730c9bca5d6d4665494b725b6e8e157c1cb7f2db5b4b122ea562"}, - {file = "coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:690db6517f09336559dc0b5f55342df62370a48f5469fabf502db2c6d1cffcd2"}, - {file = "coverage-7.4.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7"}, - {file = "coverage-7.4.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8ce1415194b4a6bd0cdcc3a1dfbf58b63f910dcb7330fe15bdff542c56949f87"}, - {file = "coverage-7.4.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b91cbc4b195444e7e258ba27ac33769c41b94967919f10037e6355e998af255c"}, - {file = "coverage-7.4.4-cp310-cp310-win32.whl", hash = "sha256:598825b51b81c808cb6f078dcb972f96af96b078faa47af7dfcdf282835baa8d"}, - {file = "coverage-7.4.4-cp310-cp310-win_amd64.whl", hash = "sha256:09ef9199ed6653989ebbcaacc9b62b514bb63ea2f90256e71fea3ed74bd8ff6f"}, - {file = "coverage-7.4.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0f9f50e7ef2a71e2fae92774c99170eb8304e3fdf9c8c3c7ae9bab3e7229c5cf"}, - {file = "coverage-7.4.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:623512f8ba53c422fcfb2ce68362c97945095b864cda94a92edbaf5994201083"}, - {file = "coverage-7.4.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63"}, - {file = "coverage-7.4.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40209e141059b9370a2657c9b15607815359ab3ef9918f0196b6fccce8d3230f"}, - {file = "coverage-7.4.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a2b2b78c78293782fd3767d53e6474582f62443d0504b1554370bde86cc8227"}, - {file = "coverage-7.4.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:73bfb9c09951125d06ee473bed216e2c3742f530fc5acc1383883125de76d9cd"}, - {file = "coverage-7.4.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:1f384c3cc76aeedce208643697fb3e8437604b512255de6d18dae3f27655a384"}, - {file = "coverage-7.4.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:54eb8d1bf7cacfbf2a3186019bcf01d11c666bd495ed18717162f7eb1e9dd00b"}, - {file = "coverage-7.4.4-cp311-cp311-win32.whl", hash = "sha256:cac99918c7bba15302a2d81f0312c08054a3359eaa1929c7e4b26ebe41e9b286"}, - {file = "coverage-7.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:b14706df8b2de49869ae03a5ccbc211f4041750cd4a66f698df89d44f4bd30ec"}, - {file = "coverage-7.4.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:201bef2eea65e0e9c56343115ba3814e896afe6d36ffd37bab783261db430f76"}, - {file = "coverage-7.4.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:41c9c5f3de16b903b610d09650e5e27adbfa7f500302718c9ffd1c12cf9d6818"}, - {file = "coverage-7.4.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d898fe162d26929b5960e4e138651f7427048e72c853607f2b200909794ed978"}, - {file = "coverage-7.4.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3ea79bb50e805cd6ac058dfa3b5c8f6c040cb87fe83de10845857f5535d1db70"}, - {file = "coverage-7.4.4-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce4b94265ca988c3f8e479e741693d143026632672e3ff924f25fab50518dd51"}, - {file = "coverage-7.4.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c"}, - {file = "coverage-7.4.4-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:fdfafb32984684eb03c2d83e1e51f64f0906b11e64482df3c5db936ce3839d48"}, - {file = "coverage-7.4.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:69eb372f7e2ece89f14751fbcbe470295d73ed41ecd37ca36ed2eb47512a6ab9"}, - {file = "coverage-7.4.4-cp312-cp312-win32.whl", hash = "sha256:137eb07173141545e07403cca94ab625cc1cc6bc4c1e97b6e3846270e7e1fea0"}, - {file = "coverage-7.4.4-cp312-cp312-win_amd64.whl", hash = "sha256:d71eec7d83298f1af3326ce0ff1d0ea83c7cb98f72b577097f9083b20bdaf05e"}, - {file = "coverage-7.4.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d5ae728ff3b5401cc320d792866987e7e7e880e6ebd24433b70a33b643bb0384"}, - {file = "coverage-7.4.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cc4f1358cb0c78edef3ed237ef2c86056206bb8d9140e73b6b89fbcfcbdd40e1"}, - {file = "coverage-7.4.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8130a2aa2acb8788e0b56938786c33c7c98562697bf9f4c7d6e8e5e3a0501e4a"}, - {file = "coverage-7.4.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf271892d13e43bc2b51e6908ec9a6a5094a4df1d8af0bfc360088ee6c684409"}, - {file = "coverage-7.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4cdc86d54b5da0df6d3d3a2f0b710949286094c3a6700c21e9015932b81447e"}, - {file = "coverage-7.4.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ae71e7ddb7a413dd60052e90528f2f65270aad4b509563af6d03d53e979feafd"}, - {file = "coverage-7.4.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:38dd60d7bf242c4ed5b38e094baf6401faa114fc09e9e6632374388a404f98e7"}, - {file = "coverage-7.4.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:aa5b1c1bfc28384f1f53b69a023d789f72b2e0ab1b3787aae16992a7ca21056c"}, - {file = "coverage-7.4.4-cp38-cp38-win32.whl", hash = "sha256:dfa8fe35a0bb90382837b238fff375de15f0dcdb9ae68ff85f7a63649c98527e"}, - {file = "coverage-7.4.4-cp38-cp38-win_amd64.whl", hash = "sha256:b2991665420a803495e0b90a79233c1433d6ed77ef282e8e152a324bbbc5e0c8"}, - {file = "coverage-7.4.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3b799445b9f7ee8bf299cfaed6f5b226c0037b74886a4e11515e569b36fe310d"}, - {file = "coverage-7.4.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b4d33f418f46362995f1e9d4f3a35a1b6322cb959c31d88ae56b0298e1c22357"}, - {file = "coverage-7.4.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aadacf9a2f407a4688d700e4ebab33a7e2e408f2ca04dbf4aef17585389eff3e"}, - {file = "coverage-7.4.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7c95949560050d04d46b919301826525597f07b33beba6187d04fa64d47ac82e"}, - {file = "coverage-7.4.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ff7687ca3d7028d8a5f0ebae95a6e4827c5616b31a4ee1192bdfde697db110d4"}, - {file = "coverage-7.4.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5fc1de20b2d4a061b3df27ab9b7c7111e9a710f10dc2b84d33a4ab25065994ec"}, - {file = "coverage-7.4.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:c74880fc64d4958159fbd537a091d2a585448a8f8508bf248d72112723974cbd"}, - {file = "coverage-7.4.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:742a76a12aa45b44d236815d282b03cfb1de3b4323f3e4ec933acfae08e54ade"}, - {file = "coverage-7.4.4-cp39-cp39-win32.whl", hash = "sha256:d89d7b2974cae412400e88f35d86af72208e1ede1a541954af5d944a8ba46c57"}, - {file = "coverage-7.4.4-cp39-cp39-win_amd64.whl", hash = "sha256:9ca28a302acb19b6af89e90f33ee3e1906961f94b54ea37de6737b7ca9d8827c"}, - {file = "coverage-7.4.4-pp38.pp39.pp310-none-any.whl", hash = "sha256:b2c5edc4ac10a7ef6605a966c58929ec6c1bd0917fb8c15cb3363f65aa40e677"}, - {file = "coverage-7.4.4.tar.gz", hash = "sha256:c901df83d097649e257e803be22592aedfd5182f07b3cc87d640bbb9afd50f49"}, + {file = "coverage-7.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dff044f661f59dace805eedb4a7404c573b6ff0cdba4a524141bc63d7be5c7fd"}, + {file = "coverage-7.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a8659fd33ee9e6ca03950cfdcdf271d645cf681609153f218826dd9805ab585c"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7792f0ab20df8071d669d929c75c97fecfa6bcab82c10ee4adb91c7a54055463"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d4b3cd1ca7cd73d229487fa5caca9e4bc1f0bca96526b922d61053ea751fe791"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7e128f85c0b419907d1f38e616c4f1e9f1d1b37a7949f44df9a73d5da5cd53c"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a94925102c89247530ae1dab7dc02c690942566f22e189cbd53579b0693c0783"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:dcd070b5b585b50e6617e8972f3fbbee786afca71b1936ac06257f7e178f00f6"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d50a252b23b9b4dfeefc1f663c568a221092cbaded20a05a11665d0dbec9b8fb"}, + {file = "coverage-7.6.0-cp310-cp310-win32.whl", hash = "sha256:0e7b27d04131c46e6894f23a4ae186a6a2207209a05df5b6ad4caee6d54a222c"}, + {file = "coverage-7.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:54dece71673b3187c86226c3ca793c5f891f9fc3d8aa183f2e3653da18566169"}, + {file = "coverage-7.6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7b525ab52ce18c57ae232ba6f7010297a87ced82a2383b1afd238849c1ff933"}, + {file = "coverage-7.6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bea27c4269234e06f621f3fac3925f56ff34bc14521484b8f66a580aacc2e7d"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed8d1d1821ba5fc88d4a4f45387b65de52382fa3ef1f0115a4f7a20cdfab0e94"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01c322ef2bbe15057bc4bf132b525b7e3f7206f071799eb8aa6ad1940bcf5fb1"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03cafe82c1b32b770a29fd6de923625ccac3185a54a5e66606da26d105f37dac"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0d1b923fc4a40c5832be4f35a5dab0e5ff89cddf83bb4174499e02ea089daf57"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4b03741e70fb811d1a9a1d75355cf391f274ed85847f4b78e35459899f57af4d"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a73d18625f6a8a1cbb11eadc1d03929f9510f4131879288e3f7922097a429f63"}, + {file = "coverage-7.6.0-cp311-cp311-win32.whl", hash = "sha256:65fa405b837060db569a61ec368b74688f429b32fa47a8929a7a2f9b47183713"}, + {file = "coverage-7.6.0-cp311-cp311-win_amd64.whl", hash = "sha256:6379688fb4cfa921ae349c76eb1a9ab26b65f32b03d46bb0eed841fd4cb6afb1"}, + {file = "coverage-7.6.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f7db0b6ae1f96ae41afe626095149ecd1b212b424626175a6633c2999eaad45b"}, + {file = "coverage-7.6.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bbdf9a72403110a3bdae77948b8011f644571311c2fb35ee15f0f10a8fc082e8"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc44bf0315268e253bf563f3560e6c004efe38f76db03a1558274a6e04bf5d5"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:da8549d17489cd52f85a9829d0e1d91059359b3c54a26f28bec2c5d369524807"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0086cd4fc71b7d485ac93ca4239c8f75732c2ae3ba83f6be1c9be59d9e2c6382"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1fad32ee9b27350687035cb5fdf9145bc9cf0a094a9577d43e909948ebcfa27b"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:044a0985a4f25b335882b0966625270a8d9db3d3409ddc49a4eb00b0ef5e8cee"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:76d5f82213aa78098b9b964ea89de4617e70e0d43e97900c2778a50856dac605"}, + {file = "coverage-7.6.0-cp312-cp312-win32.whl", hash = "sha256:3c59105f8d58ce500f348c5b56163a4113a440dad6daa2294b5052a10db866da"}, + {file = "coverage-7.6.0-cp312-cp312-win_amd64.whl", hash = "sha256:ca5d79cfdae420a1d52bf177de4bc2289c321d6c961ae321503b2ca59c17ae67"}, + {file = "coverage-7.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d39bd10f0ae453554798b125d2f39884290c480f56e8a02ba7a6ed552005243b"}, + {file = "coverage-7.6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:beb08e8508e53a568811016e59f3234d29c2583f6b6e28572f0954a6b4f7e03d"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2e16f4cd2bc4d88ba30ca2d3bbf2f21f00f382cf4e1ce3b1ddc96c634bc48ca"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6616d1c9bf1e3faea78711ee42a8b972367d82ceae233ec0ac61cc7fec09fa6b"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad4567d6c334c46046d1c4c20024de2a1c3abc626817ae21ae3da600f5779b44"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d17c6a415d68cfe1091d3296ba5749d3d8696e42c37fca5d4860c5bf7b729f03"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:9146579352d7b5f6412735d0f203bbd8d00113a680b66565e205bc605ef81bc6"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:cdab02a0a941af190df8782aafc591ef3ad08824f97850b015c8c6a8b3877b0b"}, + {file = "coverage-7.6.0-cp38-cp38-win32.whl", hash = "sha256:df423f351b162a702c053d5dddc0fc0ef9a9e27ea3f449781ace5f906b664428"}, + {file = "coverage-7.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:f2501d60d7497fd55e391f423f965bbe9e650e9ffc3c627d5f0ac516026000b8"}, + {file = "coverage-7.6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7221f9ac9dad9492cecab6f676b3eaf9185141539d5c9689d13fd6b0d7de840c"}, + {file = "coverage-7.6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ddaaa91bfc4477d2871442bbf30a125e8fe6b05da8a0015507bfbf4718228ab2"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4cbe651f3904e28f3a55d6f371203049034b4ddbce65a54527a3f189ca3b390"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:831b476d79408ab6ccfadaaf199906c833f02fdb32c9ab907b1d4aa0713cfa3b"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:46c3d091059ad0b9c59d1034de74a7f36dcfa7f6d3bde782c49deb42438f2450"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4d5fae0a22dc86259dee66f2cc6c1d3e490c4a1214d7daa2a93d07491c5c04b6"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:07ed352205574aad067482e53dd606926afebcb5590653121063fbf4e2175166"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:49c76cdfa13015c4560702574bad67f0e15ca5a2872c6a125f6327ead2b731dd"}, + {file = "coverage-7.6.0-cp39-cp39-win32.whl", hash = "sha256:482855914928c8175735a2a59c8dc5806cf7d8f032e4820d52e845d1f731dca2"}, + {file = "coverage-7.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:543ef9179bc55edfd895154a51792b01c017c87af0ebaae092720152e19e42ca"}, + {file = "coverage-7.6.0-pp38.pp39.pp310-none-any.whl", hash = "sha256:6fe885135c8a479d3e37a7aae61cbd3a0fb2deccb4dda3c25f92a49189f766d6"}, + {file = "coverage-7.6.0.tar.gz", hash = "sha256:289cc803fa1dc901f84701ac10c9ee873619320f2f9aff38794db4a4a0268d51"}, ] [package.dependencies] @@ -162,13 +162,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.2.0" +version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, - {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, ] [package.extras] @@ -176,36 +176,20 @@ test = ["pytest (>=6)"] [[package]] name = "filelock" -version = "3.13.4" +version = "3.15.4" description = "A platform independent file lock." optional = false python-versions = ">=3.8" files = [ - {file = "filelock-3.13.4-py3-none-any.whl", hash = "sha256:404e5e9253aa60ad457cae1be07c0f0ca90a63931200a47d9b6a6af84fd7b45f"}, - {file = "filelock-3.13.4.tar.gz", hash = "sha256:d13f466618bfde72bd2c18255e269f72542c6e70e7bac83a0232d6b1cc5c8cf4"}, + {file = "filelock-3.15.4-py3-none-any.whl", hash = "sha256:6ca1fffae96225dab4c6eaf1c4f4f28cd2568d3ec2a44e15a08520504de468e7"}, + {file = "filelock-3.15.4.tar.gz", hash = "sha256:2207938cbc1844345cb01a5a95524dae30f0ce089eba5b00378295a17e3e90cb"}, ] [package.extras] docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pytest-asyncio (>=0.21)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)", "virtualenv (>=20.26.2)"] typing = ["typing-extensions (>=4.8)"] -[[package]] -name = "flake8" -version = "5.0.4" -description = "the modular source code checker: pep8 pyflakes and co" -optional = false -python-versions = ">=3.6.1" -files = [ - {file = "flake8-5.0.4-py2.py3-none-any.whl", hash = "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248"}, - {file = "flake8-5.0.4.tar.gz", hash = "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db"}, -] - -[package.dependencies] -mccabe = ">=0.7.0,<0.8.0" -pycodestyle = ">=2.9.0,<2.10.0" -pyflakes = ">=2.5.0,<2.6.0" - [[package]] name = "gitdb" version = "4.0.11" @@ -240,13 +224,13 @@ test = ["coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock", "mypy", "pre-commit", [[package]] name = "identify" -version = "2.5.35" +version = "2.6.0" description = "File identification library for Python" optional = false python-versions = ">=3.8" files = [ - {file = "identify-2.5.35-py2.py3-none-any.whl", hash = "sha256:c4de0081837b211594f8e877a6b4fad7ca32bbfc1a9307fdd61c28bfe923f13e"}, - {file = "identify-2.5.35.tar.gz", hash = "sha256:10a7ca245cfcd756a554a7288159f72ff105ad233c7c4b9c6f0f4d108f5f6791"}, + {file = "identify-2.6.0-py2.py3-none-any.whl", hash = "sha256:e79ae4406387a9d300332b5fd366d8994f1525e8414984e1a59e058b2eda2dd0"}, + {file = "identify-2.6.0.tar.gz", hash = "sha256:cb171c685bdc31bcc4c1734698736a7d5b6c8bf2e0c15117f4d469c8640ae5cf"}, ] [package.extras] @@ -263,20 +247,6 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] -[[package]] -name = "isort" -version = "5.13.2" -description = "A Python utility / library to sort Python imports." -optional = false -python-versions = ">=3.8.0" -files = [ - {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, - {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, -] - -[package.extras] -colors = ["colorama (>=0.4.6)"] - [[package]] name = "jinja2" version = "3.1.4" @@ -363,57 +333,46 @@ files = [ {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, ] -[[package]] -name = "mccabe" -version = "0.7.0" -description = "McCabe checker, plugin for flake8" -optional = false -python-versions = ">=3.6" -files = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, -] - [[package]] name = "mypy" -version = "1.10.0" +version = "1.11.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" files = [ - {file = "mypy-1.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:da1cbf08fb3b851ab3b9523a884c232774008267b1f83371ace57f412fe308c2"}, - {file = "mypy-1.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:12b6bfc1b1a66095ab413160a6e520e1dc076a28f3e22f7fb25ba3b000b4ef99"}, - {file = "mypy-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9e36fb078cce9904c7989b9693e41cb9711e0600139ce3970c6ef814b6ebc2b2"}, - {file = "mypy-1.10.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2b0695d605ddcd3eb2f736cd8b4e388288c21e7de85001e9f85df9187f2b50f9"}, - {file = "mypy-1.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:cd777b780312ddb135bceb9bc8722a73ec95e042f911cc279e2ec3c667076051"}, - {file = "mypy-1.10.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3be66771aa5c97602f382230165b856c231d1277c511c9a8dd058be4784472e1"}, - {file = "mypy-1.10.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8b2cbaca148d0754a54d44121b5825ae71868c7592a53b7292eeb0f3fdae95ee"}, - {file = "mypy-1.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ec404a7cbe9fc0e92cb0e67f55ce0c025014e26d33e54d9e506a0f2d07fe5de"}, - {file = "mypy-1.10.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e22e1527dc3d4aa94311d246b59e47f6455b8729f4968765ac1eacf9a4760bc7"}, - {file = "mypy-1.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:a87dbfa85971e8d59c9cc1fcf534efe664d8949e4c0b6b44e8ca548e746a8d53"}, - {file = "mypy-1.10.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a781f6ad4bab20eef8b65174a57e5203f4be627b46291f4589879bf4e257b97b"}, - {file = "mypy-1.10.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b808e12113505b97d9023b0b5e0c0705a90571c6feefc6f215c1df9381256e30"}, - {file = "mypy-1.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f55583b12156c399dce2df7d16f8a5095291354f1e839c252ec6c0611e86e2e"}, - {file = "mypy-1.10.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4cf18f9d0efa1b16478c4c129eabec36148032575391095f73cae2e722fcf9d5"}, - {file = "mypy-1.10.0-cp312-cp312-win_amd64.whl", hash = "sha256:bc6ac273b23c6b82da3bb25f4136c4fd42665f17f2cd850771cb600bdd2ebeda"}, - {file = "mypy-1.10.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9fd50226364cd2737351c79807775136b0abe084433b55b2e29181a4c3c878c0"}, - {file = "mypy-1.10.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f90cff89eea89273727d8783fef5d4a934be2fdca11b47def50cf5d311aff727"}, - {file = "mypy-1.10.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fcfc70599efde5c67862a07a1aaf50e55bce629ace26bb19dc17cece5dd31ca4"}, - {file = "mypy-1.10.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:075cbf81f3e134eadaf247de187bd604748171d6b79736fa9b6c9685b4083061"}, - {file = "mypy-1.10.0-cp38-cp38-win_amd64.whl", hash = "sha256:3f298531bca95ff615b6e9f2fc0333aae27fa48052903a0ac90215021cdcfa4f"}, - {file = "mypy-1.10.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fa7ef5244615a2523b56c034becde4e9e3f9b034854c93639adb667ec9ec2976"}, - {file = "mypy-1.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3236a4c8f535a0631f85f5fcdffba71c7feeef76a6002fcba7c1a8e57c8be1ec"}, - {file = "mypy-1.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a2b5cdbb5dd35aa08ea9114436e0d79aceb2f38e32c21684dcf8e24e1e92821"}, - {file = "mypy-1.10.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:92f93b21c0fe73dc00abf91022234c79d793318b8a96faac147cd579c1671746"}, - {file = "mypy-1.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:28d0e038361b45f099cc086d9dd99c15ff14d0188f44ac883010e172ce86c38a"}, - {file = "mypy-1.10.0-py3-none-any.whl", hash = "sha256:f8c083976eb530019175aabadb60921e73b4f45736760826aa1689dda8208aee"}, - {file = "mypy-1.10.0.tar.gz", hash = "sha256:3d087fcbec056c4ee34974da493a826ce316947485cef3901f511848e687c131"}, + {file = "mypy-1.11.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a3824187c99b893f90c845bab405a585d1ced4ff55421fdf5c84cb7710995229"}, + {file = "mypy-1.11.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:96f8dbc2c85046c81bcddc246232d500ad729cb720da4e20fce3b542cab91287"}, + {file = "mypy-1.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1a5d8d8dd8613a3e2be3eae829ee891b6b2de6302f24766ff06cb2875f5be9c6"}, + {file = "mypy-1.11.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:72596a79bbfb195fd41405cffa18210af3811beb91ff946dbcb7368240eed6be"}, + {file = "mypy-1.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:35ce88b8ed3a759634cb4eb646d002c4cef0a38f20565ee82b5023558eb90c00"}, + {file = "mypy-1.11.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:98790025861cb2c3db8c2f5ad10fc8c336ed2a55f4daf1b8b3f877826b6ff2eb"}, + {file = "mypy-1.11.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:25bcfa75b9b5a5f8d67147a54ea97ed63a653995a82798221cca2a315c0238c1"}, + {file = "mypy-1.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0bea2a0e71c2a375c9fa0ede3d98324214d67b3cbbfcbd55ac8f750f85a414e3"}, + {file = "mypy-1.11.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d2b3d36baac48e40e3064d2901f2fbd2a2d6880ec6ce6358825c85031d7c0d4d"}, + {file = "mypy-1.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:d8e2e43977f0e09f149ea69fd0556623919f816764e26d74da0c8a7b48f3e18a"}, + {file = "mypy-1.11.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:1d44c1e44a8be986b54b09f15f2c1a66368eb43861b4e82573026e04c48a9e20"}, + {file = "mypy-1.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cea3d0fb69637944dd321f41bc896e11d0fb0b0aa531d887a6da70f6e7473aba"}, + {file = "mypy-1.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a83ec98ae12d51c252be61521aa5731f5512231d0b738b4cb2498344f0b840cd"}, + {file = "mypy-1.11.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:c7b73a856522417beb78e0fb6d33ef89474e7a622db2653bc1285af36e2e3e3d"}, + {file = "mypy-1.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:f2268d9fcd9686b61ab64f077be7ffbc6fbcdfb4103e5dd0cc5eaab53a8886c2"}, + {file = "mypy-1.11.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:940bfff7283c267ae6522ef926a7887305945f716a7704d3344d6d07f02df850"}, + {file = "mypy-1.11.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:14f9294528b5f5cf96c721f231c9f5b2733164e02c1c018ed1a0eff8a18005ac"}, + {file = "mypy-1.11.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d7b54c27783991399046837df5c7c9d325d921394757d09dbcbf96aee4649fe9"}, + {file = "mypy-1.11.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:65f190a6349dec29c8d1a1cd4aa71284177aee5949e0502e6379b42873eddbe7"}, + {file = "mypy-1.11.0-cp38-cp38-win_amd64.whl", hash = "sha256:dbe286303241fea8c2ea5466f6e0e6a046a135a7e7609167b07fd4e7baf151bf"}, + {file = "mypy-1.11.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:104e9c1620c2675420abd1f6c44bab7dd33cc85aea751c985006e83dcd001095"}, + {file = "mypy-1.11.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f006e955718ecd8d159cee9932b64fba8f86ee6f7728ca3ac66c3a54b0062abe"}, + {file = "mypy-1.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:becc9111ca572b04e7e77131bc708480cc88a911adf3d0239f974c034b78085c"}, + {file = "mypy-1.11.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6801319fe76c3f3a3833f2b5af7bd2c17bb93c00026a2a1b924e6762f5b19e13"}, + {file = "mypy-1.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:c1a184c64521dc549324ec6ef7cbaa6b351912be9cb5edb803c2808a0d7e85ac"}, + {file = "mypy-1.11.0-py3-none-any.whl", hash = "sha256:56913ec8c7638b0091ef4da6fcc9136896914a9d60d54670a75880c3e5b99ace"}, + {file = "mypy-1.11.0.tar.gz", hash = "sha256:93743608c7348772fdc717af4aeee1997293a1ad04bc0ea6efa15bf65385c538"}, ] [package.dependencies] mypy-extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.1.0" +typing-extensions = ">=4.6.0" [package.extras] dmypy = ["psutil (>=4.0)"] @@ -434,27 +393,24 @@ files = [ [[package]] name = "nodeenv" -version = "1.8.0" +version = "1.9.1" description = "Node.js virtual environment builder" optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ - {file = "nodeenv-1.8.0-py2.py3-none-any.whl", hash = "sha256:df865724bb3c3adc86b3876fa209771517b0cfe596beff01a92700e0e8be4cec"}, - {file = "nodeenv-1.8.0.tar.gz", hash = "sha256:d51e0c37e64fbf47d017feac3145cdbb58836d7eee8c6f6d3b6880c5456227d2"}, + {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"}, + {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, ] -[package.dependencies] -setuptools = "*" - [[package]] name = "packaging" -version = "24.0" +version = "24.1" description = "Core utilities for Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"}, - {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"}, + {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, + {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, ] [[package]] @@ -470,13 +426,13 @@ files = [ [[package]] name = "platformdirs" -version = "4.2.1" +version = "4.2.2" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" files = [ - {file = "platformdirs-4.2.1-py3-none-any.whl", hash = "sha256:17d5a1161b3fd67b390023cb2d3b026bbd40abde6fdb052dfbd3a29c3ba22ee1"}, - {file = "platformdirs-4.2.1.tar.gz", hash = "sha256:031cd18d4ec63ec53e82dceaac0417d218a6863f7745dfcc9efe7793b7039bdf"}, + {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, + {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, ] [package.extras] @@ -517,37 +473,15 @@ nodeenv = ">=0.11.1" pyyaml = ">=5.1" virtualenv = ">=20.10.0" -[[package]] -name = "pycodestyle" -version = "2.9.1" -description = "Python style guide checker" -optional = false -python-versions = ">=3.6" -files = [ - {file = "pycodestyle-2.9.1-py2.py3-none-any.whl", hash = "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b"}, - {file = "pycodestyle-2.9.1.tar.gz", hash = "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785"}, -] - -[[package]] -name = "pyflakes" -version = "2.5.0" -description = "passive checker of Python programs" -optional = false -python-versions = ">=3.6" -files = [ - {file = "pyflakes-2.5.0-py2.py3-none-any.whl", hash = "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2"}, - {file = "pyflakes-2.5.0.tar.gz", hash = "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3"}, -] - [[package]] name = "pytest" -version = "8.2.0" +version = "8.3.2" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.8" files = [ - {file = "pytest-8.2.0-py3-none-any.whl", hash = "sha256:1733f0620f6cda4095bbf0d9ff8022486e91892245bb9e7d5542c018f612f233"}, - {file = "pytest-8.2.0.tar.gz", hash = "sha256:d507d4482197eac0ba2bae2e9babf0672eb333017bcedaa5fb1a3d42c1174b3f"}, + {file = "pytest-8.3.2-py3-none-any.whl", hash = "sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5"}, + {file = "pytest-8.3.2.tar.gz", hash = "sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce"}, ] [package.dependencies] @@ -555,7 +489,7 @@ colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" -pluggy = ">=1.5,<2.0" +pluggy = ">=1.5,<2" tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] @@ -640,21 +574,32 @@ files = [ ] [[package]] -name = "setuptools" -version = "69.2.0" -description = "Easily download, build, install, upgrade, and uninstall Python packages" +name = "ruff" +version = "0.5.5" +description = "An extremely fast Python linter and code formatter, written in Rust." optional = false -python-versions = ">=3.8" +python-versions = ">=3.7" files = [ - {file = "setuptools-69.2.0-py3-none-any.whl", hash = "sha256:c21c49fb1042386df081cb5d86759792ab89efca84cf114889191cd09aacc80c"}, - {file = "setuptools-69.2.0.tar.gz", hash = "sha256:0ff4183f8f42cd8fa3acea16c45205521a4ef28f73c6391d8a25e92893134f2e"}, + {file = "ruff-0.5.5-py3-none-linux_armv6l.whl", hash = "sha256:605d589ec35d1da9213a9d4d7e7a9c761d90bba78fc8790d1c5e65026c1b9eaf"}, + {file = "ruff-0.5.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:00817603822a3e42b80f7c3298c8269e09f889ee94640cd1fc7f9329788d7bf8"}, + {file = "ruff-0.5.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:187a60f555e9f865a2ff2c6984b9afeffa7158ba6e1eab56cb830404c942b0f3"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fe26fc46fa8c6e0ae3f47ddccfbb136253c831c3289bba044befe68f467bfb16"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4ad25dd9c5faac95c8e9efb13e15803cd8bbf7f4600645a60ffe17c73f60779b"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f70737c157d7edf749bcb952d13854e8f745cec695a01bdc6e29c29c288fc36e"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:cfd7de17cef6ab559e9f5ab859f0d3296393bc78f69030967ca4d87a541b97a0"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a09b43e02f76ac0145f86a08e045e2ea452066f7ba064fd6b0cdccb486f7c3e7"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d0b856cb19c60cd40198be5d8d4b556228e3dcd545b4f423d1ad812bfdca5884"}, + {file = "ruff-0.5.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3687d002f911e8a5faf977e619a034d159a8373514a587249cc00f211c67a091"}, + {file = "ruff-0.5.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ac9dc814e510436e30d0ba535f435a7f3dc97f895f844f5b3f347ec8c228a523"}, + {file = "ruff-0.5.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:af9bdf6c389b5add40d89b201425b531e0a5cceb3cfdcc69f04d3d531c6be74f"}, + {file = "ruff-0.5.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d40a8533ed545390ef8315b8e25c4bb85739b90bd0f3fe1280a29ae364cc55d8"}, + {file = "ruff-0.5.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:cab904683bf9e2ecbbe9ff235bfe056f0eba754d0168ad5407832928d579e7ab"}, + {file = "ruff-0.5.5-py3-none-win32.whl", hash = "sha256:696f18463b47a94575db635ebb4c178188645636f05e934fdf361b74edf1bb2d"}, + {file = "ruff-0.5.5-py3-none-win_amd64.whl", hash = "sha256:50f36d77f52d4c9c2f1361ccbfbd09099a1b2ea5d2b2222c586ab08885cf3445"}, + {file = "ruff-0.5.5-py3-none-win_arm64.whl", hash = "sha256:3191317d967af701f1b73a31ed5788795936e423b7acce82a2b63e26eb3e89d6"}, + {file = "ruff-0.5.5.tar.gz", hash = "sha256:cc5516bdb4858d972fbc31d246bdb390eab8df1a26e2353be2dbc0c2d7f5421a"}, ] -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - [[package]] name = "smmap" version = "5.0.1" @@ -693,33 +638,33 @@ files = [ [[package]] name = "tornado" -version = "6.4" +version = "6.4.1" description = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed." optional = false -python-versions = ">= 3.8" +python-versions = ">=3.8" files = [ - {file = "tornado-6.4-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:02ccefc7d8211e5a7f9e8bc3f9e5b0ad6262ba2fbb683a6443ecc804e5224ce0"}, - {file = "tornado-6.4-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:27787de946a9cffd63ce5814c33f734c627a87072ec7eed71f7fc4417bb16263"}, - {file = "tornado-6.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f7894c581ecdcf91666a0912f18ce5e757213999e183ebfc2c3fdbf4d5bd764e"}, - {file = "tornado-6.4-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e43bc2e5370a6a8e413e1e1cd0c91bedc5bd62a74a532371042a18ef19e10579"}, - {file = "tornado-6.4-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f0251554cdd50b4b44362f73ad5ba7126fc5b2c2895cc62b14a1c2d7ea32f212"}, - {file = "tornado-6.4-cp38-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:fd03192e287fbd0899dd8f81c6fb9cbbc69194d2074b38f384cb6fa72b80e9c2"}, - {file = "tornado-6.4-cp38-abi3-musllinux_1_1_i686.whl", hash = "sha256:88b84956273fbd73420e6d4b8d5ccbe913c65d31351b4c004ae362eba06e1f78"}, - {file = "tornado-6.4-cp38-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:71ddfc23a0e03ef2df1c1397d859868d158c8276a0603b96cf86892bff58149f"}, - {file = "tornado-6.4-cp38-abi3-win32.whl", hash = "sha256:6f8a6c77900f5ae93d8b4ae1196472d0ccc2775cc1dfdc9e7727889145c45052"}, - {file = "tornado-6.4-cp38-abi3-win_amd64.whl", hash = "sha256:10aeaa8006333433da48dec9fe417877f8bcc21f48dda8d661ae79da357b2a63"}, - {file = "tornado-6.4.tar.gz", hash = "sha256:72291fa6e6bc84e626589f1c29d90a5a6d593ef5ae68052ee2ef000dfd273dee"}, + {file = "tornado-6.4.1-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:163b0aafc8e23d8cdc3c9dfb24c5368af84a81e3364745ccb4427669bf84aec8"}, + {file = "tornado-6.4.1-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:6d5ce3437e18a2b66fbadb183c1d3364fb03f2be71299e7d10dbeeb69f4b2a14"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e2e20b9113cd7293f164dc46fffb13535266e713cdb87bd2d15ddb336e96cfc4"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ae50a504a740365267b2a8d1a90c9fbc86b780a39170feca9bcc1787ff80842"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:613bf4ddf5c7a95509218b149b555621497a6cc0d46ac341b30bd9ec19eac7f3"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:25486eb223babe3eed4b8aecbac33b37e3dd6d776bc730ca14e1bf93888b979f"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:454db8a7ecfcf2ff6042dde58404164d969b6f5d58b926da15e6b23817950fc4"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a02a08cc7a9314b006f653ce40483b9b3c12cda222d6a46d4ac63bb6c9057698"}, + {file = "tornado-6.4.1-cp38-abi3-win32.whl", hash = "sha256:d9a566c40b89757c9aa8e6f032bcdb8ca8795d7c1a9762910c722b1635c9de4d"}, + {file = "tornado-6.4.1-cp38-abi3-win_amd64.whl", hash = "sha256:b24b8982ed444378d7f21d563f4180a2de31ced9d8d84443907a0a64da2072e7"}, + {file = "tornado-6.4.1.tar.gz", hash = "sha256:92d3ab53183d8c50f8204a51e6f91d18a15d5ef261e84d452800d4ff6fc504e9"}, ] [[package]] name = "tqdm" -version = "4.66.3" +version = "4.66.4" description = "Fast, Extensible Progress Meter" optional = false python-versions = ">=3.7" files = [ - {file = "tqdm-4.66.3-py3-none-any.whl", hash = "sha256:4f41d54107ff9a223dca80b53efe4fb654c67efaba7f47bada3ee9d50e05bd53"}, - {file = "tqdm-4.66.3.tar.gz", hash = "sha256:23097a41eba115ba99ecae40d06444c15d1c0c698d527a01c6c8bd1c5d0647e5"}, + {file = "tqdm-4.66.4-py3-none-any.whl", hash = "sha256:b75ca56b413b030bc3f00af51fd2c1a1a5eac6a0c1cca83cbb37a5c52abce644"}, + {file = "tqdm-4.66.4.tar.gz", hash = "sha256:e4d936c9de8727928f3be6079590e97d9abfe8d39a590be678eb5919ffc186bb"}, ] [package.dependencies] @@ -733,24 +678,24 @@ telegram = ["requests"] [[package]] name = "typing-extensions" -version = "4.11.0" +version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.11.0-py3-none-any.whl", hash = "sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a"}, - {file = "typing_extensions-4.11.0.tar.gz", hash = "sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0"}, + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] [[package]] name = "virtualenv" -version = "20.25.1" +version = "20.26.3" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.25.1-py3-none-any.whl", hash = "sha256:961c026ac520bac5f69acb8ea063e8a4f071bcc9457b9c1f28f6b085c511583a"}, - {file = "virtualenv-20.25.1.tar.gz", hash = "sha256:e08e13ecdca7a0bd53798f356d5831434afa5b07b93f0abdf0797b7a06ffe197"}, + {file = "virtualenv-20.26.3-py3-none-any.whl", hash = "sha256:8cc4a31139e796e9a7de2cd5cf2489de1217193116a8fd42328f1bd65f434589"}, + {file = "virtualenv-20.26.3.tar.gz", hash = "sha256:4c43a2a236279d9ea36a0d76f98d84bd6ca94ac4e0f4a3b9d46d05e10fea542a"}, ] [package.dependencies] @@ -759,7 +704,7 @@ filelock = ">=3.12.2,<4" platformdirs = ">=3.9.1,<5" [package.extras] -docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] [extras] @@ -769,4 +714,4 @@ sqlfmt-primer = ["gitpython"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "b05d623fd0140c735a028c006167f9e6ccd2e4bb4b6a299e7ba5a741df835722" +content-hash = "6e25bc7fcdfef274f2a57a58fac88bc7b4ed79856db65b1d4ce4e13569ef82f7" diff --git a/pyproject.toml b/pyproject.toml index f7b289c1..f71ffa07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,16 +44,15 @@ gitpython = { version = "^3.1.24", optional = true } [tool.poetry.group.dev.dependencies] pre-commit = ">=2.20,<4.0" snakeviz = "^2.1.1" -black = "^24" [tool.poetry.group.static.dependencies] -flake8 = "^5.0.4" -isort = "^5.9.3" -mypy = ">=0.990,<1.11" +ruff = "^0.5" +mypy = "^1.11" [tool.poetry.group.test.dependencies] -pytest = ">=7.2,<9.0" -pytest-cov = ">=4,<6" +black = "^24" +pytest = "^8" +pytest-cov = "^5" [tool.poetry.scripts] sqlfmt = "sqlfmt.cli:sqlfmt" @@ -63,11 +62,40 @@ sqlfmt_primer = { callable = "sqlfmt_primer.primer:sqlfmt_primer", extras = ["sq line-length = 88 target-version = ["py38"] -[tool.isort] -multi_line_output = 3 -include_trailing_comma = true -force_grid_wrap = 0 -use_parentheses = true -ensure_newline_before_comments = true -line_length = 88 -src_paths = ["src/sqlfmt", "tests"] +[tool.ruff] +line-length = 88 +target-version = "py38" + +[tool.ruff.lint] +select = ["A", "B", "E", "F", "I"] + +[tool.mypy] +python_version = "3.8" +files = [ + "src/**/*.py", + "tests/**/*.py", +] +mypy_path = "stubs,src" + +show_column_numbers = true + +# show error messages from unrelated files +follow_imports = "normal" + +# be strict +disallow_untyped_calls = true +disallow_untyped_defs = true +check_untyped_defs = true +disallow_untyped_decorators = true +disallow_incomplete_defs = true +disallow_subclassing_any = true +strict_optional = true + +warn_return_any = true +warn_no_return = true +warn_redundant_casts = true +warn_unused_ignores = true +warn_unused_configs = true + +no_implicit_reexport = true +strict_equality = true \ No newline at end of file diff --git a/src/sqlfmt/analyzer.py b/src/sqlfmt/analyzer.py index 7843f45a..faeb02ad 100644 --- a/src/sqlfmt/analyzer.py +++ b/src/sqlfmt/analyzer.py @@ -117,8 +117,8 @@ def get_rule(self, rule_name: str) -> Rule: matching_rules = filter(lambda rule: rule.name == rule_name, self.rules) try: return next(matching_rules) - except StopIteration: - raise ValueError(f"No rule '{rule_name}'") + except StopIteration as e: + raise ValueError(f"No rule '{rule_name}'") from e def lex_one(self, source_string: str) -> None: """ diff --git a/src/sqlfmt/api.py b/src/sqlfmt/api.py index 24d44196..a87209dd 100755 --- a/src/sqlfmt/api.py +++ b/src/sqlfmt/api.py @@ -326,7 +326,7 @@ def _read_path_or_stdin(path: Path, mode: Mode) -> Tuple[str, str, str]: "with the --encoding option. Or set --encoding to 'none' to " "use the system default encoding. We suggest always using " "utf-8 for all files." - ) + ) from e return source, encoding, detected_bom @@ -348,7 +348,7 @@ def _perform_safety_check(analyzer: Analyzer, raw_query: Query, result: str) -> try: assert filtered_raw_tokens == filtered_result_tokens - except AssertionError: + except AssertionError as e: raw_len = len(filtered_raw_tokens) result_len = len(filtered_result_tokens) mismatch_pos = 0 @@ -371,7 +371,7 @@ def _perform_safety_check(analyzer: Analyzer, raw_query: Query, result: str) -> f"query was {result_len} tokens. First mismatching " f"token at position {mismatch_pos}: raw: {mismatch_raw}; " f"result: {mismatch_res}." - ) + ) from e raw_comments = [ comment.body for line in raw_query.lines for comment in line.comments @@ -383,7 +383,7 @@ def _perform_safety_check(analyzer: Analyzer, raw_query: Query, result: str) -> stripped_res = "".join(["".join(c.split()) for c in result_comments]) try: assert stripped_raw == stripped_res - except AssertionError: + except AssertionError as e: raw_len = len(stripped_raw) result_len = len(stripped_res) mismatch_pos = 0 @@ -404,4 +404,4 @@ def _perform_safety_check(analyzer: Analyzer, raw_query: Query, result: str) -> f"query had {result_len} comment characters. First mismatching " f"character at position {mismatch_pos}: raw: {mismatch_raw}; " f"result: {mismatch_res}." - ) + ) from e diff --git a/src/sqlfmt/comment.py b/src/sqlfmt/comment.py index 4cee4c04..c526f70c 100644 --- a/src/sqlfmt/comment.py +++ b/src/sqlfmt/comment.py @@ -49,8 +49,8 @@ def _get_marker(self) -> Tuple[str, int]: match = self.comment_marker.match(self.token.token) assert match, f"{self.token.token} does not match comment marker" _, epos = match.span(1) - _, len = match.span(2) - return self.token.token[:epos], len + _, text_offset = match.span(2) + return self.token.token[:epos], text_offset def _rewrite_marker(self, marker: str) -> str: """ diff --git a/src/sqlfmt/config.py b/src/sqlfmt/config.py index 8896a645..cc01bf33 100644 --- a/src/sqlfmt/config.py +++ b/src/sqlfmt/config.py @@ -65,7 +65,7 @@ def _find_config_file(search_paths: List[Path]) -> Optional[Path]: Returns None if no file exists """ - for f in [dir / "pyproject.toml" for dir in search_paths]: + for f in [p / "pyproject.toml" for p in search_paths]: if f.exists(): return f else: @@ -87,12 +87,12 @@ def _load_config_from_path(config_path: Optional[Path]) -> Config: except OSError as e: raise SqlfmtConfigError( f"Error opening pyproject.toml config file at {config_path}. {e}" - ) + ) from e except tomllib.TOMLDecodeError as e: raise SqlfmtConfigError( f"Error decoding pyproject.toml config file at {config_path}. " f"Check for invalid TOML. {e}" - ) + ) from e raw_config: Config = pyproject_dict.get("tool", {}).get("sqlfmt", {}) if "exclude" in raw_config and "exclude_root" not in raw_config: raw_config["exclude_root"] = config_path.parent diff --git a/src/sqlfmt/merger.py b/src/sqlfmt/merger.py index 5d005b48..643676d2 100644 --- a/src/sqlfmt/merger.py +++ b/src/sqlfmt/merger.py @@ -347,7 +347,7 @@ def _maybe_stubbornly_merge(self, segments: List[Segment]) -> List[Segment]: new_segments = [segments[0]] # first stubborn-merge all p0 operators - for i, segment in enumerate(segments[1:], start=1): + for segment in segments[1:]: if ( # always stubbornly merge P0 operators (e.g., `over`) self._segment_continues_operator_sequence( diff --git a/src/sqlfmt/mode.py b/src/sqlfmt/mode.py index 5370c86a..1cbc2f71 100644 --- a/src/sqlfmt/mode.py +++ b/src/sqlfmt/mode.py @@ -40,11 +40,11 @@ def __post_init__(self) -> None: } try: self.dialect = dialects[self.dialect_name.lower()]() - except KeyError: + except KeyError as e: raise SqlfmtConfigError( f"Mode was created with dialect_name={self.dialect_name}, " "which is not supported. Did you mean 'polyglot'?" - ) + ) from e @property def color(self) -> bool: diff --git a/src/sqlfmt/node.py b/src/sqlfmt/node.py index 9cbe7bd4..2165ecb5 100644 --- a/src/sqlfmt/node.py +++ b/src/sqlfmt/node.py @@ -200,9 +200,10 @@ def is_multiplication_star(self) -> bool: if not prev_token: return False else: - return not ( - prev_token.type - in (TokenType.UNTERM_KEYWORD, TokenType.COMMA, TokenType.DOT) + return prev_token.type not in ( + TokenType.UNTERM_KEYWORD, + TokenType.COMMA, + TokenType.DOT, ) @property diff --git a/src/sqlfmt/node_manager.py b/src/sqlfmt/node_manager.py index a2b4115c..be3069ca 100644 --- a/src/sqlfmt/node_manager.py +++ b/src/sqlfmt/node_manager.py @@ -88,12 +88,12 @@ def raise_on_mismatched_jinja_tags(self, token: Token, start_tag: Node) -> None: start_value = end_text.replace("end", "") if start_value not in start_tag.value: raise ValueError - except ValueError: + except ValueError as e: raise SqlfmtBracketError( f"Closing jinja tag '{token.token}' found at pos {token.spos} does " f"not match last opened tag '{start_tag.value}' found at pos " f"{start_tag.token.spos}." - ) + ) from e def open_brackets( self, token: Token, previous_node: Optional[Node] @@ -128,22 +128,22 @@ def open_brackets( last_bracket = open_brackets.pop() if last_bracket.is_unterm_keyword: last_bracket = open_brackets.pop() - except IndexError: + except IndexError as e: raise SqlfmtBracketError( f"Closing bracket '{token.token}' found at " f"{token.spos} before bracket was opened." - ) + ) from e else: self.raise_on_mismatched_bracket(token, last_bracket) elif token.type is TokenType.JINJA_BLOCK_END: try: start_tag = open_jinja_blocks.pop() self.raise_on_mismatched_jinja_tags(token, start_tag) - except IndexError: + except IndexError as e: raise SqlfmtBracketError( f"Closing bracket '{token.token}' found at " f"{token.spos} before bracket was opened." - ) + ) from e # if we hit a semicolon, reset open_brackets, since we're # about to start a new query elif token.type is TokenType.SEMICOLON: diff --git a/src/sqlfmt_primer/primer.py b/src/sqlfmt_primer/primer.py index 29f56e92..cd6dac05 100644 --- a/src/sqlfmt_primer/primer.py +++ b/src/sqlfmt_primer/primer.py @@ -8,7 +8,6 @@ import click from git.repo import Repo from platformdirs import user_cache_dir - from sqlfmt.api import get_matching_paths, initialize_progress_bar, run from sqlfmt.cache import get_cache_file from sqlfmt.mode import Mode diff --git a/tests/conftest.py b/tests/conftest.py index ed74b673..6ce4b4b4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,9 +6,9 @@ import pytest from click.testing import CliRunner - from sqlfmt.analyzer import Analyzer from sqlfmt.mode import Mode + from tests.util import copy_test_data_to_tmp # make tests module importable @@ -21,6 +21,7 @@ def pytest_sessionstart(session: pytest.Session) -> None: before performing collection and entering the run test loop. """ from sqlfmt.cache import clear_cache + from tests.util import delete_results_dir delete_results_dir() diff --git a/tests/functional_tests/test_end_to_end.py b/tests/functional_tests/test_end_to_end.py index 83d17275..fabaea85 100755 --- a/tests/functional_tests/test_end_to_end.py +++ b/tests/functional_tests/test_end_to_end.py @@ -2,7 +2,6 @@ import pytest from click.testing import CliRunner - from sqlfmt.cli import sqlfmt as sqlfmt_main @@ -118,7 +117,7 @@ def test_end_to_end_errors( @pytest.mark.parametrize( - "options,input,expected_stdout,expected_exit", + "options,stream_input,expected_stdout,expected_exit", [ ("-", "select 1\n", "select 1\n\n", 0), ("-", "select 1\n", "select 1\n\n", 0), @@ -131,10 +130,10 @@ def test_end_to_end_errors( def test_stdin( sqlfmt_runner: CliRunner, options: str, - input: str, + stream_input: str, expected_stdout: str, expected_exit: int, ) -> None: - results = sqlfmt_runner.invoke(sqlfmt_main, args=options, input=input) + results = sqlfmt_runner.invoke(sqlfmt_main, args=options, input=stream_input) assert results.exit_code == expected_exit assert results.stdout == expected_stdout diff --git a/tests/functional_tests/test_general_formatting.py b/tests/functional_tests/test_general_formatting.py index d11e0a2b..f0a379ed 100644 --- a/tests/functional_tests/test_general_formatting.py +++ b/tests/functional_tests/test_general_formatting.py @@ -1,7 +1,7 @@ import pytest - from sqlfmt.api import format_string from sqlfmt.mode import Mode + from tests.util import check_formatting, read_test_data diff --git a/tests/unit_tests/test_actions.py b/tests/unit_tests/test_actions.py index cc9f960c..a81a7047 100644 --- a/tests/unit_tests/test_actions.py +++ b/tests/unit_tests/test_actions.py @@ -1,12 +1,12 @@ import re import pytest - from sqlfmt import actions from sqlfmt.analyzer import Analyzer from sqlfmt.exception import SqlfmtBracketError, StopRulesetLexing from sqlfmt.rules import FUNCTION, JINJA from sqlfmt.token import Token, TokenType + from tests.util import read_test_data diff --git a/tests/unit_tests/test_analyzer.py b/tests/unit_tests/test_analyzer.py index b79ce2c0..7acd6595 100644 --- a/tests/unit_tests/test_analyzer.py +++ b/tests/unit_tests/test_analyzer.py @@ -1,10 +1,10 @@ import pytest - from sqlfmt.analyzer import Analyzer from sqlfmt.comment import Comment from sqlfmt.exception import SqlfmtBracketError, SqlfmtParsingError from sqlfmt.mode import Mode from sqlfmt.token import Token, TokenType + from tests.util import read_test_data diff --git a/tests/unit_tests/test_api.py b/tests/unit_tests/test_api.py index f1361491..26a2f8b3 100644 --- a/tests/unit_tests/test_api.py +++ b/tests/unit_tests/test_api.py @@ -5,8 +5,6 @@ from typing import Any, List, Set, Type import pytest -from tqdm import tqdm - from sqlfmt.api import ( _format_many, _perform_safety_check, @@ -24,6 +22,7 @@ SqlfmtUnicodeError, ) from sqlfmt.mode import Mode +from tqdm import tqdm @pytest.fixture diff --git a/tests/unit_tests/test_cache.py b/tests/unit_tests/test_cache.py index bf7ab2fb..938e1d4c 100644 --- a/tests/unit_tests/test_cache.py +++ b/tests/unit_tests/test_cache.py @@ -3,7 +3,6 @@ from typing import Dict, Generator, List, Tuple import pytest - from sqlfmt.cache import ( Cache, check_cache, @@ -15,6 +14,7 @@ from sqlfmt.exception import SqlfmtError from sqlfmt.mode import Mode from sqlfmt.report import SqlFormatResult + from tests.util import BASE_DIR diff --git a/tests/unit_tests/test_cli.py b/tests/unit_tests/test_cli.py index 797afde1..cda7af9e 100755 --- a/tests/unit_tests/test_cli.py +++ b/tests/unit_tests/test_cli.py @@ -7,8 +7,8 @@ import pytest from click.testing import CliRunner - from sqlfmt.cli import sqlfmt as sqlfmt_main + from tests.util import copy_config_file_to_dst @@ -69,8 +69,8 @@ def test_version_command(sqlfmt_runner: CliRunner) -> None: def test_stdin(sqlfmt_runner: CliRunner) -> None: - input = "select 1" - results = sqlfmt_runner.invoke(sqlfmt_main, args="-", input=input) + stream_input = "select 1" + results = sqlfmt_runner.invoke(sqlfmt_main, args="-", input=stream_input) assert results.exit_code == 0 assert results.stdout == "select 1\n\n" diff --git a/tests/unit_tests/test_comment.py b/tests/unit_tests/test_comment.py index 54bbc009..b6d994cd 100644 --- a/tests/unit_tests/test_comment.py +++ b/tests/unit_tests/test_comment.py @@ -1,7 +1,6 @@ from typing import List import pytest - from sqlfmt.comment import Comment from sqlfmt.node_manager import NodeManager from sqlfmt.token import Token, TokenType diff --git a/tests/unit_tests/test_config.py b/tests/unit_tests/test_config.py index e66d24c0..848cfcb9 100644 --- a/tests/unit_tests/test_config.py +++ b/tests/unit_tests/test_config.py @@ -2,9 +2,9 @@ from typing import Any, List import pytest - from sqlfmt.config import _find_config_file, _get_common_parents, _load_config_from_path from sqlfmt.exception import SqlfmtConfigError + from tests.util import copy_config_file_to_dst diff --git a/tests/unit_tests/test_dialect.py b/tests/unit_tests/test_dialect.py index ade6bc9d..83d8208a 100644 --- a/tests/unit_tests/test_dialect.py +++ b/tests/unit_tests/test_dialect.py @@ -2,7 +2,6 @@ from typing import Any import pytest - from sqlfmt.dialect import ClickHouse, Dialect, Polyglot from sqlfmt.rules.common import group diff --git a/tests/unit_tests/test_jinjafmt.py b/tests/unit_tests/test_jinjafmt.py index 54bb4b24..997a0e89 100644 --- a/tests/unit_tests/test_jinjafmt.py +++ b/tests/unit_tests/test_jinjafmt.py @@ -2,7 +2,6 @@ from typing import Dict, Tuple import pytest - from sqlfmt.analyzer import Analyzer from sqlfmt.jinjafmt import BlackWrapper, JinjaFormatter, JinjaTag from sqlfmt.line import Line @@ -71,7 +70,7 @@ def test_jinja_tag_from_string(tag: str, result: Tuple[str, str, str, str]) -> N @pytest.mark.parametrize( - "type,tag,formatted", + "ttype,tag,formatted", [ (TokenType.JINJA_EXPRESSION, "{{ expression }}", "{{ expression }}"), (TokenType.JINJA_EXPRESSION, "{{expression}}", "{{ expression }}"), @@ -112,12 +111,12 @@ def test_jinja_tag_from_string(tag: str, result: Tuple[str, str, str, str]) -> N ) def test_format_jinja_node( jinja_formatter: JinjaFormatter, - type: TokenType, + ttype: TokenType, tag: str, formatted: str, node_manager: NodeManager, ) -> None: - t = Token(type=type, prefix="", token=tag, spos=0, epos=len(tag)) + t = Token(type=ttype, prefix="", token=tag, spos=0, epos=len(tag)) n = node_manager.create_node(t, previous_node=None) jinja_formatter._format_jinja_node(n, 88) assert n.value == formatted diff --git a/tests/unit_tests/test_line.py b/tests/unit_tests/test_line.py index ad90fcba..9c5bb7f8 100644 --- a/tests/unit_tests/test_line.py +++ b/tests/unit_tests/test_line.py @@ -2,13 +2,13 @@ from typing import List import pytest - from sqlfmt.analyzer import Analyzer from sqlfmt.comment import Comment from sqlfmt.line import Line from sqlfmt.mode import Mode from sqlfmt.node_manager import NodeManager from sqlfmt.token import Token, TokenType + from tests.util import read_test_data diff --git a/tests/unit_tests/test_merger.py b/tests/unit_tests/test_merger.py index bcb8324d..c42d2af2 100644 --- a/tests/unit_tests/test_merger.py +++ b/tests/unit_tests/test_merger.py @@ -1,12 +1,12 @@ import itertools import pytest - from sqlfmt.exception import CannotMergeException from sqlfmt.merger import LineMerger from sqlfmt.mode import Mode from sqlfmt.operator_precedence import OperatorPrecedence from sqlfmt.segment import Segment, create_segments_from_lines + from tests.util import read_test_data diff --git a/tests/unit_tests/test_mode.py b/tests/unit_tests/test_mode.py index ea2f67ea..e7003e4c 100644 --- a/tests/unit_tests/test_mode.py +++ b/tests/unit_tests/test_mode.py @@ -1,5 +1,4 @@ import pytest - from sqlfmt.dialect import ClickHouse, Polyglot from sqlfmt.exception import SqlfmtConfigError from sqlfmt.mode import Mode diff --git a/tests/unit_tests/test_node.py b/tests/unit_tests/test_node.py index 3c87ec67..03ab1bb3 100644 --- a/tests/unit_tests/test_node.py +++ b/tests/unit_tests/test_node.py @@ -1,8 +1,8 @@ import pytest - from sqlfmt.mode import Mode from sqlfmt.node_manager import NodeManager from sqlfmt.token import Token, TokenType + from tests.util import read_test_data diff --git a/tests/unit_tests/test_node_manager.py b/tests/unit_tests/test_node_manager.py index 0d159f50..50231c5e 100644 --- a/tests/unit_tests/test_node_manager.py +++ b/tests/unit_tests/test_node_manager.py @@ -1,9 +1,9 @@ import pytest - from sqlfmt.exception import SqlfmtBracketError from sqlfmt.mode import Mode from sqlfmt.node_manager import NodeManager from sqlfmt.token import Token, TokenType + from tests.util import read_test_data diff --git a/tests/unit_tests/test_operator_precedence.py b/tests/unit_tests/test_operator_precedence.py index d08e4f86..97016b3e 100644 --- a/tests/unit_tests/test_operator_precedence.py +++ b/tests/unit_tests/test_operator_precedence.py @@ -1,5 +1,4 @@ import pytest - from sqlfmt.analyzer import Analyzer from sqlfmt.operator_precedence import OperatorPrecedence diff --git a/tests/unit_tests/test_report.py b/tests/unit_tests/test_report.py index 8f06ea79..aff086f6 100644 --- a/tests/unit_tests/test_report.py +++ b/tests/unit_tests/test_report.py @@ -2,7 +2,6 @@ from typing import List import pytest - from sqlfmt.mode import Mode from sqlfmt.report import Report, SqlFormatResult diff --git a/tests/unit_tests/test_rule.py b/tests/unit_tests/test_rule.py index 4239d71e..cd03258f 100644 --- a/tests/unit_tests/test_rule.py +++ b/tests/unit_tests/test_rule.py @@ -3,7 +3,6 @@ from typing import List import pytest - from sqlfmt.rule import Rule from sqlfmt.rules import CLONE, CORE, FUNCTION, GRANT, JINJA, MAIN, WAREHOUSE @@ -17,8 +16,8 @@ def get_rule(ruleset: List[Rule], rule_name: str) -> Rule: matching_rules = filter(lambda rule: rule.name == rule_name, ruleset) try: return next(matching_rules) - except StopIteration: - raise ValueError(f"No rule '{rule_name}' in ruleset '{ruleset}'") + except StopIteration as e: + raise ValueError(f"No rule '{rule_name}' in ruleset '{ruleset}'") from e @pytest.mark.parametrize( diff --git a/tests/unit_tests/test_segment.py b/tests/unit_tests/test_segment.py index 7f3e8c57..95a4d667 100644 --- a/tests/unit_tests/test_segment.py +++ b/tests/unit_tests/test_segment.py @@ -1,11 +1,11 @@ from typing import List import pytest - from sqlfmt.analyzer import Analyzer from sqlfmt.exception import SqlfmtSegmentError from sqlfmt.line import Line from sqlfmt.segment import Segment, create_segments_from_lines + from tests.util import read_test_data diff --git a/tests/unit_tests/test_splitter.py b/tests/unit_tests/test_splitter.py index 801202db..366a9aec 100644 --- a/tests/unit_tests/test_splitter.py +++ b/tests/unit_tests/test_splitter.py @@ -1,12 +1,12 @@ from typing import List import pytest - from sqlfmt.analyzer import Analyzer from sqlfmt.line import Line from sqlfmt.mode import Mode from sqlfmt.node_manager import NodeManager from sqlfmt.splitter import LineSplitter + from tests.util import read_test_data