Skip to content
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ jupyterlab_s3_browser/labextension
*.txt
cypress/videos/*
cypress/screenshots/*
.yarn/*
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ A JupyterLab extension for browsing S3-compatible object storage.

## Installation

### JupyterLab 3
### JupyterLab 4

```bash
pip install jupyterlab-s3-browser
```

### JupyterLab 3

```bash
pip install jupyterlab-s3-browser==0.12.0
```

You may also need to run:

```
Expand Down
2 changes: 1 addition & 1 deletion jupyterlab_s3_browser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ def _load_jupyter_server_extension(server_app):
setup_handlers(server_app.web_app)


# backwards compatibility with jupyterlab 2.0
# backwards compatibility with previous jupyterlab versions
load_jupyter_server_extension = _load_jupyter_server_extension
_jupyter_server_extension_paths = _jupyter_server_extension_points
90 changes: 50 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jupyterlab-s3-browser",
"version": "0.12.0",
"version": "0.13.0",
"description": "JupyterLab extension for browsing S3-compatible object storage",
"keywords": [
"s3",
Expand Down Expand Up @@ -35,10 +35,10 @@
},
"scripts": {
"build": "jlpm run build:lib && jlpm run build:labextension:dev",
"build:prod": "jlpm run build:lib && jlpm run build:labextension",
"build:prod": "jlpm run clean && jlpm run build:lib && jlpm run build:labextension",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:lib": "tsc",
"build:lib": "tsc --build",
"clean": "jlpm run clean:lib",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"clean:labextension": "rimraf jupyterlab_s3_browser/labextension",
Expand All @@ -48,48 +48,50 @@
"precommit": "lint-staged",
"prettier": "prettier --write '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}'",
"test": "cd test && ./run-tests.sh",
"install:extension": "jupyter labextension develop --overwrite .",
"install:extension": "jlpm run build && pip install -e .",
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w",
"watch:labextension": "jupyter labextension watch .",
"prepare": "husky install"
"watch:src": "tsc --build --watch",
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyterlab/application": "^2.0.0 || ^3.0.0",
"@jupyterlab/apputils": "^2.0.0 || ^3.0.0",
"@jupyterlab/coreutils": "^4.0.0 || ^5.0.0",
"@jupyterlab/docmanager": "^2.0.0 || ^3.0.0",
"@jupyterlab/docregistry": "^2.0.0 || ^3.0.0",
"@jupyterlab/filebrowser": "^2.0.0 || ^3.0.0",
"@jupyterlab/mainmenu": "^3.1.4",
"@jupyterlab/services": "^5.0.0 || ^6.0.0",
"@jupyterlab/settingregistry": "^2.0.0 || ^3.0.0",
"@lumino/algorithm": "^1.2.3",
"@lumino/disposable": "^1.7.0",
"@lumino/messaging": "^1.3.3",
"@lumino/signaling": "^1.3.5",
"@types/react": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"base64-js": "^1.2.3",
"eslint": "^7.18.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"react": "^16.0.0 || ^17.0.0"
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/docmanager": "^4.0.0",
"@jupyterlab/docregistry": "^4.0.0",
"@jupyterlab/filebrowser": "^4.0.0",
"@jupyterlab/mainmenu": "^4.0.0",
"@jupyterlab/services": "^7.0.0",
"@jupyterlab/settingregistry": "^4.0.0",
"@lumino/algorithm": "^2.0.0",
"@lumino/disposable": "^2.0.0",
"@lumino/messaging": "^2.0.0",
"@lumino/signaling": "^2.0.0",
"@lumino/widgets": "^2.0.0",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"base64-js": "^1.5.1",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@jupyterlab/builder": "^2.0.0 || ^3.0.1",
"@types/base64-js": "^1.2.5",
"@types/text-encoding": "^0.0.32",
"cypress": "^9.0.0",
"husky": "^7.0.2",
"lint-staged": "^7.2.0",
"@jupyterlab/builder": "^4.0.0",
"@types/base64-js": "^1.3.0",
"@types/text-encoding": "^0.0.36",
"cypress": "^13.0.0",
"husky": "^8.0.0",
"lint-staged": "^13.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"rimraf": "^2.6.3",
"prettier": "^2.8.7",
"rimraf": "^5.0.0",
"subpackage": "^1.1.0",
"typescript": "~4.1.3"
"typescript": "~5.0.4"
},
"sideEffects": [
"style/*.css",
Expand All @@ -103,7 +105,9 @@
]
},
"resolutions": {
"@types/react": "^17.0.0"
"@types/react": "^18.0.0",
"yjs": "^13.6.8",
"@rjsf/core": "^5.13.0"
},
"jupyterlab": {
"discovery": {
Expand All @@ -117,6 +121,12 @@
}
},
"extension": true,
"outputDir": "jupyterlab_s3_browser/labextension"
"outputDir": "jupyterlab_s3_browser/labextension",
"sharedPackages": {
"react": {
"bundled": false,
"singleton": true
}
}
}
}
69 changes: 63 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,75 @@
[build-system]
requires = ["jupyter_packaging~=0.7.9", "jupyterlab~=3.0", "setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0", "hatch-nodejs-version"]
build-backend = "hatchling.build"
[tool.poetry]
name = "jupyterlab-s3-browser"
version = "0.1"
version = "0.13.0"
description = "JupyterLab extension for browsing S3-compatible object storage"
authors = ["James Reeve"]

[tool.poetry.dependencies]
python = "3.10.*"
jupyterlab = "^3.2.3"
python = ">=3.8"
jupyterlab = "^4.0.0"

[tool.poetry.dev-dependencies]
jupyter_packaging = "0.11.0"
pytest = "*"
moto = "*"
coverage = "*"

[project]
name = "jupyterlab_s3_browser"
description = "JupyterLab extension for browsing S3-compatible object storage"
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE"}
authors = [
{name = "James Reeve"}
]
keywords = [
"Jupyter",
"JupyterLab",
"JupyterLab4",
"S3"
]
classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Framework :: Jupyter",
]
dependencies = [
"jupyter_server>=2.0.0",
"boto3",
"s3fs>=2021.10.1",
"singleton-decorator",
]
dynamic = ["version"]

[project.optional-dependencies]
dev = [
"pytest",
"moto",
"coverage"
]

[tool.hatch.version]
source = "nodejs"

[tool.hatch.build.targets.wheel.shared-data]
"jupyter-config" = "etc/jupyter"

[tool.hatch.build.targets.wheel]
artifacts = ["jupyterlab_s3_browser/labextension"]
exclude = [".github", "binder"]

[tool.hatch.build.hooks.jupyter-builder]
build-function = "hatch_jupyter_builder.npm_builder"
ensured-targets = ["jupyterlab_s3_browser/labextension/package.json"]
dependencies = ["hatch-jupyter-builder>=0.5.0"]

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
npm = ["jlpm"]
29 changes: 29 additions & 0 deletions rebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# This script cleans and rebuilds the jupyterlab-s3-browser extension for JupyterLab 4

# Exit on error
set -e

# Clean up existing build artifacts
echo "Cleaning up..."
rm -rf node_modules
rm -rf lib
rm -rf jupyterlab_s3_browser/labextension
rm -f tsconfig.tsbuildinfo
rm -rf build
rm -rf dist
rm -rf *.egg-info

# Install dependencies
echo "Installing dependencies..."
jlpm install

# Build the extension
echo "Building extension..."
jlpm build:prod

# Install the Python package
echo "Installing Python package..."
pip install -e .

echo "Build complete! You can now start JupyterLab with 'jupyter lab'"
106 changes: 13 additions & 93 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,106 +1,26 @@
"""
jupyterlab_s3_browser setup
This file is kept for backwards compatibility with older installation methods.
The actual metadata is now in pyproject.toml
"""
import json
from pathlib import Path

import setuptools
from jupyter_packaging import (
combine_commands,
create_cmdclass,
ensure_targets,
install_npm,
skip_if_exists,
)

HERE = Path(__file__).parent.resolve()

# The name of the project
name = "jupyterlab_s3_browser"

# Get our version
pkg_json = json.loads((HERE / "package.json").read_bytes())
version = pkg_json["version"]

lab_path = HERE / name / "labextension"

# Representative files that should exist after a successful build
jstargets = [
str(lab_path / "package.json"),
]

package_data_spec = {
name: ["*"],
}

labext_name = "jupyterlab-s3-browser"

data_files_spec = [
("share/jupyter/labextensions/%s" % labext_name, str(lab_path), "**"),
("share/jupyter/labextensions/%s" % labext_name, str(HERE), "install.json"),
(
"etc/jupyter/jupyter_server_config.d",
"jupyter-config/jupyter_server_config.d",
"jupyterlab_s3_browser.json",
),
(
"etc/jupyter/jupyter_notebook_config.d",
"jupyter-config/jupyter_notebook_config.d",
"jupyterlab_s3_browser.json",
),
]


cmdclass = create_cmdclass(
"jsdeps", package_data_spec=package_data_spec, data_files_spec=data_files_spec
)

js_command = combine_commands(
install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]),
ensure_targets(jstargets),
)

is_repo = (HERE / ".git").exists()
if is_repo:
cmdclass["jsdeps"] = js_command
else:
cmdclass["jsdeps"] = skip_if_exists(jstargets, js_command)

# long_description = (HERE / "README.md").read_text()

setup_args = dict(
name=name,
version=pkg_json["version"],
url=pkg_json["homepage"],
author=pkg_json["author"],
description=pkg_json["description"],
license=pkg_json["license"],
setuptools.setup(
name="jupyterlab_s3_browser",
description="JupyterLab extension for browsing S3-compatible object storage",
long_description="JupyterLab extension for browsing S3-compatible object storage",
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
cmdclass=cmdclass,
platforms="Linux, Mac OS X, Windows",
keywords=["Jupyter", "JupyterLab", "JupyterLab3", "S3"],
python_requires=">=3.6",
zip_safe=False,
include_package_data=True,
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Framework :: Jupyter",
],
install_requires=[
"notebook",
"jupyter_server>=2.0.0",
"boto3",
"s3fs>=2021.10.1",
"jupyter_server",
"singleton-decorator",
"jupyterlab>=2.0.0",
"jupyterlab>=4.0.0",
],
extras_require={"dev": ["jupyter_packaging~=0.7.9", "pytest", "moto", "coverage"]},
zip_safe=False,
include_package_data=True,
python_requires=">=3.8",
license="Apache-2.0",
)

if __name__ == "__main__":
setuptools.setup(**setup_args)
Loading