Skip to content

Commit

Permalink
chore: Update pre-commit hooks (#1064)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Aug 20, 2024
1 parent 8ae564c commit 910efd0
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- id: pyproject-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
rev: v0.6.1
hooks:
- id: ruff
args:
Expand Down
1 change: 1 addition & 0 deletions tests/cli/test_root.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from click.testing import CliRunner

from pytoil.cli.root import main


Expand Down
50 changes: 25 additions & 25 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MkTemp(Protocol):
def mktemp(self, name: str) -> Path: ...


@pytest.fixture()
@pytest.fixture
def fake_get_repo_names_response() -> dict[str, Any]:
"""
Response snippet for the get_repo_names GraphQL
Expand All @@ -41,7 +41,7 @@ def fake_get_repo_names_response() -> dict[str, Any]:
}


@pytest.fixture()
@pytest.fixture
def fake_get_repos_response() -> dict[str, Any]:
"""
Response snippet for the get_repos GraphQL
Expand Down Expand Up @@ -115,7 +115,7 @@ def fake_get_repos_response() -> dict[str, Any]:
}


@pytest.fixture()
@pytest.fixture
def fake_get_forks_response() -> dict[str, Any]:
"""
Response snippet for the get_forks GraphQL
Expand Down Expand Up @@ -147,7 +147,7 @@ def fake_get_forks_response() -> dict[str, Any]:
}


@pytest.fixture()
@pytest.fixture
def fake_repo_exists_false_response() -> dict[str, Any]:
"""
Response snippet for the check_repo_exists GraphQL
Expand All @@ -166,7 +166,7 @@ def fake_repo_exists_false_response() -> dict[str, Any]:
}


@pytest.fixture()
@pytest.fixture
def fake_repo_exists_true_response() -> dict[str, Any]:
"""
Response snippet for the check_repo_exists GraphQL
Expand All @@ -175,7 +175,7 @@ def fake_repo_exists_true_response() -> dict[str, Any]:
return {"data": {"repository": {"name": "pytoil"}}}


@pytest.fixture()
@pytest.fixture
def fake_repo_info_response() -> dict[str, Any]:
"""
Response snippet for the get_repo_info GraphQL
Expand All @@ -196,7 +196,7 @@ def fake_repo_info_response() -> dict[str, Any]:
}


@pytest.fixture()
@pytest.fixture
def fake_repo_info_response_no_license() -> dict[str, Any]:
"""
Response snippet for the get_repo_info GraphQL
Expand All @@ -217,7 +217,7 @@ def fake_repo_info_response_no_license() -> dict[str, Any]:
}


@pytest.fixture()
@pytest.fixture
def fake_projects_dir(tmp_path_factory: MkTemp) -> Path:
"""
Returns a fake projects directory complete
Expand All @@ -240,7 +240,7 @@ def fake_projects_dir(tmp_path_factory: MkTemp) -> Path:
return projects_dir


@pytest.fixture()
@pytest.fixture
def temp_environment_yml(tmp_path_factory: MkTemp) -> Path:
"""
Returns a valid temporary environment.yml file.
Expand Down Expand Up @@ -269,7 +269,7 @@ def temp_environment_yml(tmp_path_factory: MkTemp) -> Path:
return env_file


@pytest.fixture()
@pytest.fixture
def bad_temp_environment_yml(tmp_path_factory: MkTemp) -> Path:
"""
Returns an invalid temporary environment.yml file.
Expand Down Expand Up @@ -299,7 +299,7 @@ def bad_temp_environment_yml(tmp_path_factory: MkTemp) -> Path:
return env_file


@pytest.fixture()
@pytest.fixture
def fake_home_folder_miniconda(tmp_path_factory: MkTemp) -> Path:
"""
Returns a faked $HOME folder. Should be used as the return
Expand All @@ -315,7 +315,7 @@ def fake_home_folder_miniconda(tmp_path_factory: MkTemp) -> Path:
return fake_home


@pytest.fixture()
@pytest.fixture
def fake_home_folder_anaconda(tmp_path_factory: MkTemp) -> Path:
"""
Returns a faked $HOME folder. Should be used as the return
Expand All @@ -331,7 +331,7 @@ def fake_home_folder_anaconda(tmp_path_factory: MkTemp) -> Path:
return fake_home


@pytest.fixture()
@pytest.fixture
def fake_home_folder_miniforge(tmp_path_factory: MkTemp) -> Path:
"""
Returns a faked $HOME folder. Should be used as the return
Expand All @@ -347,7 +347,7 @@ def fake_home_folder_miniforge(tmp_path_factory: MkTemp) -> Path:
return fake_home


@pytest.fixture()
@pytest.fixture
def fake_home_folder_mambaforge(tmp_path_factory: MkTemp) -> Path:
"""
Returns a faked $HOME folder. Should be used as the return
Expand All @@ -363,7 +363,7 @@ def fake_home_folder_mambaforge(tmp_path_factory: MkTemp) -> Path:
return fake_home


@pytest.fixture()
@pytest.fixture
def fake_home_folder_no_conda(tmp_path_factory: MkTemp) -> Path:
"""
Returns a faked $HOME but without any conda dirs.
Expand All @@ -374,7 +374,7 @@ def fake_home_folder_no_conda(tmp_path_factory: MkTemp) -> Path:
return fake_home


@pytest.fixture()
@pytest.fixture
def repo_folder_with_random_existing_files(tmp_path_factory: MkTemp) -> Path:
"""
Returns a temporary directory containing a few random files
Expand All @@ -392,7 +392,7 @@ def repo_folder_with_random_existing_files(tmp_path_factory: MkTemp) -> Path:
return folder


@pytest.fixture()
@pytest.fixture
def project_with_no_build_system(tmp_path_factory: MkTemp) -> Path:
"""
Returns a temporary directory containing a
Expand All @@ -407,7 +407,7 @@ def project_with_no_build_system(tmp_path_factory: MkTemp) -> Path:
return folder


@pytest.fixture()
@pytest.fixture
def project_with_no_build_backend(tmp_path_factory: MkTemp) -> Path:
"""
Returns a temporary directory containing a
Expand All @@ -432,7 +432,7 @@ def project_with_no_build_backend(tmp_path_factory: MkTemp) -> Path:
return folder


@pytest.fixture()
@pytest.fixture
def project_with_setuptools_pep621_backend(tmp_path_factory: MkTemp) -> Path:
"""
Returns a temporary directory containing a PEP 621
Expand All @@ -459,7 +459,7 @@ def project_with_setuptools_pep621_backend(tmp_path_factory: MkTemp) -> Path:
return folder


@pytest.fixture()
@pytest.fixture
def fake_poetry_project(tmp_path_factory: MkTemp) -> Path:
"""
Returns a temporary directory containing a
Expand All @@ -483,7 +483,7 @@ def fake_poetry_project(tmp_path_factory: MkTemp) -> Path:
return folder


@pytest.fixture()
@pytest.fixture
def fake_flit_project(tmp_path_factory: MkTemp) -> Path:
"""
Returns a temporary directory containing a
Expand All @@ -507,7 +507,7 @@ def fake_flit_project(tmp_path_factory: MkTemp) -> Path:
return folder


@pytest.fixture()
@pytest.fixture
def fake_hatch_project(tmp_path_factory: MkTemp) -> Path:
"""
Returns a temporary directory containing a
Expand All @@ -531,7 +531,7 @@ def fake_hatch_project(tmp_path_factory: MkTemp) -> Path:
return folder


@pytest.fixture()
@pytest.fixture
def fake_pep621_project(tmp_path_factory: MkTemp) -> Path:
"""
Returns a temporary directory containing a
Expand Down Expand Up @@ -561,7 +561,7 @@ def fake_pep621_project(tmp_path_factory: MkTemp) -> Path:
return folder


@pytest.fixture()
@pytest.fixture
def requirements_dev_project(tmp_path_factory: MkTemp) -> Path:
"""
Returns a temp directory containing a requirements-dev.txt
Expand All @@ -574,7 +574,7 @@ def requirements_dev_project(tmp_path_factory: MkTemp) -> Path:
return folder


@pytest.fixture()
@pytest.fixture
def requirements_project(tmp_path_factory: MkTemp) -> Path:
"""
Returns a temp directory containing a requirements.txt
Expand Down
1 change: 1 addition & 0 deletions tests/environments/test_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import pytest
from pytest_mock import MockerFixture

from pytoil.environments import Conda
from pytoil.exceptions import (
BadEnvironmentFileError,
Expand Down
1 change: 1 addition & 0 deletions tests/environments/test_flit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import pytest
from pytest_mock import MockerFixture

from pytoil.environments.flit import Flit
from pytoil.exceptions import FlitNotInstalledError

Expand Down
1 change: 1 addition & 0 deletions tests/environments/test_poetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import pytest
from pytest_mock import MockerFixture

from pytoil.environments import Poetry
from pytoil.exceptions import PoetryNotInstalledError

Expand Down
1 change: 1 addition & 0 deletions tests/environments/test_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import pytest
from pytest_mock import MockerFixture

from pytoil.environments import Requirements


Expand Down
1 change: 1 addition & 0 deletions tests/environments/test_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import pytest
from pytest_mock import MockerFixture

from pytoil.environments import Venv


Expand Down
1 change: 1 addition & 0 deletions tests/starters/test_go.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest
from pytest_mock import MockerFixture

from pytoil.exceptions import GoNotInstalledError
from pytoil.starters import GoStarter

Expand Down
1 change: 1 addition & 0 deletions tests/starters/test_rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest
from pytest_mock import MockerFixture

from pytoil.exceptions import CargoNotInstalledError
from pytoil.starters import RustStarter

Expand Down
1 change: 1 addition & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from freezegun import freeze_time
from pytest_httpx import HTTPXMock

from pytoil import __version__
from pytoil.api import API

Expand Down
1 change: 1 addition & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pathlib import Path

import pytest

from pytoil.config import Config, defaults

# GitHub Actions
Expand Down
1 change: 1 addition & 0 deletions tests/test_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pathlib import Path

from pytest_mock import MockerFixture

from pytoil.editor import launch


Expand Down
1 change: 1 addition & 0 deletions tests/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import pytest
from pytest_mock import MockerFixture

from pytoil.exceptions import GitNotInstalledError
from pytoil.git import Git

Expand Down
1 change: 1 addition & 0 deletions tests/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from freezegun import freeze_time
from pytest_httpx import HTTPXMock
from pytest_mock import MockerFixture

from pytoil.api import API
from pytoil.config import Config
from pytoil.environments import Conda, Flit, Poetry, Requirements, Venv
Expand Down

0 comments on commit 910efd0

Please sign in to comment.