Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz authored Jun 4, 2021
2 parents 77af4d2 + 16ff084 commit 3478be3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ repos:
- id: mypy
# Avoid error: Duplicate module named 'setup'
# https://github.com/python/mypy/issues/4008
# Keep exclude in sync with mypy own excludes
exclude: ^tests/test_data/
additional_dependencies:
- click==8.0.1
- pep517==0.10.0
- toml==0.10.2
- pip==20.3.4
- repo: https://github.com/PyCQA/bandit
rev: 1.7.0
hooks:
Expand Down
8 changes: 5 additions & 3 deletions piptools/scripts/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import shlex
import sys
import tempfile
from typing import Any, BinaryIO, List, Optional, Tuple, cast
from typing import IO, Any, BinaryIO, List, Optional, Tuple, Union, cast

import click
from click.utils import LazyFile, safecall
Expand Down Expand Up @@ -234,7 +234,7 @@ def cli(
annotate: bool,
upgrade: bool,
upgrade_packages: Tuple[str, ...],
output_file: Optional[LazyFile],
output_file: Union[LazyFile, IO[Any], None],
allow_unsafe: bool,
generate_hashes: bool,
reuse_hashes: bool,
Expand Down Expand Up @@ -285,7 +285,9 @@ def cli(

# Close the file at the end of the context execution
assert output_file is not None
ctx.call_on_close(safecall(output_file.close_intelligently))
# only LazyFile has close_intelligently, newer IO[Any] does not
if isinstance(output_file, LazyFile): # pragma: no cover
ctx.call_on_close(safecall(output_file.close_intelligently))

###
# Setup
Expand Down
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,9 @@ warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true

# Avoid error: Duplicate module named 'setup'
# https://github.com/python/mypy/issues/4008
exclude = ^tests/test_data/

[mypy-tests.*]
disallow_untyped_defs = false

0 comments on commit 3478be3

Please sign in to comment.