Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ba6a729
Update azure-pipelines-release.yml for Azure Pipelines
rchiodo Aug 20, 2025
f11dd22
Switch to Node 22 and make publish to npm wait (#10830)
rchiodo Aug 20, 2025
d639324
pull-pylance-with-pyright-1.1.403-20250820-201137 (#10831)
bschnurr Aug 21, 2025
fe7aaf2
Reverted a recent change that appears to have affected performance on…
erictraut Aug 25, 2025
1ce3e78
Fixed bug that results in incorrect literal math results for bitwise …
erictraut Aug 25, 2025
30068aa
Fixed a bug that results in false positive errors when using `object`…
erictraut Aug 25, 2025
cd980e2
Fixed a bug that results in spurious errors if a class decorator is a…
erictraut Aug 25, 2025
b45deb0
Document editable installs with uv (#10854)
nickmyatt Aug 29, 2025
b85f7ff
Improved performance of import resolution when there are large number…
erictraut Aug 29, 2025
eccd633
Revert "Reverted a recent change that appears to have affected perfor…
erictraut Aug 30, 2025
464bc01
Fixed bug that results in false negative when a `closed=False` is use…
erictraut Aug 30, 2025
769a124
Added support for `match_args` dataclass parameter. This addresses #1…
erictraut Aug 30, 2025
7395f59
Bump tmp from 0.2.3 to 0.2.5 in /packages/vscode-pyright (#10824)
dependabot[bot] Aug 30, 2025
aff9b4f
Fixed bug that contributes to out-of-memory crashes under certain cir…
erictraut Aug 30, 2025
d97565a
Revert "Added support for tracking multiple constraint sets when perf…
erictraut Aug 30, 2025
c407ded
Fixed regression introduced in 1.1.343 that results in nondeterminist…
erictraut Aug 30, 2025
f3ab90b
Fixed false negative when a keyword parameter in a child class method…
erictraut Aug 31, 2025
29bb1b0
Fixed bug that resulted in false negative when backslash followed by …
erictraut Aug 31, 2025
93c98d7
Fixed bug that causes a false negative when using unquoted types in a…
erictraut Aug 31, 2025
099954d
Added optimization that reduces the number of Uri objects that need t…
erictraut Aug 31, 2025
ce16aa1
Changed the evaluated type of `__class__` from `type[Self]` to `type[…
erictraut Sep 1, 2025
539aabd
Updated error message for `NewType` used in `isinstance` check. I don…
erictraut Sep 1, 2025
bb13689
Fixed bug that results in false positive "reportPossiblyUnboundVariab…
erictraut Sep 1, 2025
7ee3058
Published 1.1.405.
erictraut Sep 2, 2025
35b50b3
Merge tag '1.1.405' into merge-1.1.405
DetachHead Sep 3, 2025
67cecbe
update npm lockfile
DetachHead Sep 3, 2025
135cd91
fix type errors from merge
DetachHead Sep 3, 2025
6ff39f1
fix type errors caused by different version of @types/node to upstream
DetachHead Sep 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions build/azuredevops/azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ extends:
signing:
enabled: true
signType: 'real'
signWithProd: true
outputs:
- output: pipelineArtifact
displayName: 'publish vsix artifact'
Expand All @@ -67,9 +68,9 @@ extends:
fetchTags: false
persistCredentials: True
- task: NodeTool@0
displayName: Use Node 18.x
displayName: Use Node 22.x
inputs:
versionSpec: 18.x
versionSpec: 22.x
- template: /build/templates/npmAuthenticate.yml@self
- task: CmdLine@2
displayName: npm install
Expand Down Expand Up @@ -167,9 +168,9 @@ extends:
fetchTags: false
persistCredentials: True
- task: NodeTool@0
displayName: Use Node 18.x
displayName: Use Node 22.x
inputs:
versionSpec: 18.x
versionSpec: 22.x
- template: /build/templates/npmAuthenticate.yml@self
- task: CmdLine@2
displayName: npm install
Expand Down Expand Up @@ -259,7 +260,7 @@ extends:
- checkout: none
- task: NodeTool@0
inputs:
versionSpec: 18.x
versionSpec: 22.x
- task: DownloadPipelineArtifact@2
displayName: 'Download Artifacts from Validation Job'
inputs:
Expand All @@ -286,7 +287,9 @@ extends:
vsce publish --pat $aadToken --packagePath $(System.ArtifactsDirectory)/$(VSIX_NAME) --noVerify --manifestPath $(System.ArtifactsDirectory)/extension.manifest --signaturePath $(System.ArtifactsDirectory)/extension.signature.p7s

- stage: PublishToNpm
dependsOn: WaitForValidation
dependsOn:
- WaitForValidation
- PublishToMarketplace
jobs:
- job: publish_package
displayName: Publish package to NPM
Expand All @@ -312,5 +315,5 @@ extends:
contentSource: Folder
folderLocation: $(Build.StagingDirectory)/dist
waitForReleaseCompletion: true
owners: erikd@microsoft.com
owners: bschnurr@microsoft.com
approvers: [email protected]
3 changes: 3 additions & 0 deletions docs/usage/import-resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Import hooks can provide an editable installation that is a more accurate repres
- [compat mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior)
- [strict mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html#strict-editable-installs)

#### uv
[uv's build backend](https://docs.astral.sh/uv/concepts/build-backend/) uses `.pth` files by default.

#### Hatchling
[Hatchling](https://hatch.pypa.io/latest/config/build/#dev-mode) uses path-based `.pth` files by
default. It will only use import hooks if you set `dev-mode-exact` to `true`.
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"devDependencies": {
"@detachhead/ts-helpers": "^16.2.0",
"@types/glob": "^8.1.0",
"@types/node": "^22.10.5",
"@types/node": "^22.16.0",
"@types/yargs": "^16.0.9",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-pyright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"devDependencies": {
"@types/copy-webpack-plugin": "^8.0.1",
"@types/node": "^22.10.5",
"@types/node": "^22.16.0",
"copy-webpack-plugin": "^11.0.0",
"shx": "^0.3.4",
"ts-loader": "^9.5.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/pyright-internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pyright-internal",
"displayName": "pyright",
"description": "Type checker for the Python language",
"version": "1.1.404",
"version": "1.1.405",
"license": "MIT",
"private": true,
"files": [
Expand Down Expand Up @@ -45,7 +45,7 @@
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.14",
"@types/node": "^22.10.5",
"@types/node": "^22.16.0",
"@types/tmp": "^0.2.6",
"copy-webpack-plugin": "^11.0.0",
"esbuild-loader": "^3.2.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/pyright-internal/src/analyzer/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ export class Binder extends ParseTreeWalker {
this._addImplicitSymbolToCurrentScope('__path__', node, 'MutableSequence[str]');
this._addImplicitSymbolToCurrentScope('__file__', node, 'str');
this._addImplicitSymbolToCurrentScope('__cached__', node, 'str');
this._addImplicitSymbolToCurrentScope('__dict__', node, 'Dict[str, Any]');
this._addImplicitSymbolToCurrentScope('__annotations__', node, 'Dict[str, Any]');
this._addImplicitSymbolToCurrentScope('__annotations__', node, 'dict[str, Any]');
this._addImplicitSymbolToCurrentScope('__dict__', node, 'dict[str, Any]');
this._addImplicitSymbolToCurrentScope('__builtins__', node, 'Any');
this._addImplicitSymbolToCurrentScope('__doc__', node, 'str | None');
if (this._fileInfo.ipythonMode === IPythonMode.CellDocs) {
Expand Down Expand Up @@ -376,7 +376,7 @@ export class Binder extends ParseTreeWalker {
return true;
}

if (!importResult.isImportFound) {
if (!importResult.isImportFound && importResult.importName) {
this._addDiagnostic(
DiagnosticRule.reportMissingImports,
LocMessage.importResolveFailure().format({
Expand Down Expand Up @@ -588,7 +588,7 @@ export class Binder extends ParseTreeWalker {
const enclosingClass = ParseTreeUtils.getEnclosingClass(node);
if (enclosingClass) {
// Add the implicit "__class__" symbol described in PEP 3135.
this._addImplicitSymbolToCurrentScope('__class__', node, 'type[self]');
this._addImplicitSymbolToCurrentScope('__class__', node, '__class__');
}

this._deferBinding(() => {
Expand Down
5 changes: 5 additions & 0 deletions packages/pyright-internal/src/analyzer/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4475,6 +4475,11 @@ export class Checker extends ParseTreeWalker {
return;
}

// Skip this for keyword argument names.
if (node.parent?.nodeType === ParseNodeType.Argument && node.parent.d.name === node) {
return;
}

if (!AnalyzerNodeInfo.isCodeUnreachable(node)) {
const type = this._evaluator.getType(node);

Expand Down
19 changes: 5 additions & 14 deletions packages/pyright-internal/src/analyzer/constraintTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class ConstraintSet {
}

getScopeIds() {
return this._scopeIds ? [...this._scopeIds] : [];
return new Set(this._scopeIds);
}

hasUnificationVars() {
Expand Down Expand Up @@ -197,26 +197,17 @@ export class ConstraintTracker {
return newTypeVarMap;
}

cloneWithSignature(scopeIds: TypeVarScopeId[]): ConstraintTracker {
cloneWithSignature(scopeId: TypeVarScopeId): ConstraintTracker {
const cloned = this.clone();

const nonEmptyScopeIds = scopeIds.filter((scopeId) => !!scopeId);
if (scopeId) {
const filteredSets = this._constraintSets.filter((context) => context.hasScopeId(scopeId));

if (nonEmptyScopeIds.length > 0) {
const filteredSets = this._constraintSets.filter((context) =>
nonEmptyScopeIds.every((scopeId) => context.hasScopeId(scopeId))
);

// If there are already some constraints that match the scopeIDs,
// reuse them. Otherwise, duplicate all existing constraint sets
// and add the new scope IDs.
if (filteredSets.length > 0) {
cloned._constraintSets = filteredSets;
} else {
cloned._constraintSets.forEach((context) => {
nonEmptyScopeIds.forEach((scopeId) => {
context.addScopeId(scopeId);
});
context.addScopeId(scopeId);
});
}
}
Expand Down
12 changes: 10 additions & 2 deletions packages/pyright-internal/src/analyzer/dataClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -688,15 +688,17 @@ export function synthesizeDataClassMethods(
}
}

// Synthesize the __match_args__ class variable if it doesn't exist.
// Synthesize the __match_args__ class variable if it doesn't exist
// and match_args behavior is not explicitly disabled.
const strType = evaluator.getBuiltInType(node, 'str');
const tupleClassType = evaluator.getBuiltInType(node, 'tuple');
if (
tupleClassType &&
isInstantiableClass(tupleClassType) &&
strType &&
isInstantiableClass(strType) &&
!symbolTable.has('__match_args__')
!symbolTable.has('__match_args__') &&
(classType.shared.dataClassBehaviors?.matchArgs ?? true)
) {
const matchArgsNames: string[] = [];
fullDataClassEntries.forEach((entry) => {
Expand Down Expand Up @@ -1436,6 +1438,12 @@ function applyDataClassBehaviorOverrideValue(
}
break;

case 'match_args':
if (argValue !== undefined) {
behaviors.matchArgs = argValue;
}
break;

case 'frozen': {
let hasUnfrozenBaseClass = false;
let hasFrozenBaseClass = false;
Expand Down
4 changes: 2 additions & 2 deletions packages/pyright-internal/src/analyzer/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export type IntrinsicType =
| 'str | None'
| 'int'
| 'MutableSequence[str]'
| 'type[self]'
| 'Dict[str, Any]'
| '__class__'
| 'dict[str, Any]'
| 'IPython.display.display';

export interface DeclarationBase {
Expand Down
Loading
Loading