-
-
Notifications
You must be signed in to change notification settings - Fork 3
Migrated Builder Folder to jupyter-builder #29
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
Conversation
@fcollonval
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this PR @Darshan808
My first request will be to reorganize the code to not use a subfolder builder
but directly the existing src
folder.
This implies to merge the tsconfig.json and package.json into the root one.
Then you will need to uncomment the following block:
jupyter-builder/jupyter_builder/federated_extensions.py
Lines 298 to 312 in f7df010
# 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) |
and do any changes to make it works; aka checking that the CI is passing.
Don't hesitate to ping me directly on Gitter for faster replies 😉
--> https://matrix.to/#/@fcollonval-5b7f8ee9d73408ce4fa5a522:gitter.im
Regarding your questions
Indeed, we gonna need to check the version of @jupyterlab-builder is compatible between this package and JupyterLab core and between this package and the extension.
No JupyterLab will still be needed. The end goal of this package is to ease the builder maintenance code and later to support other applications. But the dependency on the application (aka for now JupyterLab) will still be needed in the extension. To be more concrete, currently an extension for JupyterLab specifies in package.json configuration like: "dependencies" {
"@jupyterlab/application": "^4.0.0"
},
"devDependencies": {
"@jupyterlab/builder": "^4.0.0"
},
"jupyterlab": {
"extension": true
} That will be kept - although an additional package will likely be needed: "dependencies" {
"@jupyterlab/application": "^4.0.0"
},
"devDependencies": {
"@jupyterlab/builder": "^4.0.0",
+ "@jupyterlab/core-meta": "^4.0.0"
},
"jupyterlab": {
"extension": true
} However, in pyproject.toml, it will be possible to swap jupyterlab by jupyter-builder reducing the build dependencies stack: [build-system]
- requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version>=0.3.2"]
+ requires = ["hatchling>=1.5.0", "jupyter-builder>=4.0.0,<5", "hatch-nodejs-version>=0.3.2"]
build-backend = "hatchling.build" |
@fcollonval |
@fcollonval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Darshan808 I have two major requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Darshan808
I have two alternative suggestions to avoid skipping linter rule for require()
. And then we are in a good shape to merge this.
A good test to ad would be the matching of the @jupyterlab/builder
, would you be up to the task? We could do that in a follow-up PR.
@fcollonval |
The version matching you restored in this PR. Do you see how to do that? |
The version matching I restored in this PR involved checking the compatibility between the |
The test done in the code is a version range matching between the Line 3 in f7df010
So the test should have the following steps:
Existing test are located at https://github.com/jupyterlab/jupyter-builder/blob/main/tests/test_tpl.py |
Understood! With the major festive season in Nepal, it's a bit challenging to focus fully at the moment, but I’ll make sure to complete it in the next few days. |
Added a test to validate version compatibility.The test modifies the version range for Note: I have currently set the extension's version range to exactly Please review and suggest any changes or modifications. |
@fcollonval |
@fcollonval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @Darshan808 for the test - and congrats to make it work right away.
I have a minor suggestion. But otherwise we are good to go.
tests/test_tpl.py
Outdated
with package_json_path.open("r+", encoding="utf-8") as f: | ||
package_data = json.load(f) | ||
package_data["devDependencies"]["@jupyterlab/builder"] = "4.0.0" | ||
f.seek(0) | ||
json.dump(package_data, f, indent=2) | ||
f.truncate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to not hold on a file.
You could simplify and make easier to read that snippet using:
with package_json_path.open("r+", encoding="utf-8") as f: | |
package_data = json.load(f) | |
package_data["devDependencies"]["@jupyterlab/builder"] = "4.0.0" | |
f.seek(0) | |
json.dump(package_data, f, indent=2) | |
f.truncate() | |
package_data = json.loads(package_json_path.read_text()) | |
package_data["devDependencies"]["@jupyterlab/builder"] = "4.0.0" | |
package_json_path.write_text(json.dumps(package_data, indent=2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion! I made the changes, and it looks much better now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the patience @Darshan808
Congrats on the first PR for this repo.
@fcollonval Since I’m now part of the JupyterLab triage team, I’m even more excited to keep contributing! What's next for us here, or do we have any plans on when core might start using this package? |
Thanks @Darshan808 for the contribution and @fcollonval for the guidance!
Now that JupyterLab |
Sounds like a great idea, and I'm definitely on board! I believe I can contribute effectively with a bit of guidance from @fcollonval. Here are some steps i think needs to be done:
I would appreciate any feedback on this and guidance on the steps I should take to move forward! |
@fcollonval |
Fixes #16
In this PR, I have
builder
folder from the JupyterLab repository to the jupyter-builder
package.jupyter-builder
from the extension’s node_modules if it is presen.Looking forward to your suggestions for moving forward with jupyter-builder development.