Use hatch backend (#6425)
parent
3760a38ad2
commit
614e4780b8
@ -0,0 +1,12 @@
|
||||
[flake8]
|
||||
ignore = E501, W503, E402
|
||||
builtins = c, get_config
|
||||
exclude =
|
||||
.cache,
|
||||
.github,
|
||||
docs,
|
||||
enable-extensions = G
|
||||
extend-ignore =
|
||||
G001, G002, G004, G200, G201, G202,
|
||||
# black adds spaces around ':'
|
||||
E203,
|
||||
@ -1,28 +0,0 @@
|
||||
include LICENSE
|
||||
include *.md
|
||||
include pyproject.toml
|
||||
include setup.py
|
||||
include jupyter-config/notebook.json
|
||||
|
||||
include package.json
|
||||
include install.json
|
||||
include ts*.json
|
||||
|
||||
recursive-include tests *
|
||||
|
||||
graft notebook/labextension
|
||||
graft notebook/static
|
||||
graft notebook/templates
|
||||
|
||||
# Javascript files
|
||||
graft src
|
||||
graft style
|
||||
prune **/node_modules
|
||||
prune lib
|
||||
|
||||
# Patterns to exclude from any directory
|
||||
global-exclude *~
|
||||
global-exclude *.pyc
|
||||
global-exclude *.pyo
|
||||
global-exclude .git
|
||||
global-exclude .ipynb_checkpoints
|
||||
@ -1,77 +0,0 @@
|
||||
[metadata]
|
||||
name = notebook
|
||||
version = attr: notebook._version.__version__
|
||||
description = Jupyter Notebook - A web-based notebook environment for interactive computing
|
||||
long_description = file: README.md
|
||||
long_description_content_type = text/markdown
|
||||
license_file = LICENSE
|
||||
author = Jupyter Development Team
|
||||
author_email = jupyter@googlegroups.com
|
||||
url = https://github.com/jupyter/notebook
|
||||
platforms = Linux, Mac OS X, Windows
|
||||
project_urls =
|
||||
Documentation = https://jupyter-notebook.readthedocs.io/
|
||||
Source = https://github.com/jupyter/notebook
|
||||
Tracker = https://github.com/jupyter/notebook/issues
|
||||
keywords = Jupyter, JupyterLab, Notebook
|
||||
classifiers =
|
||||
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
|
||||
Programming Language :: Python :: 3.10
|
||||
Framework :: Jupyter
|
||||
|
||||
[options]
|
||||
zip_safe = False
|
||||
include_package_data = True
|
||||
packages = find:
|
||||
python_requires = >=3.7
|
||||
install_requires =
|
||||
notebook_shim>=0.1,<0.2
|
||||
jupyterlab>=4.0.0a25,<5
|
||||
jupyterlab_server>=2.13,<3
|
||||
jupyter_server>=1.16.0,<2
|
||||
tornado>=6.1.0
|
||||
|
||||
[options.extras_require]
|
||||
test =
|
||||
coverage
|
||||
nbval
|
||||
pytest>=6.0
|
||||
pytest-cov
|
||||
requests
|
||||
pytest-tornasync
|
||||
pytest-timeout
|
||||
pytest-console-scripts
|
||||
ipykernel
|
||||
pre-commit
|
||||
jupyterlab_server[test]>=2.13,<3
|
||||
|
||||
[options.packages.find]
|
||||
exclude =
|
||||
docs.*
|
||||
tests
|
||||
tests.*
|
||||
|
||||
[options.entry_points]
|
||||
console_scripts =
|
||||
jupyter-notebook = notebook.app:main
|
||||
|
||||
[flake8]
|
||||
ignore = E501, W503, E402
|
||||
builtins = c, get_config
|
||||
exclude =
|
||||
.cache,
|
||||
.github,
|
||||
docs,
|
||||
setup.py
|
||||
enable-extensions = G
|
||||
extend-ignore =
|
||||
G001, G002, G004, G200, G201, G202,
|
||||
# black adds spaces around ':'
|
||||
E203,
|
||||
@ -1,66 +1,3 @@
|
||||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import setuptools
|
||||
|
||||
HERE = Path(__file__).parent.resolve()
|
||||
|
||||
# The name of the project
|
||||
NAME = "notebook"
|
||||
|
||||
labext_name = "@jupyter-notebook/lab-extension"
|
||||
lab_extension_dest = HERE / NAME / "labextension"
|
||||
main_bundle_dest = HERE / NAME / "static"
|
||||
|
||||
# Representative files that should exist after a successful build
|
||||
ensured_targets = [
|
||||
str(lab_extension_dest / "static" / "style.js"),
|
||||
str(main_bundle_dest / "bundle.js"),
|
||||
str(HERE / NAME / "schemas/@jupyter-notebook/application-extension/package.json.orig"),
|
||||
]
|
||||
|
||||
data_files_spec = [
|
||||
("share/jupyter/labextensions/%s" % labext_name, str(lab_extension_dest), "**"),
|
||||
("share/jupyter/labextensions/%s" % labext_name, str(HERE), "install.json"),
|
||||
("share/jupyter/lab/schemas", f"{NAME}/schemas", "@jupyter-notebook/**/*"),
|
||||
(
|
||||
"etc/jupyter/jupyter_server_config.d",
|
||||
"jupyter-config/jupyter_server_config.d",
|
||||
"notebook.json",
|
||||
),
|
||||
(
|
||||
"etc/jupyter/jupyter_notebook_config.d",
|
||||
"jupyter-config/jupyter_notebook_config.d",
|
||||
"notebook.json",
|
||||
),
|
||||
]
|
||||
|
||||
try:
|
||||
from jupyter_packaging import get_data_files, npm_builder, wrap_installers
|
||||
|
||||
# In develop mode, just run yarn
|
||||
builder = npm_builder(build_cmd="build", npm="jlpm", force=True)
|
||||
|
||||
def post_develop(*args, **kwargs):
|
||||
builder(*args, **kwargs)
|
||||
try:
|
||||
subprocess.run([sys.executable, "-m", "pre_commit", "install"])
|
||||
subprocess.run(
|
||||
[sys.executable, "-m", "pre_commit", "install", "--hook-type", "pre-push"]
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
cmdclass = wrap_installers(post_develop=post_develop, ensured_targets=ensured_targets)
|
||||
|
||||
setup_args = dict(cmdclass=cmdclass, data_files=get_data_files(data_files_spec))
|
||||
except ImportError:
|
||||
setup_args = {}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
setuptools.setup(**setup_args)
|
||||
# setup.py shim for use with versions of JupyterLab that require
|
||||
# it for extensions.
|
||||
__import__("setuptools").setup()
|
||||
|
||||
Loading…
Reference in new issue