Skip to content

Commit

Permalink
Merge pull request #187 from macisamuele/maci-update-gha
Browse files Browse the repository at this point in the history
Update GitHub Actions, Python versions and pre-commit hooks
  • Loading branch information
macisamuele authored Oct 12, 2023
2 parents dbc5cd7 + aaddee8 commit bc633b2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

golang_version: [1.19.3]
java_version: ['15', '16', '17', '18', '19']
python_version: ['3.8', '3.9', '3.10', '3.11']
python_version: ['3.10', '3.11', '3.12']
rust_version: [stable]

env:
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit
rev: v2.20.0
rev: v3.4.0
hooks:
- id: validate_manifest
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
Expand All @@ -27,7 +27,7 @@ repos:
exclude: ^test-data/.*$
- id: fix-encoding-pragma
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
rev: v3.12.0
hooks:
- id: reorder-python-imports
args:
Expand All @@ -38,31 +38,31 @@ repos:
- --remove-import
- from __future__ import unicode_literals
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.4.0
rev: v2.10.0
hooks:
- id: pretty-format-yaml
exclude: ^test-data/.*$
args:
- --autofix
- repo: https://github.com/ambv/black
rev: 22.10.0
rev: 23.9.1
hooks:
- id: black
args: [--config, .black.toml]
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.5.1
hooks:
- id: mypy
exclude: ^(\.github/workflows/bump_external_releases\.py)$
additional_dependencies:
- types-requests
- types-setuptools
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
rev: 1.7.5
hooks:
- id: bandit
exclude: ^tests/.*\.py$
2 changes: 1 addition & 1 deletion language_formatters_pre_commit_hooks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def download_url(url: str, file_name: typing.Optional[str] = None) -> str:
os.makedirs(base_directory)

print("Downloading {url}".format(url=url), file=sys.stderr)
r = requests.get(url, stream=True)
r = requests.get(url, stream=True) # nosec B113/request_without_timeout: intentional to avoid issues on slow connections
r.raise_for_status()
with tempfile.NamedTemporaryFile(dir=base_directory, delete=False) as tmp_file: # Not delete because we're renaming it
tmp_file_name = tmp_file.name
Expand Down
1 change: 0 additions & 1 deletion tests/pre_conditions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def success(request):


def test__is_command_success(success: bool) -> None:

assert success == _is_command_success(
"cmd",
"with",
Expand Down
8 changes: 2 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
[tox]
# These should match the travis env list
envlist = py{36,37,38,39},pre-commit
envlist = py{310,311,312},pre-commit

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
deps = -rrequirements-dev.txt
Expand Down

0 comments on commit bc633b2

Please sign in to comment.