Skip to content

Commit

Permalink
develop working
Browse files Browse the repository at this point in the history
  • Loading branch information
cronan03 committed Jun 7, 2024
1 parent d47a9bf commit 1a9e92b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 358 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,5 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
junit.xml

tests/dummy/
27 changes: 15 additions & 12 deletions jupyter_builder/base_extension_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

from jupyter_core.application import JupyterApp, base_aliases, base_flags
from traitlets import Bool, Instance, List, Unicode, default
from jupyter_core.paths import jupyter_path

from .coreconfig import CoreConfig
#from .coreconfig import CoreConfig
from .debug_log_file_mixin import DebugLogFileMixin

# from .commands import (
Expand Down Expand Up @@ -118,11 +119,11 @@ class BaseExtensionApp(JupyterApp, DebugLogFileMixin):
name = "lab"

# Not configurable!
core_config = Instance(CoreConfig, allow_none=True)
#core_config = Instance(CoreConfig, allow_none=True)

app_dir = Unicode("", config=True, help="The app directory to target")

should_build = Bool(True, config=True, help="Whether to build the app after the action")
# should_build = Bool(True, config=True, help="Whether to build the app after the action")

dev_build = Bool(
None,
Expand All @@ -137,25 +138,27 @@ class BaseExtensionApp(JupyterApp, DebugLogFileMixin):
help="Whether to minimize a production build (defaults to True).",
)

should_clean = Bool(
False,
config=True,
help="Whether temporary files should be cleaned up after building jupyterlab",
)
# should_clean = Bool(
# False,
# config=True,
# help="Whether temporary files should be cleaned up after building jupyterlab",
# )

splice_source = Bool(False, config=True, help="Splice source packages into app directory.")
# splice_source = Bool(False, config=True, help="Splice source packages into app directory.")

labextensions_path = List(
Unicode(),
help="The standard paths to look in for prebuilt JupyterLab extensions",
)

@default("labextensions_path")
def _default_labextensions_path(self):
# @default("labextensions_path")
# def _default_labextensions_path(self):
# lab = LabApp()
# lab.load_config_file()
# return lab.extra_labextensions_path + lab.labextensions_path
return "Ronan"
@default("labextensions_path")
def _default_labextensions_path(self) -> list[str]:
return jupyter_path("labextensions")

@default("splice_source")
def _default_splice_source(self):
Expand Down
13 changes: 12 additions & 1 deletion jupyter_builder/extension_commands/develop.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

from copy import copy
import os

from traitlets import Bool, Unicode
from ..base_extension_app import BaseExtensionApp
from ..federated_extensions import develop_labextension_py
from jupyter_core.application import base_flags

flags = dict(base_flags)
develop_flags = copy(flags)
develop_flags["overwrite"] = (
{"DevelopLabExtensionApp": {"overwrite": True}},
"Overwrite files",
)

class DevelopLabExtensionApp(BaseExtensionApp):
description = "(developer) Develop labextension"


flags = develop_flags
user = Bool(False, config=True, help="Whether to do a user install")
sys_prefix = Bool(True, config=True, help="Use the sys.prefix as the prefix")
overwrite = Bool(False, config=True, help="Whether to overwrite files") #flags
Expand Down
Loading

0 comments on commit 1a9e92b

Please sign in to comment.