diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 35804d2..f6151fc 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -45,9 +45,9 @@ jobs: - uses: actions/setup-python@v2 - name: Linting run: | - pip install check-manifest mypy - check-manifest + pip install Flake8-pyproject mypy mypy jupyter_console + flake8 jupyter_console check_release: runs-on: ubuntu-latest @@ -65,7 +65,7 @@ jobs: - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 - test_minimum_verisons: + test_minimum_versions: name: Test Minimum Versions runs-on: ubuntu-latest timeout-minutes: 10 @@ -78,3 +78,18 @@ jobs: run: | pip install ".[test]" pytest || pytest --lf + + tests_check: # This job does nothing and is only used for the branch protection + if: always() + needs: + - build + - lint + - check_release + - check_links + - test_minimum_versions + runs-on: ubuntu-latest + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/readthedocs.yml b/.readthedocs.yaml similarity index 100% rename from readthedocs.yml rename to .readthedocs.yaml diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index c55dcd1..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,29 +0,0 @@ -include LICENSE -include CONTRIBUTING.md -include README.md - -# Documentation -graft docs -graft scripts -exclude docs/\#* - -# Examples -graft examples - -# 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 *.pyc -global-exclude *.pyo -global-exclude .git -global-exclude .ipynb_checkpoints - -include *.md -include *.yml -include mypy.ini -include pytest.ini -include .mailmap diff --git a/RELEASING.md b/RELEASING.md index 9221254..9c15e13 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -9,12 +9,12 @@ 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 hatch twine` ### Bump version - `export version=` -- `tbump ${version} --no-push` +- `hatch version ${version}` ### Push to GitHub @@ -27,6 +27,6 @@ git push upstream && git push upstream --tags ```bash rm -rf dist/* rm -rf build/* -python -m build . +hatch build . twine upload dist/* ``` diff --git a/jupyter_console/__init__.py b/jupyter_console/__init__.py index 99a8058..02bbfd1 100644 --- a/jupyter_console/__init__.py +++ b/jupyter_console/__init__.py @@ -1,3 +1,3 @@ """Jupyter terminal console""" -from ._version import version_info, __version__ +from ._version import version_info, __version__ # noqa diff --git a/jupyter_console/tests/test_console.py b/jupyter_console/tests/test_console.py index e23ca3c..83b5ee6 100644 --- a/jupyter_console/tests/test_console.py +++ b/jupyter_console/tests/test_console.py @@ -15,7 +15,7 @@ from traitlets.tests.utils import check_help_all_output -should_skip = sys.platform == "win32" or sys.version_info < (3,8) or sys.version_info[:2] == (3, 10) +should_skip = sys.platform == "win32" or sys.version_info < (3,8) or sys.version_info[:2] == (3, 10) # noqa @flaky diff --git a/pyproject.toml b/pyproject.toml index dcc03bc..4c28204 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,23 +1,75 @@ [build-system] -requires = ["setuptools>=40.8.0", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["hatchling>=1.5"] +build-backend = "hatchling.build" + +[project] +name = "jupyter-console" +dynamic = ["version"] +description = "Jupyter terminal console" +readme = "README.md" +license = { file= "LICENSE" } +requires-python = ">=3.7" +authors = [ + { name = "Jupyter Development Team", email = "jupyter@googlegroups.com" }, +] +keywords = [ + "Interactive", + "Interpreter", + "Shell", + "Web", +] +classifiers = [ + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: BSD License", + "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", + "Programming Language :: Python :: 3.11", +] +dependencies = [ + "ipykernel>=6.14", + "ipython", + "jupyter_client>=7.0.0", + "jupyter_core>=4.12,!=5.0.*", + "prompt_toolkit>=3.0.30", + "pygments", + "pyzmq>=17", + "traitlets>=5.4", +] + +[project.optional-dependencies] +test = [ + "pexpect", + "pytest", + "flaky", +] + +[project.scripts] +jupyter-console = "jupyter_console.app:main" + +[project.urls] +Homepage = "https://jupyter.org" + +[tool.hatch.version] +path = "jupyter_console/_version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/jupyter_console", +] [tool.jupyter-releaser] skip = ["check-links"] -[tool.check-manifest] -ignore = [".mailmap", "*.yml", "*.yaml"] - -[tool.tbump.version] -current = "6.5.1" -regex = ''' - (?P\d+)\.(?P\d+)\.(?P\d+) - ((?Pa|b|rc|.dev)(?P\d+))? -''' +[tool.pytest.ini_options] +addopts = "--durations=10" -[tool.tbump.git] -message_template = "Bump to {new_version}" -tag_template = "v{new_version}" +[tool.flake8] +max-line-length = "99" +ignore = "W291, E266, E265, E128, E251, E402, E124, E302, W293, E231, E222, W503, E126, E121, W391, E226, E127, W504" -[[tool.tbump.file]] -src = "jupyter_console/_version.py" diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 9da3653..0000000 --- a/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -addopts = --durations=10 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7eaac12..0000000 --- a/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[flake8] -max-line-length = 99 -ignore = W291, E266, E265, E128, E251, E402, E124, E302, W293, E231, E222, W503, E126, E121, W391, E226, E127, W504 - -[metadata] -name = jupyter_console -version = attr: jupyter_console._version.__version__ -license_file = LICENSE diff --git a/setup.py b/setup.py deleted file mode 100644 index 79c5a5a..0000000 --- a/setup.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# coding: utf-8 - -# Copyright (c) Jupyter Development Team. -# Distributed under the terms of the Modified BSD License. - -from __future__ import print_function - -# the name of the project -name = 'jupyter_console' - -import os - -from setuptools import setup - -pjoin = os.path.join -here = os.path.abspath(os.path.dirname(__file__)) -pkg_root = pjoin(here, name) - -packages = [] -for d, _, _ in os.walk(pjoin(here, name)): - if os.path.exists(pjoin(d, '__init__.py')): - packages.append(d[len(here)+1:].replace(os.path.sep, '.')) - - -setup_args = dict( - name = name, - packages = packages, - description = "Jupyter terminal console", - long_description= "An IPython-like terminal frontend for Jupyter kernels in any language.", - long_description_content_type='text/markdown', - author = 'Jupyter Development Team', - author_email = 'jupyter@googlegroups.com', - url = 'https://jupyter.org', - license = 'BSD', - platforms = "Linux, Mac OS X, Windows", - keywords = ['Interactive', 'Interpreter', 'Shell', 'Web'], - classifiers = [ - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - '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', - 'Programming Language :: Python :: 3.11', - ], - install_requires=[ - 'jupyter_client>=7.0.0', - 'jupyter_core>=4.12,!=5.0.*', - 'ipython', - 'ipykernel>=6.14', # bless IPython kernel for now - 'prompt_toolkit>=3.0.30', - 'pygments', - 'pyzmq>=17', - 'traitlets>=5.4' - ], - extras_require={ - 'test': ['pexpect', 'pytest', 'flaky'], - }, - python_requires='>=3.7', - entry_points={ - 'console_scripts': [ - 'jupyter-console = jupyter_console.app:main', - ] - } -) - - -if __name__ == '__main__': - setup(**setup_args)