From 7cf7e9afbcce44e7b98ab7446561fe7963506738 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 2 May 2022 06:31:22 -0500 Subject: [PATCH 1/3] use flit backend --- setup.cfg => .flake8 | 4 -- .github/workflows/main.yml | 3 +- MANIFEST.in | 23 ------------ RELEASING.md | 2 +- pyproject.toml | 75 ++++++++++++++++++++++++++++++++++++++ readthedocs.yml | 4 +- requirements-doc.txt | 5 --- requirements-test.txt | 10 ----- requirements.txt | 7 ---- setup.py | 73 ------------------------------------- 10 files changed, 78 insertions(+), 128 deletions(-) rename setup.cfg => .flake8 (84%) delete mode 100644 MANIFEST.in delete mode 100644 requirements-doc.txt delete mode 100644 requirements-test.txt delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/setup.cfg b/.flake8 similarity index 84% rename from setup.cfg rename to .flake8 index be4af3a75..c2ddfb0f9 100644 --- a/setup.cfg +++ b/.flake8 @@ -16,7 +16,3 @@ per-file-ignores = # F841 local variable 'foo' is assigned to but never used # B007 Loop control variable jupyter_client/tests/*: B011, F841, B007 - -[metadata] -name = jupyter_client -version = attr: jupyter_client._version.__version__ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f9e34a41..4c3540ec8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,8 +93,7 @@ jobs: - name: Build the docs run: | - pip install -r requirements-doc.txt - pip install . + pip install ".[doc]" cd docs make html SPHINXOPTS="-W" diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 43a101de5..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,23 +0,0 @@ -include *.md -include *.txt -include jupyter_client/py.typed - -# Documentation -graft docs -exclude docs/\#* -exclude docs/_* - -# docs subdirs we want to skip -prune docs/build -prune docs/gh-pages -prune docs/dist - -# Patterns to exclude from any directory -global-exclude *~ -global-exclude __pycache__ -global-exclude *.pyc -global-exclude *.pyo -global-exclude *.orig -global-exclude .git -global-exclude .github -global-exclude .ipynb_checkpoints diff --git a/RELEASING.md b/RELEASING.md index cb3e78e3d..6e5c6e9ce 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -9,7 +9,7 @@ The recommended way to make a release is to use [`jupyter_releaser`](https://git ### Prerequisites - First check that the CHANGELOG.md is up to date for the next release version -- Install packaging requirements: `pip install tbump build tomlkit==0.7.0` +- Install packaging requirements: `pip install jupyter_releaser` ### Bump version diff --git a/pyproject.toml b/pyproject.toml index c312a704e..45a32f012 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,78 @@ +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "jupyter_client" +description = "Jupyter protocol implementation and client libraries" +keywords = [ "Interactive", "Interpreter", "Shell", "Web",] +classifiers = [ + "Framework :: Jupyter", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: System Administrators", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", +] +requires-python = ">=3.7" +dependencies = [ + "entrypoints", + "jupyter_core>=4.9.2", + "nest-asyncio>=1.5.4", + "python-dateutil>=2.8.2", + "pyzmq>=22.3", + "tornado>=6.0", + "traitlets", +] +dynamic = [ "version",] + +[[project.authors]] +name = "Jupyter Development Team" +email = "jupyter@googlegroups.com" + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.license] +text = "BSD" + +[project.urls] +Homepage = "https://jupyter.org" + +[project.optional-dependencies] +test = [ + "codecov", + "coverage", + "ipykernel>=6.5", + "ipython", + "mypy", + "pre-commit", + "pytest", + "pytest-asyncio>=0.18", + "pytest-cov", + "pytest-timeout", +] +doc = [ + "ipykernel", + "myst-parser", + "sphinx>=1.3.6", + "sphinx_rtd_theme", + "sphinxcontrib_github_alt", +] + +[project.scripts] +jupyter-kernelspec = "jupyter_client.kernelspecapp:KernelSpecApp.launch_instance" +jupyter-run = "jupyter_client.runapp:RunApp.launch_instance" +jupyter-kernel = "jupyter_client.kernelapp:main" + [tool.black] line-length = 100 skip-string-normalization = true diff --git a/readthedocs.yml b/readthedocs.yml index 0bc286a00..4b22b960b 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -4,8 +4,6 @@ sphinx: python: version: 3.7 install: - # install docs requirements - - requirements: requirements-doc.txt # install jupyter-client itself - method: pip - path: . + path: ".[doc]" diff --git a/requirements-doc.txt b/requirements-doc.txt deleted file mode 100644 index 855dc3afb..000000000 --- a/requirements-doc.txt +++ /dev/null @@ -1,5 +0,0 @@ -ipykernel -myst-parser -sphinx>=1.3.6 -sphinx_rtd_theme -sphinxcontrib_github_alt diff --git a/requirements-test.txt b/requirements-test.txt deleted file mode 100644 index 5bca70088..000000000 --- a/requirements-test.txt +++ /dev/null @@ -1,10 +0,0 @@ -codecov -coverage -ipykernel>=6.5 -ipython -mypy -pre-commit -pytest -pytest-asyncio>=0.18 -pytest-cov -pytest-timeout diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 880149ba6..000000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -entrypoints -jupyter_core>=4.9.2 -nest-asyncio>=1.5.4 -python-dateutil>=2.8.2 -pyzmq>=22.3 -tornado>=6.0 -traitlets diff --git a/setup.py b/setup.py deleted file mode 100644 index 9337e50cd..000000000 --- a/setup.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) Jupyter Development Team. -# Distributed under the terms of the Modified BSD License. -import os - -from setuptools import find_packages # type:ignore[import] -from setuptools import setup - -here = os.path.abspath(os.path.dirname(__file__)) - -with open(os.path.join(here, 'README.md'), 'r') as f: - long_description = f.read() - -with open(os.path.join(here, 'requirements.txt'), 'r') as f: - requirements = f.read().splitlines() - -with open(os.path.join(here, 'requirements-test.txt'), 'r') as f: - requirements_test = f.read().splitlines() - -with open(os.path.join(here, 'requirements-doc.txt'), 'r') as f: - requirements_doc = f.read().splitlines() - -setup( - name='jupyter_client', - packages=find_packages(exclude=["docs", "docs.*", "tests", "tests.*"]), - include_package_data=True, - description='Jupyter protocol implementation and client libraries', - long_description=long_description, - long_description_content_type='text/markdown', - author='Jupyter Development Team', - author_email='jupyter@googlegroups.com', - url='https://jupyter.org', - license='BSD', - license_file='COPYING.md', - platforms="Linux, Mac OS X, Windows", - keywords=['Interactive', 'Interpreter', 'Shell', 'Web'], - project_urls={ - 'Documentation': 'https://jupyter-client.readthedocs.io', - 'Source': 'https://github.com/jupyter/jupyter_client/', - 'Tracker': 'https://github.com/jupyter/jupyter_client/issues', - }, - classifiers=[ - 'Framework :: Jupyter', - 'Intended Audience :: Developers', - 'Intended Audience :: Education', - 'Intended Audience :: System Administrators', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - ], - python_requires='>=3.7', - install_requires=requirements, - extras_require={ - 'test': requirements_test, - 'doc': requirements_doc, - }, - entry_points={ - 'console_scripts': [ - 'jupyter-kernelspec = jupyter_client.kernelspecapp:KernelSpecApp.launch_instance', - 'jupyter-run = jupyter_client.runapp:RunApp.launch_instance', - 'jupyter-kernel = jupyter_client.kernelapp:main', - ], - 'jupyter_client.kernel_provisioners': [ - 'local-provisioner = jupyter_client.provisioning:LocalProvisioner', - ], - }, -) From 404cca491d27ba7a965a92fbbfe55d396c4cccb1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 2 May 2022 06:39:08 -0500 Subject: [PATCH 2/3] fix version check --- jupyter_client/__init__.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/jupyter_client/__init__.py b/jupyter_client/__init__.py index 1aa6feadb..0a6eec513 100644 --- a/jupyter_client/__init__.py +++ b/jupyter_client/__init__.py @@ -3,15 +3,21 @@ from ._version import protocol_version # noqa from ._version import protocol_version_info # noqa from ._version import version_info # noqa -from .asynchronous import AsyncKernelClient # noqa -from .blocking import BlockingKernelClient # noqa -from .client import KernelClient # noqa -from .connect import * # noqa -from .launcher import * # noqa -from .manager import AsyncKernelManager # noqa -from .manager import KernelManager # noqa -from .manager import run_kernel # noqa -from .multikernelmanager import AsyncMultiKernelManager # noqa -from .multikernelmanager import MultiKernelManager # noqa -from .provisioning import KernelProvisionerBase # noqa -from .provisioning import LocalProvisioner # noqa + +try: + from .asynchronous import AsyncKernelClient # noqa + from .blocking import BlockingKernelClient # noqa + from .client import KernelClient # noqa + from .connect import * # noqa + from .launcher import * # noqa + from .manager import AsyncKernelManager # noqa + from .manager import KernelManager # noqa + from .manager import run_kernel # noqa + from .multikernelmanager import AsyncMultiKernelManager # noqa + from .multikernelmanager import MultiKernelManager # noqa + from .provisioning import KernelProvisionerBase # noqa + from .provisioning import LocalProvisioner # noqa +except ModuleNotFoundError: + import warnings + + warnings.warn("Could not import submodules") From 244ecce36bd0d6df195637223a86e6dc9e7c4554 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 2 May 2022 20:01:11 -0500 Subject: [PATCH 3/3] Fix license spec --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 45a32f012..bf183ecee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ file = "README.md" content-type = "text/markdown" [project.license] -text = "BSD" +file = "COPYING.md" [project.urls] Homepage = "https://jupyter.org"