-
-
Notifications
You must be signed in to change notification settings - Fork 998
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
96 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""Custom build script for hatch backend""" | ||
import glob | ||
import os | ||
import subprocess | ||
|
||
from hatchling.builders.hooks.plugin.interface import BuildHookInterface | ||
|
||
|
||
class CustomHook(BuildHookInterface): | ||
def initialize(self, version, build_data): | ||
cmd = "build:prod" if version == "stable" else "build" | ||
osp = os.path | ||
here = osp.abspath(osp.dirname(__file__)) | ||
lab_path = osp.join(here, 'ipyparallel', 'labextension') | ||
|
||
if os.environ.get("IPP_DISABLE_JS") == "1": | ||
print("Skipping js installation") | ||
return | ||
|
||
# this tells us if labextension is built at all, not if it's up-to-date | ||
labextension_built = glob.glob(osp.join(lab_path, "*")) | ||
needs_js = True | ||
if not osp.isdir(osp.join(here, ".git")): | ||
print("Installing from a dist, not a repo") | ||
# not in a repo, probably installing from sdist | ||
# could be git-archive, though! | ||
# skip rebuilding js if it's already present | ||
if labextension_built: | ||
print(f"Not regenerating labextension in {lab_path}") | ||
needs_js = False | ||
|
||
if needs_js: | ||
subprocess.check_call(['jlpm'], cwd=here) | ||
subprocess.check_call(['jlpm', 'run', cmd], cwd=here) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dcc3ed3
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.
yukardaki kodların açıklamasını yapabilirmisiniz bir metin şeklinde teşekkür ederim.
x
dcc3ed3
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.
Metin olarak ne işe yaradığı. Teşekkür ederim
dcc3ed3
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.
Hi @Onder71, we switched from using
setuptools
to usinghatch
to build the release files foripyparallel
. Hatch is a new project in the Python Packaging Authority. We are using the custom build hook to build the JupyterLab and Notebook extensions.