mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
npm/jedi: Build pybricks-api from source.
Now that we use a single release pipeline, the API itself might not yet be on PyPI by the time we build jedi, so we build it locally. We'll still keep the API docs on PyPI so users can have local autocomplete, but that path is no longer a dependency for building jedi.
This commit is contained in:
@@ -30,6 +30,10 @@ jobs:
|
||||
- name: Set pybricks-jedi version
|
||||
run: poetry version "$VERSION"
|
||||
working-directory: jedi
|
||||
- name: Set pybricks version and update jedi dependency pin
|
||||
run: |
|
||||
poetry version "$VERSION"
|
||||
sed -i "s/^pybricks = \".*\"/pybricks = \"$VERSION\"/" jedi/pyproject.toml
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '24'
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@ license = "MIT"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">= 3.10, < 3.12"
|
||||
pybricks = "3.6.0b5"
|
||||
# Version is set automatically at build time from the root pyproject.toml. Do not edit.
|
||||
pybricks = "0.0.0"
|
||||
jedi = "0.18.1"
|
||||
typing-extensions = "4.2.0"
|
||||
docstring-parser = "0.14.1"
|
||||
|
||||
+9
-1
@@ -15,6 +15,7 @@ if len(sys.argv) != 2:
|
||||
VERSION = sys.argv[1]
|
||||
|
||||
ROOT_DIR = pathlib.Path(__file__).parent.resolve()
|
||||
REPO_ROOT_DIR = (ROOT_DIR / ".." / "..").resolve()
|
||||
JEDI_SRC_DIR = (ROOT_DIR / ".." / ".." / "jedi").resolve()
|
||||
BUILD_DIR = (ROOT_DIR / "build").resolve()
|
||||
|
||||
@@ -38,6 +39,13 @@ whl_map: dict[str, str] = {}
|
||||
shutil.rmtree(BUILD_DIR, True)
|
||||
BUILD_DIR.mkdir()
|
||||
|
||||
# build pybricks api wheel from local source so pip uses it instead of fetching from PyPI
|
||||
subprocess.check_call(["poetry", "build", "--format=wheel"], cwd=REPO_ROOT_DIR)
|
||||
|
||||
# copy locally built pybricks wheel to build dir
|
||||
for whl in (REPO_ROOT_DIR / "dist").glob("pybricks-*.whl"):
|
||||
shutil.copy(whl, BUILD_DIR)
|
||||
|
||||
# build pybricks-jedi wheel from local source
|
||||
subprocess.check_call(["poetry", "build", "--format=wheel"], cwd=JEDI_SRC_DIR)
|
||||
|
||||
@@ -45,7 +53,7 @@ subprocess.check_call(["poetry", "build", "--format=wheel"], cwd=JEDI_SRC_DIR)
|
||||
for whl in (JEDI_SRC_DIR / "dist").glob("pybricks_jedi-*.whl"):
|
||||
shutil.copy(whl, BUILD_DIR)
|
||||
|
||||
# download transitive dependencies from PyPI, using the local wheel to satisfy pybricks-jedi itself
|
||||
# download transitive dependencies from PyPI, using the local wheels to satisfy pybricks-jedi and pybricks itself
|
||||
subprocess.check_call(
|
||||
[
|
||||
sys.executable,
|
||||
|
||||
Reference in New Issue
Block a user