-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #705 from blink1073/use-flit
Switch to flit build backend
- Loading branch information
Showing
11 changed files
with
193 additions
and
1,274 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -32,3 +32,4 @@ lib | |
ipyparallel/labextension | ||
tsconfig.tsbuildinfo | ||
dask-worker-space | ||
jupyter-data/share |
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,79 @@ | ||
"""A build backend that handles installing the template files. | ||
See https://peps.python.org/pep-0517/#in-tree-build-backends | ||
""" | ||
import glob | ||
import os | ||
import shutil | ||
import subprocess | ||
|
||
from flit_core.buildapi import build_editable # noqa | ||
from flit_core.buildapi import build_sdist # noqa | ||
from flit_core.buildapi import build_wheel # noqa | ||
from flit_core.buildapi import ( | ||
get_requires_for_build_editable as get_requires_for_build_editable_orig, | ||
) | ||
from flit_core.buildapi import ( | ||
get_requires_for_build_sdist as get_requires_for_build_sdist_orig, | ||
) | ||
from flit_core.buildapi import ( | ||
get_requires_for_build_wheel as get_requires_for_build_wheel_orig, | ||
) | ||
|
||
osp = os.path | ||
here = osp.abspath(osp.dirname(__file__)) | ||
share_dir = osp.join(here, "jupyter-data", "share", "jupyter") | ||
nbclassic_path = osp.join(share_dir, "nbextensions", "ipyparallel") | ||
lab_path = osp.join(share_dir, "labextensions", "ipyparallel-labextension") | ||
|
||
|
||
def _handle_labextension(cmd="build:prod"): | ||
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(os.path.join(lab_path, "*")) | ||
needs_js = True | ||
if not os.path.isdir(os.path.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) | ||
|
||
source = osp.join(here, 'ipyparallel', 'labextension') | ||
if labextension_built: | ||
shutil.rmtree(lab_path) | ||
shutil.copytree(source, lab_path) | ||
|
||
|
||
def _handle_nbextension(): | ||
source = osp.join(here, 'ipyparallel', 'nbextension', 'static') | ||
if osp.exists(nbclassic_path): | ||
shutil.rmtree(nbclassic_path) | ||
shutil.copytree(source, nbclassic_path) | ||
|
||
|
||
def get_requires_for_build_wheel(config_settings=None): | ||
_handle_labextension() | ||
_handle_nbextension() | ||
return get_requires_for_build_wheel_orig(config_settings=config_settings) | ||
|
||
|
||
def get_requires_for_build_sdist(config_settings=None): | ||
_handle_labextension() | ||
_handle_nbextension() | ||
return get_requires_for_build_sdist_orig(config_settings=config_settings) | ||
|
||
|
||
def get_requires_for_build_editable(config_settings=None): | ||
_handle_labextension(cmd="build") | ||
_handle_nbextension() | ||
return get_requires_for_build_editable_orig(config_settings=config_settings) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,114 @@ | ||
[build-system] | ||
requires = [ | ||
"jupyterlab>=3.0.0,==3.*", | ||
"packaging", | ||
"setuptools>=40.8.0", | ||
"wheel", | ||
"flit_core >=3.2,<4" | ||
] | ||
build-backend = "setuptools.build_meta" | ||
build-backend = "buildapi" | ||
backend-path = ["."] | ||
|
||
[project] | ||
name = "ipyparallel" | ||
authors = [{name = "IPython Development Team", email = "[email protected]"}] | ||
license = {file = "COPYING.md"} | ||
readme = "README.md" | ||
description = "Interactive Parallel Computing with IPython" | ||
keywords = [ | ||
"Interactive", | ||
"Interpreter", | ||
"Shell", | ||
"Parallel", | ||
] | ||
classifiers = [ | ||
"Framework :: Jupyter", | ||
"Framework :: Jupyter :: JupyterLab", | ||
"Framework :: Jupyter :: JupyterLab :: 3", | ||
"Framework :: Jupyter :: JupyterLab :: Extensions", | ||
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: System Administrators", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: BSD License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
] | ||
urls = {Homepage = "https://ipython.org"} | ||
requires-python = ">=3.7" | ||
dependencies = [ | ||
"entrypoints", | ||
"decorator", | ||
"pyzmq>=18", | ||
"traitlets>=4.3", | ||
"ipython>=4", | ||
"jupyter_client", | ||
"ipykernel>=4.4", | ||
"tornado>=5.1", | ||
"psutil", | ||
"python-dateutil>=2.1", | ||
"tqdm", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.entry-points."ipyparallel.controller_launchers"] | ||
batch = "ipyparallel.cluster.launcher:BatchControllerLauncher" | ||
htcondor = "ipyparallel.cluster.launcher:HTCondorControllerLauncher" | ||
local = "ipyparallel.cluster.launcher:LocalControllerLauncher" | ||
lsf = "ipyparallel.cluster.launcher:LSFControllerLauncher" | ||
mpi = "ipyparallel.cluster.launcher:MPIControllerLauncher" | ||
pbs = "ipyparallel.cluster.launcher:PBSControllerLauncher" | ||
sge = "ipyparallel.cluster.launcher:SGEControllerLauncher" | ||
ssh = "ipyparallel.cluster.launcher:SSHControllerLauncher" | ||
slurm = "ipyparallel.cluster.launcher:SlurmControllerLauncher" | ||
winhpc = "ipyparallel.cluster.launcher:WindowsHPCControllerLauncher" | ||
|
||
[project.entry-points."ipyparallel.engine_launchers"] | ||
batch = "ipyparallel.cluster.launcher:BatchEngineSetLauncher" | ||
htcondor = "ipyparallel.cluster.launcher:HTCondorEngineSetLauncher" | ||
local = "ipyparallel.cluster.launcher:LocalEngineSetLauncher" | ||
lsf = "ipyparallel.cluster.launcher:LSFEngineSetLauncher" | ||
mpi = "ipyparallel.cluster.launcher:MPIEngineSetLauncher" | ||
pbs = "ipyparallel.cluster.launcher:PBSEngineSetLauncher" | ||
sge = "ipyparallel.cluster.launcher:SGEEngineSetLauncher" | ||
slurm = "ipyparallel.cluster.launcher:SlurmEngineSetLauncher" | ||
ssh = "ipyparallel.cluster.launcher:SSHEngineSetLauncher" | ||
sshproxy = "ipyparallel.cluster.launcher:SSHProxyEngineSetLauncher" | ||
winhpc = "ipyparallel.cluster.launcher:WindowsHPCEngineSetLauncher" | ||
|
||
[project.optional-dependencies] | ||
nbext = ["notebook", "jupyter_server"] | ||
serverextension = ["jupyter_server"] | ||
labextension = ["jupyter_server", "jupyterlab>=3"] | ||
retroextension = ["jupyter_server", "retrolab"] | ||
benchmark = ["asv"] | ||
test = [ | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-asyncio", | ||
"pytest-tornado", | ||
"ipython[test]", | ||
"testpath", | ||
] | ||
|
||
[project.scripts] | ||
ipcluster = "ipyparallel.cluster.app:main" | ||
ipcontroller = "ipyparallel.controller.app:main" | ||
ipengine = "ipyparallel.engine.app:main" | ||
|
||
[tool.flit.sdist] | ||
include = [ | ||
"benchmarks/", | ||
"docs/", | ||
"*.json", | ||
"yarn.lock", | ||
"jupyter-data/", | ||
"lab/", | ||
"buildapi.py", | ||
] | ||
exclude = ["lab/lib/"] | ||
|
||
[tool.flit.external-data] | ||
directory = "jupyter-data" | ||
|
||
[tool.black] | ||
skip-string-normalization = true | ||
|
Oops, something went wrong.