Skip to content

Bump mypy from 1.20.2 to 2.1.0#739

Open
dependabot[bot] wants to merge 72 commits into
v3from
dependabot/pip/mypy-2.1.0
Open

Bump mypy from 1.20.2 to 2.1.0#739
dependabot[bot] wants to merge 72 commits into
v3from
dependabot/pip/mypy-2.1.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github May 20, 2026

Copy link
Copy Markdown
Contributor

Bumps mypy from 1.20.2 to 2.1.0.

Changelog

Sourced from mypy's changelog.

Mypy Release Notes

Next Release

Mypy 2.1

We’ve just uploaded mypy 2.1.0 to the Python Package Index (PyPI). Mypy is a static type checker for Python. This release includes new features, performance improvements and bug fixes. You can install it as follows:

python3 -m pip install -U mypy

You can read the full documentation for this release on Read the Docs.

librt.vecs: Fast Growable Array Type for Mypyc

The new librt.vecs module provides an efficient growable array type vec that is optimized for mypyc use. It provides fast, packed arrays with integer and floating point value types, which can be several times faster than list, and tens of times faster than array.array in code compiled using mypyc. It also supports nested vec objects and non-value-type items, such as vec[vec[str]].

Refer to the documentation for the details.

Contributed by Jukka Lehtosalo.

librt.random: Fast Pseudo-Random Number Generation

The new librt.random module provides fast pseudo-random number generation that is optimized for code compiled using mypyc. It can be 3x to 10x faster than the stdlib random module in compiled code.

Refer to the documentation for the details.

Contributed by Jukka Lehtosalo (PR 21433).

Mypyc Improvements

  • Enable incremental self-compilation (Vaggelis Danias, PR 21369)
  • Make compilation order with multiple files consistent (Piotr Sawicki, PR 21419)
  • Fix crash on accessing StopAsyncIteration (Piotr Sawicki, PR 21406)
  • Fix incremental compilation with separate flag (Vaggelis Danias, PR 21299)

Fixes to Crashes

  • Fix crash on partial type with --allow-redefinition and global declaration (Jukka Lehtosalo, PR 21428)
  • Fix broken awaitable generator patching (Ivan Levkivskyi, PR 21435)

... (truncated)

Commits

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

sobregosodd and others added 30 commits December 30, 2025 16:12
When scanning a local directory, metadata detectors (typosquatting,
deceptive author, compromised email, etc.) previously could not run
because no registry metadata was available. The new --metadata flag
accepts a path to a package metadata JSON file (matching the PyPI
JSON API or npm registry format), enabling the full detection
pipeline for local scans.

The recall benchmark worker now automatically passes package_info-*.json
files from the malicious-software-packages-dataset ZIPs to guarddog
via this flag, so metadata rules contribute to recall measurement.
cluster.py now identifies ZIPs with zero source files and records them
in cluster_index.json under "empty_packages". recall.py filters these
out during regenerate_samples so benchmarks don't waste budget on
packages that have no code to analyze.
Packages like litellm ship as a ZIP containing another ZIP. These are
not empty; they just need double extraction. Count nested archives
(.zip, .whl, .tar.gz) as having content.
Add 12 new YARA threat rules targeting common malware patterns that were
previously undetected: download-and-execute chains, chr/hex obfuscation,
PowerShell encoded commands, dynamic import+exec, reverse shells,
Telegram/Discord exfil, DNS exfil, npm preinstall hooks, dependency
confusion indicators, setup.py suspicious imports, and system info
exfiltration.

Tighten 6 existing rules to reduce false positives: threat-process-hooks
(inline meta rules, exclude prepare/prepack), threat-process-injection-dll
(remove overly broad .dll/.exe string matches), threat-runtime-system-info
(require 3+ calls instead of 1), threat-process-spawn-silent (require both
stdout+stderr suppressed), threat-runtime-obfuscation-general (raise hex
threshold to 50+, remove bracket notation), threat-runtime-obfuscation-base64exec
(tighten JS Buffer.from pattern, require explicit base64 encoding).

Update risk engine: add "setup" and "npm" to valid categories (was silently
dropping findings), make HIGH-specificity threats form standalone risks,
add cross-category risk formation, add specificity gate (LOW-specificity-only
capped at 4.9 unless MEDIUM+ specificity present), bump single-stage chain
value from 0.3 to 0.4.

Benchmark results (threshold 5.0, 1000 benign + 745 malicious packages):

|          | Baseline | Final  | Change  |
|----------|----------|--------|---------|
| Recall   | 79.3%    | 87.0%  | +7.7pp  |
| Precision| 75.5%    | 80.2%  | +4.7pp  |
| F1       | 77.3%    | 83.5%  | +6.2pp  |
| MCC      | 0.600    | 0.704  | +0.104  |
…lusters

Removed 95 packages that had no source files (empty placeholders, dep
confusion probes with no payload, nested-archive dataset bugs). Backfilled
94 replacements from previously unrepresented clusters for better diversity.

Recall on cleaned dataset: 88.8% (was 87.0% on dirty dataset with empty
packages dragging it down). PyPI recall 98.9%, compromised_lib 100%.
Add threat-runtime-obfuscation-log-suppress rule for console.log
suppression combined with hex arrays/fromCharCode (common npm malware
evasion). Extend threat-process-download-exec to catch Node.js
child_process + fetch patterns.

Recall now at 90.6% (threshold 5.0), up from 88.8%.
* Remove deprecated CLI commands 'scan' and 'verify'

* code formatting
@dependabot dependabot Bot force-pushed the dependabot/pip/mypy-2.1.0 branch 2 times, most recently from 518520e to 4792e50 Compare June 5, 2026 13:51
arpitjain099 and others added 14 commits June 5, 2026 15:51
The github_action scanner built the source archive URL as
https://github.com/<repo>/archive/refs/tags/<version>.zip, which only
resolves for tag refs. When an action is pinned to a commit SHA or a
branch (a common and recommended supply-chain practice for SHAs), that
URL returns 404 and the scan fails.

GitHub's /archive/<ref>.zip endpoint resolves any ref type (tag, branch,
or commit SHA), so use that single form for all versioned refs. Tag
behavior is unchanged; the no-version zipball path is untouched.

Adds unit tests covering tag, commit-sha, and branch refs plus the
no-version case.

Fixes #714

Signed-off-by: arpitjain099 <arpitjain099@gmail.com>
…ives

The npm_metadata_mismatch heuristic compared dependency URLs with strict
string equality. This caused false positives when the NPM manifest and
package.json listed the same git repository with and without the trailing
`.git` suffix (e.g. `git+https://…/repo.git` vs `git+https://…/repo`).

Adds `_normalize_git_url()` to strip the `.git` suffix from git-scheme
URLs before comparison, and 10 new tests covering the normalization
logic, integration behavior, and edge cases.

Fixes #634
@dependabot dependabot Bot force-pushed the dependabot/pip/mypy-2.1.0 branch from 4792e50 to ba8cfd6 Compare June 16, 2026 15:42
christophetd and others added 9 commits June 16, 2026 17:44
* Fix npm-http-dependency false positive on metadata URL fields

The npm-http-dependency rule treats any plain http:// value that is not a
known metadata field as a dependency URL (#http_plain > #http_meta). Nested
metadata objects (author, repository, bugs, funding) carry their URL under a
"url" key, which was missing from the allowlist, so packages with an
http author/repo URL (e.g. "author": { "url": "http://..." }) were
falsely flagged.

Add "url" to the metadata-field allowlist and extend the benign fixture to
cover author/repository/bugs URLs over http.

* Constrain http-dependency url allowlist to metadata objects

Addresses review feedback: allowlisting any key named "url" let a dependency
literally named "url" with a plain-http specifier ("dependencies": {"url":
"http://..."}) count as both $http_plain and $http_meta, so it was no longer
reported. Replace the bare "url" allowlist entry with $http_meta_url, which
matches the nested "url" key only inside a metadata object (author, repository,
bugs, funding, contributors, maintainers). A url dependency over http is caught
again, while benign metadata URLs stay suppressed.

Add a positive fixture covering the url-as-dependency case.
* Add S3 scanning mode

Support scanning a package stored in S3, e.g. 'guarddog npm scan
s3://bucket/path/to/package'. Detects the s3:// scheme, verifies AWS
authentication via STS, syncs the prefix (or downloads a single archive
object) to a temp dir, scans it under the sandbox like other untrusted
content, and removes it from disk afterward.

Folder prefixes are downloaded concurrently with a thread pool, and the
botocore connection pool is sized to match the worker count.

* Normalize S3 folder prefixes and handle 403 on head_object
* Add nightly evals workflow

* Add nightly-evals.yml to workflow scanner test expectations
- Update branch triggers (main → v2) in tag-release.yml, pr.yml,
  guarddog.yml, and scorecard.yml (scorecard now tracks v3 as default)
- Replace Chainguard STS OIDC policy for main with v2
- Add branch-level Docker tag (guarddog:v2/v3); :latest now points to v3
- Update README and CONTRIBUTING branch references

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename main branch to v2 in CI workflows and docs
Bumps [mypy](https://github.com/python/mypy) from 1.20.2 to 2.1.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](python/mypy@v1.20.2...v2.1.0)

---
updated-dependencies:
- dependency-name: mypy
  dependency-version: 2.1.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot changed the base branch from main to v3 June 23, 2026 14:33
@dependabot dependabot Bot changed the title chore(deps-dev): bump mypy from 1.20.2 to 2.1.0 Bump mypy from 1.20.2 to 2.1.0 Jun 23, 2026
@dependabot dependabot Bot force-pushed the dependabot/pip/mypy-2.1.0 branch from ba8cfd6 to f4ccdf6 Compare June 23, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants