Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated Builder Folder to jupyter-builder #29

Merged
merged 18 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ header:
- node_modules/**
- node_modules/.**
- 'yarn.lock'
- 'jupyter_builder/yarn.js'

comment: on-failure
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ repos:
hooks:
- id: codespell
args: ["-L", "sur,nd"]
exclude: jupyter_builder/yarn.js
exclude: "jupyter_builder/yarn.js|jupyter_builder/jupyterlab_semver.py"

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
Expand Down
38 changes: 17 additions & 21 deletions jupyter_builder/federated_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
except ImportError:
from tomli import load

from .commands import _test_overlap
from .core_path import default_core_path

# from .commands import _test_overlap TO BE DONE -----------------------------

DEPRECATED_ARGUMENT = object()

HERE = osp.abspath(osp.dirname(__file__))
Expand Down Expand Up @@ -201,9 +200,7 @@ def build_labextension( # noqa: PLR0913
path, logger=None, development=False, static_url=None, source_map=False, core_path=None
):
"""Build a labextension in the given path"""

core_path = default_core_path() if core_path is None else str(Path(core_path).resolve())

ext_path = str(Path(path).resolve())

if logger:
Expand Down Expand Up @@ -293,23 +290,22 @@ def _ensure_builder(ext_path, core_path):
raise ValueError(msg)
target = osp.dirname(target)

# IGNORING Test Overlap ---------------------------------

# overlap = _test_overlap(
# dep_version1, dep_version2, drop_prerelease1=True, drop_prerelease2=True
# )
# if not overlap:
# with open(
# osp.join(target, "node_modules", "@jupyterlab", "builder", "package.json")
# ) as fid:
# dep_version2 = json.load(fid).get("version")
# overlap = _test_overlap(
# dep_version1, dep_version2, drop_prerelease1=True, drop_prerelease2=True
# )

# if not overlap:
# msg = f"Extensions require a devDependency on @jupyterlab/builder@{dep_version1}, you have a dependency on {dep_version2}" # noqa: E501
# raise ValueError(msg)
# Check for compatible versions
overlap = _test_overlap(
dep_version1, dep_version2, drop_prerelease1=True, drop_prerelease2=True
)
if not overlap:
with open(
osp.join(target, "node_modules", "@jupyterlab", "builder", "package.json")
) as fid:
dep_version2 = json.load(fid).get("version")
overlap = _test_overlap(
dep_version1, dep_version2, drop_prerelease1=True, drop_prerelease2=True
)

if not overlap:
msg = f"Extensions require a devDependency on @jupyterlab/builder@{dep_version1}, you have a dependency on {dep_version2}" # noqa: E501
raise ValueError(msg)

return osp.join(
target, "node_modules", "@jupyterlab", "builder", "lib", "build-labextension.js"
Expand Down
Loading
Loading