Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
44 changes: 44 additions & 0 deletions .github/workflows/check-code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check code style

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check-code-style:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout the branch from the PR that triggered the job
run: gh pr checkout ${{ github.event.pull_request.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: astral-sh/setup-uv@v6
with:
version: "latest"
python-version: 3.12
activate-environment: true

- name: Install dependencies
run: |
uv pip install .
uv pip install pre-commit

- name: Run pre-commit
run: |
pre-commit run --all-files
3 changes: 0 additions & 3 deletions .github/workflows/check-typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
pull_request:
branches:
- main
pull_request_target:
branches:
- main
workflow_dispatch:

concurrency:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ on:
pull_request:
branches:
- main
pull_request_target:
branches:
- main

workflow_dispatch:

jobs:
Expand All @@ -19,6 +17,10 @@ jobs:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:

- name: Install deps
run: |
sudo apt install libdbus-1-3 libdbus-1-dev libglib2.0-dev
- name: Checkout
uses: actions/checkout@v2
with:
Expand All @@ -37,7 +39,9 @@ jobs:
run: |
uv pip install .
uv pip install .[test]
uv pip install secretstorage dbus-python keyring

- uses: t1m0thyj/unlock-keyring@v1
- name: Run basic tests
env:
DATALAYER_TEST_TOKEN: ${{ secrets.DATALAYER_TEST_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,6 @@ dmypy.json
!**/.env
!.github
!.devcontainer
.env

# Environment variables
.env
74 changes: 37 additions & 37 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,41 @@ header:
Distributed under the terms of the Modified BSD 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'
- "**/*.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
comment: on-failure
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
exclude: "^conda.recipe|dev|docs|style|src|jupyter-config|.github|.storybook$"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
- id: prettier
exclude_types: ["python", "jupyter", "shell", "gitignore"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.13
hooks:
# Run the linter
- id: ruff-check
types_or: [python, pyi]
# Run the formatter
- id: ruff-format
types_or: [python, pyi]
21 changes: 9 additions & 12 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import type { StorybookConfig } from '@storybook/react-vite';
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
"stories": [
"../src/**/*.mdx",
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
],
"addons": [
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@chromatic-com/storybook",
"@storybook/addon-docs",
"@storybook/addon-onboarding",
"@storybook/addon-a11y",
"@storybook/addon-vitest"
"@storybook/addon-vitest",
],
"framework": {
"name": "@storybook/react-vite",
"options": {}
}
framework: {
name: "@storybook/react-vite",
options: {},
},
};
export default config;
export default config;
12 changes: 6 additions & 6 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import type { Preview } from '@storybook/react-vite'
import type { Preview } from "@storybook/react-vite";

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
color: /(background|color)$/i,
date: /Date$/i,
},
},

a11y: {
// 'todo' - show a11y violations in the test UI only
// 'error' - fail CI on a11y violations
// 'off' - skip a11y checks entirely
test: 'todo'
}
test: "todo",
},
},
};

export default preview;
export default preview;
6 changes: 3 additions & 3 deletions .storybook/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
import { setProjectAnnotations } from '@storybook/react-vite';
import * as projectAnnotations from './preview';
import { setProjectAnnotations } from "@storybook/react-vite";
import * as projectAnnotations from "./preview";

// This is an important step to apply the right configuration when testing your stories.
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

pytest_plugins = ("jupyter_server.pytest_plugin", )
pytest_plugins = ("jupyter_server.pytest_plugin",)


@pytest.fixture
Expand Down
18 changes: 14 additions & 4 deletions datalayer_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@


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


__all__ = [
"__version__",
"_jupyter_server_extension_points",
"DatalayerClient",
"DatalayerExtensionApp",
]
1 change: 0 additions & 1 deletion datalayer_core/about/aboutapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class DatalayerAboutApp(DatalayerCLIBaseApp):

_requires_auth = False


def start(self):
try:
super().start()
Expand Down
11 changes: 8 additions & 3 deletions datalayer_core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
{"Application": {"log_level": logging.DEBUG}},
"set log level to logging.DEBUG (maximize logging output)",
),
"generate-config": ({"DatalayerApp": {"generate_config": True}}, "generate default config file"),
"generate-config": (
{"DatalayerApp": {"generate_config": True}},
"generate default config file",
),
"y": (
{"DatalayerApp": {"answer_yes": True}},
"Answer yes to any questions instead of prompting.",
Expand Down Expand Up @@ -170,7 +173,7 @@ def migrate_config(self):
"""Migrate config/data from IPython 3"""
try: # let's see if we can open the marker file
# for reading and updating (writing)
f_marker = open(os.path.join(self.config_dir, "migrated"), 'r+') # noqa
f_marker = open(os.path.join(self.config_dir, "migrated"), "r+") # noqa
except PermissionError: # not readable and/or writable
return # so let's give up migration in such an environment
except FileNotFoundError: # cannot find the marker file
Expand Down Expand Up @@ -224,7 +227,9 @@ def load_config_file(self, suppress_errors=True):
# self.raise_config_file_errors
if (not suppress_errors) or self.raise_config_file_errors:
raise
self.log.warning("Error loading config file: %s", config_file_name, exc_info=True)
self.log.warning(
"Error loading config file: %s", config_file_name, exc_info=True
)

# subcommand-related
def _find_subcommand(self, name):
Expand Down
1 change: 0 additions & 1 deletion datalayer_core/authn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Copyright (c) 2023-2025 Datalayer, Inc.
# Distributed under the terms of the Modified BSD License.

1 change: 0 additions & 1 deletion datalayer_core/authn/apps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Copyright (c) 2023-2025 Datalayer, Inc.
# Distributed under the terms of the Modified BSD License.

4 changes: 3 additions & 1 deletion datalayer_core/authn/apps/loginapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ def start(self):
self.exit(1)

if self.token and self.user_handle:
self.log.info(f"🎉 Successfully authenticated as {self.user_handle} on {self.run_url}")
self.log.info(
f"🎉 Successfully authenticated as {self.user_handle} on {self.run_url}"
)
print()
1 change: 0 additions & 1 deletion datalayer_core/authn/apps/logoutapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class DatalayerLogoutApp(DatalayerCLIBaseApp):

_requires_auth = False


def start(self):
"""Start the app."""
if len(self.extra_args) > 0: # pragma: no cover
Expand Down
3 changes: 2 additions & 1 deletion datalayer_core/authn/apps/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from rich.console import Console
from rich.table import Table


def display_me(me: dict, infos: dict) -> None:
"""Display a my profile."""
table = Table(title="Profile")
Expand All @@ -17,7 +18,7 @@ def display_me(me: dict, infos: dict) -> None:
me["handle_s"],
me["first_name_t"],
me["last_name_t"],
infos.get("run_url")
infos.get("run_url"),
)
console = Console()
console.print(table)
Loading
Loading