Skip to content

Commit

Permalink
chore: rename to datalayer_core
Browse files Browse the repository at this point in the history
  • Loading branch information
echarles committed Aug 13, 2024
1 parent 3864643 commit eb308b2
Show file tree
Hide file tree
Showing 69 changed files with 197 additions and 149 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ node_modules/
*.egg-info/
.ipynb_checkpoints
*.tsbuildinfo
datalayer/labextension
datalayer_core/labextension
# Version file is handled by hatchling
datalayer/_version.py

datalayer/static/*.js
datalayer/static/*.css
datalayer_core/static/*.js
datalayer_core/static/*.css

coverage

Expand Down
49 changes: 49 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
header:
license:
spdx-id: Datalayer
copyright-owner: Datalayer, Inc.
copyright-year: 2023-2024
content: |
Copyright (c) [year] [owner]
Datalayer License
paths-ignore:
- '**/*.apt'
- '**/*.cedar'
- '**/*.dash'
- '**/*.fga'
- '**/*.ipynb'
- '**/*.j2'
- '**/*.json'
- '**/*.mamba'
- '**/*.md'
- '**/*.mod'
- '**/*.nblink'
- '**/*.rego'
- '**/*.sum'
- '**/*.svg'
- '**/*.template'
- '**/*.tsbuildinfo'
- '**/*.txt'
- '**/*.yaml'
- '**/*.yml'
- '**/*_key'
- '**/*_key.pub'
- '**/.*'
- '**/LICENSE.txt'
- '**/MANIFEST.in'
- '**/build'
- '**/lib'
- '**/node_modules'
- '**/schemas'
- '**/ssh/*'
- '**/static'
- '**/themes'
- '**/typings'
- '**/*.patch'
- '**/*.bundle.js'
- '**/*.map.js'
- 'LICENSE'

comment: on-failure
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

[![Become a Sponsor](https://img.shields.io/static/v1?label=Become%20a%20Sponsor&message=%E2%9D%A4&logo=GitHub&style=flat&color=1ABC9C)](https://github.com/sponsors/datalayer)

# Ξ Datalayer
# Ξ Datalayer Core

> Datalayer core.
Datalayer is the base foundation package used by many other Datalayer packages. It contains base application classes and configuration inherited by other projects.
Datalayer Core is the base foundation package used by many other Datalayer packages. It contains base application classes and configuration inherited by other projects.

It is also the meta package to get the other Datalayer packages installed.

Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

@pytest.fixture
def jp_server_config(jp_server_config):
return {"ServerApp": {"jpserver_extensions": {"datalayer": True}}}
return {"ServerApp": {"jpserver_extensions": {"datalayer_core": True}}}
1 change: 0 additions & 1 deletion datalayer/static/README.md

This file was deleted.

1 change: 0 additions & 1 deletion datalayer/tests/__init__.py

This file was deleted.

8 changes: 4 additions & 4 deletions datalayer/__init__.py → datalayer_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Dict, List

from datalayer._version import __version__
from datalayer.serverapplication import DatalayerExtensionApp
from datalayer_core._version import __version__
from datalayer_core.serverapplication import DatalayerExtensionApp

try:
from .lab import DatalayerLabApp
Expand All @@ -12,11 +12,11 @@

def _jupyter_server_extension_points() -> List[Dict[str, Any]]:
return [{
"module": "datalayer",
"module": "datalayer_core",
"app": DatalayerExtensionApp,
},
{
"module": "datalayer",
"module": "datalayer_core",
"app": DatalayerLabApp,
}]

Expand Down
2 changes: 1 addition & 1 deletion datalayer/__main__.py → datalayer_core/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""The main for Datalayer."""

from datalayer.serverapplication import main
from datalayer_core.serverapplication import main

if __name__ == "__main__":
main()
4 changes: 4 additions & 0 deletions datalayer_core/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is auto-generated by Hatchling. As such, do not:
# - modify
# - track in version control e.g. be sure to add to .gitignore
__version__ = VERSION = '1.1.2'
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

from pathlib import Path

from datalayer.application import NoStart
from datalayer_core.application import NoStart
from rich.console import Console
from rich.markdown import Markdown

from datalayer.cli.base import DatalayerCLIBaseApp
from datalayer_core.cli.base import DatalayerCLIBaseApp


HERE = Path(__file__).parent
Expand Down
2 changes: 1 addition & 1 deletion datalayer/application.py → datalayer_core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class NoStart(Exception): # noqa
class DatalayerApp(Application):
"""Base class for Datalayer applications"""

name = "datalayer" # override in subclasses
name = "datalayer_core" # override in subclasses
description = "A Datalayer Application"

aliases = base_aliases
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import logging

from datalayer.authn.http_server import get_token
from datalayer_core.authn.http_server import get_token


logging.basicConfig(level=logging.INFO)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import warnings

from datalayer.cli.base import DatalayerCLIBaseApp
from datalayer_core.cli.base import DatalayerCLIBaseApp


class DatalayerLoginApp(DatalayerCLIBaseApp):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import warnings

from datalayer.cli.base import DatalayerCLIBaseApp
from datalayer_core.cli.base import DatalayerCLIBaseApp


class DatalayerLogoutApp(DatalayerCLIBaseApp):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import warnings

from datalayer.cli.base import DatalayerCLIBaseApp
from datalayer_core.cli.base import DatalayerCLIBaseApp
from ...kernels.utils import display_me


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
from pathlib import Path
from socketserver import BaseRequestHandler

from datalayer.authn.state import set_server_port
from datalayer.authn.keys import (
from datalayer_core.authn.state import set_server_port
from datalayer_core.authn.keys import (
DATALAYER_IAM_TOKEN_KEY, DATALAYER_IAM_USER_KEY
)
from datalayer.authn.pages import (
from datalayer_core.authn.pages import (
LANDING_PAGE, AUTH_SUCCESS_PAGE, OAUTH_ERROR_PAGE
)

from datalayer.utils.utils import find_http_port
from datalayer.serverapplication import launch_new_instance
from datalayer._version import __version__
from datalayer_core.utils.utils import find_http_port
from datalayer_core.serverapplication import launch_new_instance
from datalayer_core._version import __version__


HERE = Path(__file__).parent
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion datalayer/authn/pages.py → datalayer_core/authn/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{config}
</script>
<link rel="shortcut icon" href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAC7SURBVFiF7ZU9CgIxEIXfTHbPopfYc+pJ9AALtmJnZSOIoJWFoCTzLHazxh/Ebpt5EPIxM8XXTCKTxYyMCYwJFhOYCo4JFiMuu317PZwaqEBUIar4YMmskL73DytGjgu4gAt4PDJdzkkzMBloBhqBgcu69XW+1I+rNSQESNDuaMEhdP/Fj/7oW+ACLuACHk/3F5BAfuMLBjm8/ZnxNvNtHmY4b7Ztut0bqStoVSHfWj9Z6mr8LXABF3CBB3nvkDfEVN6PAAAAAElFTkSuQmCC" type="image/x-icon" />
<script defer src="/main.datalayer.js"></script>
<script defer src="/main.datalayer-core.js"></script>
</head>
<body>
</body>
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions datalayer/cli/base.py → datalayer_core/cli/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

from rich.console import Console

from datalayer.application import DatalayerApp, base_aliases, base_flags
from datalayer_core.application import DatalayerApp, base_aliases, base_flags
from traitlets import Bool, Unicode

from datalayer.authn.http_server import get_token, USE_JUPYTER_SERVER
from datalayer.utils.utils import fetch, find_http_port
from datalayer_core.authn.http_server import get_token, USE_JUPYTER_SERVER
from datalayer_core.utils.utils import fetch, find_http_port

from datalayer._version import __version__
from datalayer_core._version import __version__


REQUEST_TIMEOUT = 5
Expand All @@ -44,7 +44,7 @@


class DatalayerCLIBaseApp(DatalayerApp):
name = "datalayer"
name = "datalayer_core"

version = __version__

Expand Down
14 changes: 7 additions & 7 deletions datalayer/cli/datalayer.py → datalayer_core/cli/datalayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

from pathlib import Path

from datalayer.authn.apps.loginapp import DatalayerLoginApp
from datalayer.authn.apps.logoutapp import DatalayerLogoutApp
from datalayer.authn.apps.whoamiapp import KernelWhoamiApp
from datalayer_core.authn.apps.loginapp import DatalayerLoginApp
from datalayer_core.authn.apps.logoutapp import DatalayerLogoutApp
from datalayer_core.authn.apps.whoamiapp import KernelWhoamiApp

from datalayer.about.aboutapp import DatalayerAboutApp
from datalayer_core.about.aboutapp import DatalayerAboutApp

from datalayer.kernels.kernelsapp import JupyterKernelsApp
from datalayer_core.kernels.kernelsapp import JupyterKernelsApp

from datalayer.cli.base import DatalayerCLIBaseApp
from datalayer_core.cli.base import DatalayerCLIBaseApp

from datalayer._version import __version__
from datalayer_core._version import __version__


HERE = Path(__file__).parent
Expand Down
6 changes: 3 additions & 3 deletions datalayer/command.py → datalayer_core/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _path_with_self():
path_list = (os.environ.get("PATH") or os.defpath).split(os.pathsep)

# Insert the "scripts" directory for this Python installation
# This allows the "datalayer" command to be relocated, while still
# This allows the "datalayer_core" command to be relocated, while still
# finding subcommands that have been installed in the default
# location.
# We put the scripts directory at the *end* of PATH, so that
Expand Down Expand Up @@ -239,7 +239,7 @@ def main() -> None: # noqa
if args.version:
print("Selected Datalayer core packages...")
for package in [
"datalayer",
"datalayer_core",
"IPython",
"ipykernel",
"ipywidgets",
Expand All @@ -255,7 +255,7 @@ def main() -> None: # noqa
"traitlets",
]:
try:
if package == "datalayer": # We're already here
if package == "datalayer_core": # We're already here
version = __version__
else:
mod = __import__(package)
Expand Down
2 changes: 1 addition & 1 deletion datalayer/config.py → datalayer_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DatalayerConfig(DatalayerApp):

def start(self):
"""Start the application."""
with open(Path.home() / ".datalayer/datalayer.conf", "rb") as toml:
with open(Path.home() / ".datalayer/datalayer_core.conf", "rb") as toml:
config = tomllib.load(toml)
self.log.info(config)
self.log.info(config["title"])
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ExtensionHandlerMixin,
)

from datalayer._version import __version__
from datalayer_core._version import __version__



Expand All @@ -22,7 +22,7 @@ def get(self):
settings = self.settings["datalayer_config"]
res = json.dumps(
{
"extension": "datalayer",
"extension": "datalayer_core",
"version": __version__,
"settings": dict(
run_url=settings.run_url,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import tornado

from datalayer.handlers.base import BaseTemplateHandler
from datalayer_core.handlers.base import BaseTemplateHandler


# pylint: disable=W0223
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from jupyter_server.base.handlers import APIHandler
from jupyter_server.extension.handler import ExtensionHandlerMixin

from datalayer._version import __version__
from datalayer_core._version import __version__


# pylint: disable=W0223
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


from ..._version import __version__
from datalayer.cli.base import (
from datalayer_core.cli.base import (
DatalayerCLIBaseApp,
datalayer_aliases,
datalayer_flags,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

class WSTerminalInteractiveShell(ZMQTerminalInteractiveShell):
manager = Instance(
"datalayer.kernels.manager.KernelManager", allow_none=True
"datalayer_core.kernels.manager.KernelManager", allow_none=True
)
client = Instance(
"datalayer.kernels.client.KernelClient", allow_none=True
"datalayer_core.kernels.client.KernelClient", allow_none=True
)

@default("banner")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from rich import print_json
from traitlets import Dict, Float, Unicode

from datalayer.cli.base import DatalayerCLIBaseApp, datalayer_aliases
from datalayer_core.cli.base import DatalayerCLIBaseApp, datalayer_aliases
from ..utils import display_kernels


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from rich.console import Console
from rich.table import Table

from datalayer.cli.base import DatalayerCLIBaseApp
from datalayer_core.cli.base import DatalayerCLIBaseApp


def new_kernel_table():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


from ..._version import __version__
from datalayer.cli.base import (
from datalayer_core.cli.base import (
DatalayerCLIBaseApp,
datalayer_aliases,
datalayer_flags,
Expand Down
Loading

0 comments on commit eb308b2

Please sign in to comment.