File tree Expand file tree Collapse file tree 5 files changed +27
-8
lines changed
Expand file tree Collapse file tree 5 files changed +27
-8
lines changed Original file line number Diff line number Diff line change 1010### Changed
1111- Changed app display from "fullscreen" to "standalone" ([ support #867 ] ).
1212
13+ ### Fixed
14+ - Fixed imports in scripts that use ` async ` or ` await ` keywords ([ support #873 ] ).
15+
1316[ support#867 ] : https://github.com/pybricks/support/issues/867
17+ [ support#873 ] : https://github.com/pybricks/support/issues/873
1418
1519## [ 2.0.1] - 2022-12-21
1620
Original file line number Diff line number Diff line change 1919 "@pybricks/jedi" : " 1.6.0" ,
2020 "@pybricks/mpy-cross-v5" : " ^2.0.0" ,
2121 "@pybricks/mpy-cross-v6" : " ^2.0.0" ,
22- "@qoretechnologies /python-parser " : " ^0.4.10 " ,
22+ "@pybricks /python-program-analysis " : " ^1.0.1 " ,
2323 "@reduxjs/toolkit" : " ^1.9.1" ,
2424 "@shopify/react-i18n" : " ^7.5.1" ,
2525 "@svgr/webpack" : " ^6.5.1" ,
Original file line number Diff line number Diff line change @@ -131,3 +131,18 @@ from q import q
131131 ] ) ,
132132 ) ;
133133} ) ;
134+
135+ test ( 'https://github.com/pybricks/support/issues/873 regression' , ( ) => {
136+ const script = `
137+ from my_module import data
138+
139+ async def hello():
140+ print("hello")
141+
142+ print(data)
143+ ` ;
144+
145+ const modules = findImportedModules ( script ) ;
146+
147+ expect ( modules ) . toEqual ( new Set ( [ 'my_module' ] ) ) ;
148+ } ) ;
Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: MIT
22// Copyright (c) 2022 The Pybricks Authors
33
4- import { parse , walk } from '@qoretechnologies /python-parser ' ;
4+ import { parse , walk } from '@pybricks /python-program-analysis ' ;
55import type { FileContents , FileStorageDb } from '../fileStorage' ;
66
77/** The Python file extension ('.py') */
@@ -99,7 +99,7 @@ export function findImportedModules(py: string): ReadonlySet<string> {
9999 } ) ;
100100 } catch ( err ) {
101101 // istanbul ignore if
102- if ( process . env . NODE_ENV ! == 'test' ) {
102+ if ( process . env . NODE_ENV = == 'test' ) {
103103 console . error ( err ) ;
104104 }
105105
Original file line number Diff line number Diff line change @@ -2418,7 +2418,7 @@ __metadata:
24182418 "@pybricks/jedi": 1.6.0
24192419 "@pybricks/mpy-cross-v5": ^2.0.0
24202420 "@pybricks/mpy-cross-v6": ^2.0.0
2421- "@qoretechnologies /python-parser ": ^0.4.10
2421+ "@pybricks /python-program-analysis ": ^1.0.1
24222422 "@reduxjs/toolkit": ^1.9.1
24232423 "@shopify/react-i18n": ^7.5.1
24242424 "@svgr/webpack": ^6.5.1
@@ -2541,12 +2541,12 @@ __metadata:
25412541 languageName: unknown
25422542 linkType: soft
25432543
2544- "@qoretechnologies /python-parser @npm:^0.4.10 ":
2545- version: 0.4.10
2546- resolution: "@qoretechnologies /python-parser @npm:0.4.10 "
2544+ "@pybricks /python-program-analysis @npm:^1.0.1 ":
2545+ version: 1.0.1
2546+ resolution: "@pybricks /python-program-analysis @npm:1.0.1 "
25472547 dependencies:
25482548 lodash: ^4.17.15
2549- checksum: ab0d91719a8301b64f9c7fb1a7711721d52d78325abbf0c7c75940a48fd4a3d2b07456c95f8507af19faa333bf87116dd62f18e6c8e76486a57673e3224ac3ee
2549+ checksum: f34171e8b315b4f81c7f0768ce644c22965e3f9fc2c2514fa6256601e05f2e4c9df0518b2a591ac8455f4d54f48929cd8c741f8751dd6d6e792a2520339ca7bb
25502550 languageName: node
25512551 linkType: hard
25522552
You can’t perform that action at this time.
0 commit comments