Skip to content

Commit 88b9018

Browse files
committed
npm/jedi: Use pybricks-api from source.
1 parent d61e452 commit 88b9018

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

npm/jedi/build.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
import email.parser
4+
import importlib.metadata
45
import json
56
import pathlib
67
import shutil
@@ -53,17 +54,14 @@
5354
for whl in (JEDI_SRC_DIR / "dist").glob("pybricks_jedi-*.whl"):
5455
shutil.copy(whl, BUILD_DIR)
5556

56-
# download transitive dependencies from PyPI, using the local wheels to satisfy pybricks-jedi and pybricks itself
57+
# download transitive dependencies using the versions already installed in the venv
58+
# (installed by poetry from the lockfile, so versions are pinned correctly)
59+
transitive_packages = ["jedi", "parso", "docstring-parser", "typing-extensions"]
60+
transitive = [
61+
f"{pkg}=={importlib.metadata.version(pkg)}" for pkg in transitive_packages
62+
]
5763
subprocess.check_call(
58-
[
59-
sys.executable,
60-
"-m",
61-
"pip",
62-
"download",
63-
"--only-binary=any",
64-
f"--find-links={BUILD_DIR}",
65-
"pybricks-jedi",
66-
],
64+
[sys.executable, "-m", "pip", "download", "--only-binary=any"] + transitive,
6765
cwd=BUILD_DIR,
6866
)
6967

0 commit comments

Comments
 (0)