Skip to content

Commit

Permalink
Merge pull request #93 from pganssle/update_pre_commit
Browse files Browse the repository at this point in the history
Update pre commit hooks and remove setup-cfg-fmt
  • Loading branch information
pganssle committed Oct 22, 2020
2 parents ceea631 + 795c651 commit f27fa82
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 20 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/python-tests.yml
Expand Up @@ -7,9 +7,20 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', 'pypy3']
python-version: ["3.6", "3.7", "3.8", "pypy3"]
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
tzdata_extras: ["", "tzdata"]
exclude:
# Disable PyPy3 on Windows, because GHA currently serves version
# 7.3.2, which has a regression that breaks tox on Windows:
#
# https://foss.heptapod.net/pypy/pypy/-/issues/3331
# https://github.com/tox-dev/tox/issues/1704
#
# This can be removed when a fixed version of PyPy is available on
# GHA, or when a workaround is found.
- python-version: "pypy3"
os: "windows-latest"
env:
TOXENV: py
TEST_EXTRAS_TOX: ${{ matrix.tzdata_extras }}
Expand All @@ -35,7 +46,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
python-version: ["3.6", "3.7", "3.8"]
os: ["ubuntu-latest"]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
15 changes: 5 additions & 10 deletions .pre-commit-config.yaml
@@ -1,36 +1,31 @@
repos:
- repo: https://github.com/psf/black
rev: stable
rev: 20.8b1
hooks:
- id: black
language_version: python3.8

- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.4.2
rev: v5.6.4
hooks:
- id: isort
additional_dependencies: [toml]
language_version: python3.8

- repo: https://github.com/pycqa/pylint
rev: pylint-2.5.2
rev: pylint-2.6.0
hooks:
- id: pylint


- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v3.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.9.0
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/doublify/pre-commit-clang-format
rev: f4c4ac5948aff384af2b439bfabb2bdd65d2b3ac
rev: 62302476d0da01515660132d76902359bed0f782
hooks:
- id: clang-format
3 changes: 2 additions & 1 deletion scripts/update_test_data.py
Expand Up @@ -105,7 +105,8 @@ def update_test_data(fname: str = "zoneinfo_data.json") -> None:

# Annotation required: https://github.com/python/mypy/issues/8772
json_kwargs: typing.Dict[str, typing.Any] = dict(
indent=2, sort_keys=True,
indent=2,
sort_keys=True,
)

compressed_keys = load_compressed_keys()
Expand Down
39 changes: 32 additions & 7 deletions tests/test_zoneinfo.py
Expand Up @@ -1563,15 +1563,27 @@ def test_env_variable_relative_paths(self):
test_cases = [
[("path/to/somewhere",), ()],
[
("/usr/share/zoneinfo", "path/to/somewhere",),
(
"/usr/share/zoneinfo",
"path/to/somewhere",
),
("/usr/share/zoneinfo",),
],
[("../relative/path",), ()],
[
("/usr/share/zoneinfo", "../relative/path",),
(
"/usr/share/zoneinfo",
"../relative/path",
),
("/usr/share/zoneinfo",),
],
[("path/to/somewhere", "../relative/path",), ()],
[
(
"path/to/somewhere",
"../relative/path",
),
(),
],
[
(
"/usr/share/zoneinfo",
Expand Down Expand Up @@ -1603,11 +1615,24 @@ def test_reset_tzpath_kwarg(self):
def test_reset_tzpath_relative_paths(self):
bad_values = [
("path/to/somewhere",),
("/usr/share/zoneinfo", "path/to/somewhere",),
(
"/usr/share/zoneinfo",
"path/to/somewhere",
),
("../relative/path",),
("/usr/share/zoneinfo", "../relative/path",),
("path/to/somewhere", "../relative/path",),
("/usr/share/zoneinfo", "path/to/somewhere", "../relative/path",),
(
"/usr/share/zoneinfo",
"../relative/path",
),
(
"path/to/somewhere",
"../relative/path",
),
(
"/usr/share/zoneinfo",
"path/to/somewhere",
"../relative/path",
),
]
for input_paths in bad_values:
with self.subTest(input_paths=input_paths):
Expand Down

0 comments on commit f27fa82

Please sign in to comment.