From 02b96a6bd1b70282ef4ccf7a35d9f2ddd7f4e427 Mon Sep 17 00:00:00 2001
From: statsabot <>
Date: Thu, 1 Feb 2024 18:28:28 +0000
Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=91=B7=20Automated=20regeneration=20o?=
=?UTF-8?q?f=20examples=20and=20docs?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
examples/example.csv | 4 ++--
examples/example.json | 22 +++++++++++-----------
examples/example.md | 22 +++++++++++-----------
3 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/examples/example.csv b/examples/example.csv
index 568ea2b6..89723c92 100644
--- a/examples/example.csv
+++ b/examples/example.csv
@@ -129,10 +129,10 @@ simplejson,types-simplejson,https://github.com/simplejson/simplejson,PARTIAL,-,5
singledispatch,types-singledispatch,https://github.com/jaraco/singledispatch,COMPLETE,-,27,UP_TO_DATE,UPLOADED,STRICT,16,0,12,0,0,0,7,0,3,1,0,2,0,0,ERROR_ON_MISSING_STUB,linux,0
six,types-six,https://github.com/benjaminp/six,COMPLETE,-,336,UP_TO_DATE,UPLOADED,STRICT,71,0,40,0,0,0,9,6,13,0,0,4,0,0,ERROR_ON_MISSING_STUB,linux,25
slumber,types-slumber,https://github.com/samgiles/slumber,COMPLETE,-,74,UP_TO_DATE,UPLOADED,STRICT,43,0,25,0,0,0,11,5,9,0,0,15,0,0,ERROR_ON_MISSING_STUB,linux,2
-stdlib,-,https://github.com/python/cpython,STDLIB,-,53977,STDLIB,NOT_CURRENTLY_UPLOADED,STRICT_ON_SOME_FILES,25124,803,14033,400,86,18,1953,824,8546,542,145,2388,24,0,ERROR_ON_MISSING_STUB,darwin;linux;win32,968
+stdlib,-,https://github.com/python/cpython,STDLIB,-,53999,STDLIB,NOT_CURRENTLY_UPLOADED,STRICT_ON_SOME_FILES,25124,803,14068,365,86,18,1953,824,8546,542,145,2388,24,0,ERROR_ON_MISSING_STUB,darwin;linux;win32,968
stripe,types-stripe,https://github.com/stripe/stripe-python,PARTIAL,-,1532,OBSOLETE,UPLOADED,NOT_STRICT,270,396,108,172,156,0,5,4,157,42,0,136,1,0,MISSING_STUBS_IGNORED,linux,8
tabulate,types-tabulate,https://github.com/astanin/python-tabulate,COMPLETE,-,60,UP_TO_DATE,UPLOADED,STRICT,15,0,3,0,0,0,2,0,26,0,0,4,0,0,ERROR_ON_MISSING_STUB,linux,0
-tensorflow,types-tensorflow,https://github.com/tensorflow/tensorflow,PARTIAL,Partially generated using [mypy-protobuf==3.5.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.5.0) on tensorflow==2.12.1,21173,OUT_OF_DATE,UPLOADED,STRICT,3581,0,2394,0,6,35,32,30,4442,1,6,783,0,0,MISSING_STUBS_IGNORED,linux,35
+tensorflow,types-tensorflow,https://github.com/tensorflow/tensorflow,PARTIAL,Partially generated using [mypy-protobuf==3.5.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.5.0) on tensorflow==2.12.1,21248,OUT_OF_DATE,UPLOADED,STRICT,3612,0,2416,0,6,37,32,31,4445,1,6,789,0,0,MISSING_STUBS_IGNORED,linux,42
toml,types-toml,https://github.com/uiri/toml,COMPLETE,-,136,UP_TO_DATE,UPLOADED,STRICT,71,0,41,0,0,0,21,5,14,2,0,14,2,0,ERROR_ON_MISSING_STUB,linux,0
toposort,types-toposort,https://gitlab.com/ericvsmith/toposort,COMPLETE,-,13,UP_TO_DATE,UPLOADED,STRICT,4,0,4,0,0,0,1,0,1,1,0,2,0,0,ERROR_ON_MISSING_STUB,linux,0
tqdm,types-tqdm,https://github.com/tqdm/tqdm,COMPLETE,-,1380,UP_TO_DATE,UPLOADED,NOT_STRICT,816,141,167,24,43,11,1,1,100,0,74,36,0,0,ERROR_ON_MISSING_STUB,linux,2
diff --git a/examples/example.json b/examples/example.json
index 14b71e79..a8a3d7d0 100644
--- a/examples/example.json
+++ b/examples/example.json
@@ -4439,7 +4439,7 @@
"upstream_url": "https://github.com/python/cpython",
"completeness_level": "STDLIB",
"extra_description": null,
- "number_of_lines": 53977,
+ "number_of_lines": 53999,
"package_status": "STDLIB",
"upload_status": "NOT_CURRENTLY_UPLOADED",
"stubtest_settings": {
@@ -4455,8 +4455,8 @@
"annotation_stats": {
"annotated_parameters": 25124,
"unannotated_parameters": 803,
- "annotated_returns": 14033,
- "unannotated_returns": 400,
+ "annotated_returns": 14068,
+ "unannotated_returns": 365,
"explicit_Incomplete_parameters": 86,
"explicit_Incomplete_returns": 18,
"explicit_Any_parameters": 1953,
@@ -4543,7 +4543,7 @@
"upstream_url": "https://github.com/tensorflow/tensorflow",
"completeness_level": "PARTIAL",
"extra_description": "Partially generated using [mypy-protobuf==3.5.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.5.0) on tensorflow==2.12.1",
- "number_of_lines": 21173,
+ "number_of_lines": 21248,
"package_status": "OUT_OF_DATE",
"upload_status": "UPLOADED",
"stubtest_settings": {
@@ -4551,22 +4551,22 @@
"platforms": [
"linux"
],
- "allowlist_length": 35
+ "allowlist_length": 42
},
"pyright_setting": "STRICT",
"annotation_stats": {
- "annotated_parameters": 3581,
+ "annotated_parameters": 3612,
"unannotated_parameters": 0,
- "annotated_returns": 2394,
+ "annotated_returns": 2416,
"unannotated_returns": 0,
"explicit_Incomplete_parameters": 6,
- "explicit_Incomplete_returns": 35,
+ "explicit_Incomplete_returns": 37,
"explicit_Any_parameters": 32,
- "explicit_Any_returns": 30,
- "annotated_variables": 4442,
+ "explicit_Any_returns": 31,
+ "annotated_variables": 4445,
"explicit_Any_variables": 1,
"explicit_Incomplete_variables": 6,
- "classdefs": 783,
+ "classdefs": 789,
"classdefs_with_Any": 0,
"classdefs_with_Incomplete": 0
}
diff --git a/examples/example.md b/examples/example.md
index ff26349a..9ad0493b 100644
--- a/examples/example.md
+++ b/examples/example.md
@@ -7428,7 +7428,7 @@ All files in this stubs package are tested with the stricter pyright settings in
### Number of lines
-53,977 (excluding blank lines)
+53,999 (excluding blank lines)
### Package status: *stdlib*
@@ -7458,8 +7458,8 @@ Some files in this stubs package are tested with the stricter pyright settings i
- Explicit `Any` parameters: 1,953
- Explicitly `Incomplete` (or partially `Incomplete`) parameters: 86
- Returns:
- - Annotated returns: 14,033
- - Unannotated returns: 400
+ - Annotated returns: 14,068
+ - Unannotated returns: 365
- Explicit `Any` returns: 824
- Explicitly `Incomplete` (or partially `Incomplete`) returns: 18
- Variables:
@@ -7603,7 +7603,7 @@ Partially generated using [mypy-protobuf==3.5.0](https://github.com/nipunn1313/m
### Number of lines
-21,173 (excluding blank lines)
+21,248 (excluding blank lines)
### Package status: *out of date*
@@ -7619,7 +7619,7 @@ The `--ignore-missing-stub` stubtest setting is used in typeshed's CI.
In CI, stubtest is run on `linux` only.
-Typeshed currently has 35 unique allowlist entries for `tensorflow` when running stubtest in CI.
+Typeshed currently has 42 unique allowlist entries for `tensorflow` when running stubtest in CI.
### Pyright settings in CI: *strict*
@@ -7628,21 +7628,21 @@ All files in this stubs package are tested with the stricter pyright settings in
### Statistics on the annotations in typeshed's stubs for `tensorflow`
- Parameters (excluding `self`, `cls`, `metacls` and `mcls`):
- - Annotated parameters: 3,581
+ - Annotated parameters: 3,612
- Unannotated parameters: 0
- Explicit `Any` parameters: 32
- Explicitly `Incomplete` (or partially `Incomplete`) parameters: 6
- Returns:
- - Annotated returns: 2,394
+ - Annotated returns: 2,416
- Unannotated returns: 0
- - Explicit `Any` returns: 30
- - Explicitly `Incomplete` (or partially `Incomplete`) returns: 35
+ - Explicit `Any` returns: 31
+ - Explicitly `Incomplete` (or partially `Incomplete`) returns: 37
- Variables:
- - Annotated variables: 4,442
+ - Annotated variables: 4,445
- Explicit `Any` variables: 1
- Explicitly `Incomplete` (or partially `Incomplete`) variables: 6
- Class definitions:
- - Total class definitions: 783
+ - Total class definitions: 789
- Class definitions with `Any`: 0
- Class definitions marked as at least partially `Incomplete`: 0
From 3e0c370d6f9db7e983eb000d96f3aea3893d5df1 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 1 Feb 2024 18:39:44 +0000
Subject: [PATCH 2/2] Update dependency misc-lint/black to v24 (#184)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [misc-lint/black](https://togithub.com/psf/black)
([changelog](https://togithub.com/psf/black/blob/main/CHANGES.md)) |
`==23.12.1` -> `==24.1.1` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/misc-lint%2fblack/24.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/misc-lint%2fblack/24.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/misc-lint%2fblack/23.12.1/24.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/misc-lint%2fblack/23.12.1/24.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
psf/black (misc-lint/black)
###
[`v24.1.1`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2411)
[Compare Source](https://togithub.com/psf/black/compare/24.1.0...24.1.1)
Bugfix release to fix a bug that made Black unusable on certain file
systems with strict
limits on path length.
##### Preview style
- Consistently add trailing comma on typed parameters
([#4164](https://togithub.com/psf/black/issues/4164))
##### Configuration
- Shorten the length of the name of the cache file to fix crashes on
file systems that
do not support long paths
([#4176](https://togithub.com/psf/black/issues/4176))
###
[`v24.1.0`](https://togithub.com/psf/black/blob/HEAD/CHANGES.md#2410)
[Compare
Source](https://togithub.com/psf/black/compare/23.12.1...24.1.0)
##### Highlights
This release introduces the new 2024 stable style
([#4106](https://togithub.com/psf/black/issues/4106)),
stabilizing the following
changes:
- Add parentheses around `if`-`else` expressions
([#2278](https://togithub.com/psf/black/issues/2278))
- Dummy class and function implementations consisting only of `...` are
formatted more
compactly ([#3796](https://togithub.com/psf/black/issues/3796))
- If an assignment statement is too long, we now prefer splitting on the
right-hand side
([#3368](https://togithub.com/psf/black/issues/3368))
- Hex codes in Unicode escape sequences are now standardized to
lowercase ([#2916](https://togithub.com/psf/black/issues/2916))
- Allow empty first lines at the beginning of most blocks
([#3967](https://togithub.com/psf/black/issues/3967),
[#4061](https://togithub.com/psf/black/issues/4061))
- Add parentheses around long type annotations
([#3899](https://togithub.com/psf/black/issues/3899))
- Enforce newline after module docstrings
([#3932](https://togithub.com/psf/black/issues/3932),
[#4028](https://togithub.com/psf/black/issues/4028))
- Fix incorrect magic trailing comma handling in return types
([#3916](https://togithub.com/psf/black/issues/3916))
- Remove blank lines before class docstrings
([#3692](https://togithub.com/psf/black/issues/3692))
- Wrap multiple context managers in parentheses if combined in a single
`with` statement
([#3489](https://togithub.com/psf/black/issues/3489))
- Fix bug in line length calculations for power operations
([#3942](https://togithub.com/psf/black/issues/3942))
- Add trailing commas to collection literals even if there's a comment
after the last
entry ([#3393](https://togithub.com/psf/black/issues/3393))
- When using `--skip-magic-trailing-comma` or `-C`, trailing commas are
stripped from
subscript expressions with more than 1 element
([#3209](https://togithub.com/psf/black/issues/3209))
- Add extra blank lines in stubs in a few cases
([#3564](https://togithub.com/psf/black/issues/3564),
[#3862](https://togithub.com/psf/black/issues/3862))
- Accept raw strings as docstrings
([#3947](https://togithub.com/psf/black/issues/3947))
- Split long lines in case blocks
([#4024](https://togithub.com/psf/black/issues/4024))
- Stop removing spaces from walrus operators within subscripts
([#3823](https://togithub.com/psf/black/issues/3823))
- Fix incorrect formatting of certain async statements
([#3609](https://togithub.com/psf/black/issues/3609))
- Allow combining `# fmt: skip` with other comments
([#3959](https://togithub.com/psf/black/issues/3959))
There are already a few improvements in the `--preview` style, which are
slated for the
2025 stable style. Try them out and
[share your feedback](https://togithub.com/psf/black/issues). In the
past, the preview
style has included some features that we were not able to stabilize.
This year, we're
adding a separate `--unstable` style for features with known problems.
Now, the
`--preview` style only includes features that we actually expect to make
it into next
year's stable style.
##### Stable style
Several bug fixes were made in features that are moved to the stable
style in this
release:
- Fix comment handling when parenthesising conditional expressions
([#4134](https://togithub.com/psf/black/issues/4134))
- Fix bug where spaces were not added around parenthesized walruses in
subscripts,
unlike other binary operators
([#4109](https://togithub.com/psf/black/issues/4109))
- Remove empty lines before docstrings in async functions
([#4132](https://togithub.com/psf/black/issues/4132))
- Address a missing case in the change to allow empty lines at the
beginning of all
blocks, except immediately before a docstring
([#4130](https://togithub.com/psf/black/issues/4130))
- For stubs, fix logic to enforce empty line after nested classes with
bodies ([#4141](https://togithub.com/psf/black/issues/4141))
##### Preview style
- Add `--unstable` style, covering preview features that have known
problems that would
block them from going into the stable style. Also add the
`--enable-unstable-feature`
flag; for example, use
`--enable-unstable-feature hug_parens_with_braces_and_square_brackets`
to apply this
preview feature throughout 2024, even if a later Black release
downgrades the feature
to unstable ([#4096](https://togithub.com/psf/black/issues/4096))
- Format module docstrings the same as class and function docstrings
([#4095](https://togithub.com/psf/black/issues/4095))
- Fix crash when using a walrus in a dictionary
([#4155](https://togithub.com/psf/black/issues/4155))
- Fix unnecessary parentheses when wrapping long dicts
([#4135](https://togithub.com/psf/black/issues/4135))
- Stop normalizing spaces before `# fmt: skip` comments
([#4146](https://togithub.com/psf/black/issues/4146))
##### Configuration
- Print warning when configuration in `pyproject.toml` contains an
invalid key ([#4165](https://togithub.com/psf/black/issues/4165))
- Fix symlink handling, properly ignoring symlinks that point outside of
root ([#4161](https://togithub.com/psf/black/issues/4161))
- Fix cache mtime logic that resulted in false positive cache hits
([#4128](https://togithub.com/psf/black/issues/4128))
- Remove the long-deprecated `--experimental-string-processing` flag.
This feature can
currently be enabled with `--preview --enable-unstable-feature
string_processing`.
([#4096](https://togithub.com/psf/black/issues/4096))
##### Integrations
- Revert the change to run Black's pre-commit integration only on
specific git hooks
([#3940](https://togithub.com/psf/black/issues/3940)) for better
compatibility with older versions of pre-commit
([#4137](https://togithub.com/psf/black/issues/4137))
---
### Configuration
📅 **Schedule**: Branch creation - "every 3 months on the first day of
the month" (UTC), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
â™» **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/AlexWaygood/typeshed-stats).
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
.pre-commit-config.yaml | 4 ++--
pyproject.toml | 2 +-
scripts/runtests.py | 12 ++++--------
src/typeshed_stats/serialize.py | 6 ++----
tests/test__cli.py | 13 ++++++++-----
tests/test_gather.py | 13 ++++++++-----
6 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 78ffc5e2..b5a0355d 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -16,14 +16,14 @@ repos:
hooks:
- id: ruff
- repo: https://github.com/psf/black-pre-commit-mirror
- rev: 23.12.1 # must match pyproject.toml AND the black used by blacken-docs
+ rev: 24.1.1 # must match pyproject.toml AND the black used by blacken-docs
hooks:
- id: black
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0 # must match pyproject.toml
hooks:
- id: blacken-docs
- additional_dependencies: [black==23.12.1]
+ additional_dependencies: [black==24.1.1]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
diff --git a/pyproject.toml b/pyproject.toml
index 4826a479..1d3c62e1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -85,7 +85,7 @@ typecheck = [
# That's deliberate (it's not necessary to run them all locally).
# This file just lists the ones which it's convenient to have around locally.
misc-lint = [
- "black==23.12.1",
+ "black==24.1.1",
"blacken-docs==1.16.0",
"pre-commit-hooks==4.5.0",
"ruff==0.1.9",
diff --git a/scripts/runtests.py b/scripts/runtests.py
index 4f341da4..c25ada48 100644
--- a/scripts/runtests.py
+++ b/scripts/runtests.py
@@ -15,8 +15,7 @@ def run_checks(
regenerate_examples: Literal[True],
typeshed_dir: Path,
download_typeshed: Literal[False] = ...,
-) -> None:
- ...
+) -> None: ...
@overload
@@ -25,8 +24,7 @@ def run_checks(
regenerate_examples: Literal[True],
download_typeshed: Literal[True],
typeshed_dir: None = ...,
-) -> None:
- ...
+) -> None: ...
@overload
@@ -35,8 +33,7 @@ def run_checks(
regenerate_examples: Literal[False],
download_typeshed: Literal[False] = ...,
typeshed_dir: None = ...,
-) -> None:
- ...
+) -> None: ...
@overload
@@ -45,8 +42,7 @@ def run_checks(
regenerate_examples: bool = ...,
typeshed_dir: Path | None = ...,
download_typeshed: bool = ...,
-) -> None:
- ...
+) -> None: ...
def run_checks(
diff --git a/src/typeshed_stats/serialize.py b/src/typeshed_stats/serialize.py
index 9559e03b..3b61f021 100644
--- a/src/typeshed_stats/serialize.py
+++ b/src/typeshed_stats/serialize.py
@@ -130,13 +130,11 @@ def stats_to_csv(stats: Sequence[PackageInfo | FileInfo]) -> str:
@typing.overload
-def _stats_from_csv(data: str, cls: type[PackageInfo]) -> list[PackageInfo]:
- ...
+def _stats_from_csv(data: str, cls: type[PackageInfo]) -> list[PackageInfo]: ...
@typing.overload
-def _stats_from_csv(data: str, cls: type[FileInfo]) -> list[FileInfo]:
- ...
+def _stats_from_csv(data: str, cls: type[FileInfo]) -> list[FileInfo]: ...
def _stats_from_csv(
diff --git a/tests/test__cli.py b/tests/test__cli.py
index 84f4a4c5..b3b2c24d 100644
--- a/tests/test__cli.py
+++ b/tests/test__cli.py
@@ -617,11 +617,14 @@ def test_KeyboardInterrupt_caught(
args: list[str], typeshed: Path, capsys: pytest.CaptureFixture[str]
) -> None:
args += ["--log", "CRITICAL"]
- with pytest.raises(SystemExit) as exc_info, mock.patch.object(
- typeshed_stats.gather,
- "gather_stats_on_package",
- autospec=True,
- side_effect=KeyboardInterrupt(),
+ with (
+ pytest.raises(SystemExit) as exc_info,
+ mock.patch.object(
+ typeshed_stats.gather,
+ "gather_stats_on_package",
+ autospec=True,
+ side_effect=KeyboardInterrupt(),
+ ),
):
main(args)
diff --git a/tests/test_gather.py b/tests/test_gather.py
index d22c782f..a561cbe3 100644
--- a/tests/test_gather.py
+++ b/tests/test_gather.py
@@ -1225,10 +1225,13 @@ def test_basic_sanity_checks(subtests: SubTests) -> None:
def test_exceptions_bubble_up(typeshed: Path) -> None:
- with pytest.raises(KeyError), mock.patch.object(
- typeshed_stats.gather,
- "gather_stats_on_package",
- autospec=True,
- side_effect=KeyError,
+ with (
+ pytest.raises(KeyError),
+ mock.patch.object(
+ typeshed_stats.gather,
+ "gather_stats_on_package",
+ autospec=True,
+ side_effect=KeyError,
+ ),
):
gather_stats_on_multiple_packages(typeshed_dir=typeshed)