Skip to content

Commit

Permalink
Migrated Builder Folder to jupyter-builder (#29)
Browse files Browse the repository at this point in the history
* builder-migration

* script modification

* script modification

* Automatic application of license header

* organized-build-files

* remove-automatic-application-of-license-header-on-yarn.js

* remove-yarn-license-header

* remove-unused-dependencies

* add-eslint-files

* ruff-error-fixed

* correct-spellings

* fix-lints

* removed-lint-check-skips

* add test for version match

* test version modification

* test modification

* test modification

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Darshan808 and github-actions[bot] authored Nov 5, 2024
1 parent 093297c commit c5277f4
Show file tree
Hide file tree
Showing 18 changed files with 3,282 additions and 64 deletions.
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

0 comments on commit c5277f4

Please sign in to comment.