From a62bada534e8d0a42b0b1dd80ff1979c36fb0aaa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:47:40 -0800 Subject: [PATCH] python-deps(deps): Bump the python-dependencies group with 1 update (#136) * python-deps(deps): Bump the python-dependencies group with 1 update Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version. Updates `ruff` to 0.1.15 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.1.14...v0.1.15) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production dependency-group: python-dependencies ... Signed-off-by: dependabot[bot] * ci: Update pre-commit hook versions. Also update the script that is used to update the python dependencies to format the toml file when it is done updating things. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nicholas Felt Signed-off-by: v12ganesh ganesh.v@tektronix.com --- .pre-commit-config.yaml | 6 +++--- pyproject.toml | 2 +- scripts/update_development_dependencies.py | 15 +++++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f6115d9..cb8f808f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,14 +34,14 @@ repos: - id: remove-tabs - id: forbid-tabs - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.3 + rev: 0.27.4 hooks: - id: check-readthedocs - id: check-dependabot - id: check-github-actions - id: check-github-workflows - repo: https://github.com/commitizen-tools/commitizen - rev: v3.13.0 + rev: v3.14.0 hooks: - id: commitizen stages: [commit-msg] @@ -125,7 +125,7 @@ repos: always_run: true args: [., --min=10] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.14 + rev: v0.1.15 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/pyproject.toml b/pyproject.toml index 5011797d..481c4192 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,7 +113,7 @@ pytest-html = ">=4.0" pytest-order = ">=1.0.1" pytest-profiling = ">=1.7.0" python-semantic-release = ">=8.5.1" -ruff = "0.1.14" # Update this by running scripts/update_development_dependencies.py +ruff = "0.1.15" # Update this by running scripts/update_development_dependencies.py safety = ">=2.1.1" sphinx-autoapi = ">=2.0.0" sphinx-copybutton = ">=0.5.1" diff --git a/scripts/update_development_dependencies.py b/scripts/update_development_dependencies.py index af25c9c8..009916bf 100644 --- a/scripts/update_development_dependencies.py +++ b/scripts/update_development_dependencies.py @@ -40,6 +40,8 @@ def main() -> None: """Run the script to update the development dependencies.""" script_location = Path(__file__) python_executable = sys.executable + python_script_location = Path(python_executable).parent + repository_root_directory = script_location.parent.parent latest_dependency_versions: List[str] = [] # Get the latest versions for each of the dependencies to update @@ -49,18 +51,23 @@ def main() -> None: # Update dependencies in pyproject.toml using poetry dependencies = " ".join(f'"{x}"' for x in latest_dependency_versions) - _run_cmd_in_subprocess(f"{python_executable} -m poetry add --group=dev {dependencies}") + _run_cmd_in_subprocess(f'"{python_executable}" -m poetry add --group=dev {dependencies}') # Run poetry update - _run_cmd_in_subprocess(f"{python_executable} -m poetry update") + _run_cmd_in_subprocess(f'"{python_executable}" -m poetry update') # Update pre-commit config file - _run_cmd_in_subprocess(python_executable.rsplit("python", maxsplit=1)[-0] + "pre-commit-update") + _run_cmd_in_subprocess(f'"{python_script_location}/pre-commit-update"') # Fix the formatting of the pre-commit config file with warnings.catch_warnings(): warnings.simplefilter("ignore", UserWarning) - fix_files([f"{script_location.parent.parent}/.pre-commit-config.yaml"]) + fix_files([f"{repository_root_directory}/.pre-commit-config.yaml"]) + + # Fix the formatting of the pyproject.toml file + _run_cmd_in_subprocess( + f'"{python_script_location}/toml-sort" "{repository_root_directory}/pyproject.toml"' + ) if __name__ == "__main__":