All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
Click types have been moved to click repo itself. See pallets/click#1856
I've had some issues with typeshed types being outdated in another project
so might be good to avoid that here.
Commit history before merge:
* Get `click` types from main repo
* Fix mypy errors
* Require click v8 for type annotations
* Update Pipfile
- types-dataclasses >= 0.1.3
- types-toml >= 0.1.1
- types-typed-ast >= 1.4.1
- types-dataclasses >= 0.1.3
- types-toml >= 0.1.1
- types-typed-ast >= 1.4.1
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.1
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.1
flake8 = "*"
flake8-bugbear = "*"
mypy = ">=0.812"
flake8 = "*"
flake8-bugbear = "*"
mypy = ">=0.812"
types-dataclasses = ">=0.1.3"
types-toml = ">=0.1.1"
types-typed-ast = ">=1.4.1"
types-dataclasses = ">=0.1.3"
types-toml = ">=0.1.1"
types-typed-ast = ">=1.4.1"
aiohttp = ">=3.6.0"
aiohttp-cors = ">=0.4.0"
appdirs = "*"
aiohttp = ">=3.6.0"
aiohttp-cors = ">=0.4.0"
appdirs = "*"
mypy_extensions = ">=0.4.3"
pathspec = ">=0.8.1"
regex = ">=2020.1.8"
mypy_extensions = ">=0.4.3"
pathspec = ">=0.8.1"
regex = ">=2020.1.8"
- "sha256": "18ff16725509d6d14f44e3a96fe620730c9adfdaa87cbeee74aa397913dedaab"
+ "sha256": "0c126694d1a1cd1c4dc875a99f330f6b9a5994e51a1f870a98dbacd0185dae53"
},
"pipfile-spec": 6,
"requires": {},
},
"pipfile-spec": 6,
"requires": {},
"index": "pypi",
"version": "==3.4.1"
},
"index": "pypi",
"version": "==3.4.1"
},
- "types-click": {
- "hashes": [
- "sha256:040897284e4f9466825c3865f708a985a8e7ba4d8e22cb9198ffb7b522160850",
- "sha256:4722746f1ec9fd3fc8b1d7fb8c840604dc22f9e32bcc7a31a36d6d85cc2bce24"
- ],
- "index": "pypi",
- "version": "==7.1.2"
- },
"types-dataclasses": {
"hashes": [
"sha256:7b5f4099fb21c209f2df3a83c2b64308c29955769d610a457244dc0eebe1cafc",
"types-dataclasses": {
"hashes": [
"sha256:7b5f4099fb21c209f2df3a83c2b64308c29955769d610a457244dc0eebe1cafc",
if ignore_config:
args = ["--verbose", "--config", str(THIS_DIR / "empty.toml"), *args]
result = runner.invoke(black.main, args)
if ignore_config:
args = ["--verbose", "--config", str(THIS_DIR / "empty.toml"), *args]
result = runner.invoke(black.main, args)
+ assert result.stdout_bytes is not None
+ assert result.stderr_bytes is not None
self.assertEqual(
result.exit_code,
exit_code,
self.assertEqual(
result.exit_code,
exit_code,
self.assertEqual(result.exit_code, 123)
finally:
os.unlink(tmp_file)
self.assertEqual(result.exit_code, 123)
finally:
os.unlink(tmp_file)
+ assert result.stderr_bytes is not None
actual = (
result.stderr_bytes.decode()
.replace("\n", "")
actual = (
result.stderr_bytes.decode()
.replace("\n", "")
def test_shhh_click(self) -> None:
try:
def test_shhh_click(self) -> None:
try:
- from click import _unicodefun # type: ignore
+ from click import _unicodefun
except ModuleNotFoundError:
self.skipTest("Incompatible Click version")
if not hasattr(_unicodefun, "_verify_python3_env"):
except ModuleNotFoundError:
self.skipTest("Incompatible Click version")
if not hasattr(_unicodefun, "_verify_python3_env"):
with patch("locale.getpreferredencoding") as gpe:
gpe.return_value = "ASCII"
with self.assertRaises(RuntimeError):
with patch("locale.getpreferredencoding") as gpe:
gpe.return_value = "ASCII"
with self.assertRaises(RuntimeError):
- _unicodefun._verify_python3_env()
+ _unicodefun._verify_python3_env() # type: ignore
# Now, let's silence Click...
black.patch_click()
# ...and confirm it's silent.
with patch("locale.getpreferredencoding") as gpe:
gpe.return_value = "ASCII"
try:
# Now, let's silence Click...
black.patch_click()
# ...and confirm it's silent.
with patch("locale.getpreferredencoding") as gpe:
gpe.return_value = "ASCII"
try:
- _unicodefun._verify_python3_env()
+ _unicodefun._verify_python3_env() # type: ignore
except RuntimeError as re:
self.fail(f"`patch_click()` failed, exception still raised: {re}")
except RuntimeError as re:
self.fail(f"`patch_click()` failed, exception still raised: {re}")