Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-deps(deps): Bump the python-dependencies group with 1 update #136

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 11 additions & 4 deletions scripts/update_development_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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__":
Expand Down
Loading