diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index cd8beb5d..00000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,18 +0,0 @@ -[bumpversion] -current_version = 6.4.1.dev -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(.(?P.+))? -serialize = - {major}.{minor}.{patch}.{suffix} - {major}.{minor}.{patch} - -[bumpversion:part:suffix] -optional_value = final -values = - dev - final - -[bumpversion:file:jupyter_console/_version.py] -parse = (?P\d+),\s*(?P\d+),\s*(?P\d+)(,\s*['"](?P\w+)['"])? -serialize = - {major}, {minor}, {patch}, '{suffix}' - {major}, {minor}, {patch} diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml new file mode 100644 index 00000000..643ffda1 --- /dev/null +++ b/.github/workflows/check-release.yml @@ -0,0 +1,62 @@ +name: Check Release +on: + push: + branches: ["main"] + pull_request: + branches: ["*"] + +permissions: + contents: write + +jobs: + check_release: + runs-on: ubuntu-latest + strategy: + matrix: + group: [check_release, link_check] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + architecture: "x64" + - name: Install node + uses: actions/setup-node@v2 + with: + node-version: "14.x" + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + - name: Cache pip + uses: actions/cache@v1 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}-pip- + - name: Cache checked links + if: ${{ matrix.group == 'link_check' }} + uses: actions/cache@v2 + with: + path: ~/.cache/pytest-link-check + key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.md', '**/*.rst') }}-md-links + restore-keys: | + ${{ runner.os }}-linkcheck- + - name: Upgrade packaging dependencies + run: | + pip install --upgrade pip setuptools wheel --user + - name: Install Dependencies + run: | + pip install -e . + - name: Check Release + if: ${{ matrix.group == 'check_release' }} + uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Check Links + if: ${{ matrix.group == 'link_check' }} + uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1 diff --git a/.gitignore b/.gitignore index b3caeaa2..5831d50b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dist _build docs/gh-pages docs/config_options.rst +docs/changelog.md *.py[co] __pycache__ *.egg-info diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..12ba9299 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,77 @@ +# Changes in Jupyter Console {#changelog} + + + +## 6.4.0 + + + +## 5.3.0 + +- Highlight matching parentheses [#147](https://github.com/jupyter/jupyter_console/pull/147) +- The config option `JupyterConsoleApp.confirm_exit` replaces `ZMQTerminalInteractiveShell.confirm_exit`, to avoid redundancy [#141](https://github.com/jupyter/jupyter_console/pull/141) + +## 5.2 + +- When using a kernel that the console did not start, exiting with Ctrl-D now leaves it running [#127](https://github.com/jupyter/jupyter_console/pull/127) +- Added Ctrl-\\ shortcut to quit the console [#130](https://github.com/jupyter/jupyter_console/pull/130) +- Input prompt numbers are now updated when another frontend has executed code in the same kernel [#119](https://github.com/jupyter/jupyter_console/pull/119) +- Fix setting next input with newer versions of prompt_toolkit [#123](https://github.com/jupyter/jupyter_console/pull/123) +- Ensure history entries are unicode, not bytes, on Python 2 [#122](https://github.com/jupyter/jupyter_console/pull/122) + +## 5.1 + +- New `ZMQTerminalInteractiveShell.true_color` config option to use 24-bit colour +- New `ZMQTerminalInteractiveShell.confirm_exit` config option to turn off asking 'are you sure' on exit +- New `--simple-prompt` flag to explicitly use the fallback mode without prompt_toolkit +- Fixed executing an empty input +- Fixed formatting for code and outputs from other frontends executing code +- Avoid using functions which will be removed in IPython 6 + +## 5.0 + +## 5.0.0 + +### Interactive Shell architecture + +- Disinherit shell class from IPython Interactive Shell. This separates jupyter_console's `ZMQTerminalInteractiveShell` from IPython's `TerminalInteractiveShell` and `InteractiveShell` classes [#68](https://github.com/jupyter/jupyter_console/pull/68) +- Update SIGINT handler to not use the old interactive API shell [#80](https://github.com/jupyter/jupyter_console/pull/80) + +### Image Handling improvement + +- use PIL as default image handler [#79](https://github.com/jupyter/jupyter_console/pull/79) +- better indication of whether image data was handled [#77](https://github.com/jupyter/jupyter_console/pull/77) + +### Prompts improvement + +- use prompt_toolkit 1.0 [#74](https://github.com/jupyter/jupyter_console/pull/74) +- don't use prompt_manager [#75](https://github.com/jupyter/jupyter_console/pull/75) +- remove `colors_force` flag that have no effects [#88](https://github.com/jupyter/jupyter_console/pull/88) + +## 4.1 + +## 4.1.1 + +- fix for readline history +- don't confuse sys.path with virtualenvs + +## 4.1.0 + +- readline/completion fixes +- use is_complete messages to determine if input is complete (important for non-Python kernels) +- fix: 4.0 was looking for jupyter_console_config in IPython config directories, not Jupyter + + +## 4.0 + +## 4.0.3 + +- fix `jupyter console --generate-config` + +## 4.0.2 + +- setuptools fixes for Windows + +## 4.0.0 + +- First release as a standalone package. diff --git a/COPYING.md b/LICENSE similarity index 100% rename from COPYING.md rename to LICENSE diff --git a/MANIFEST.in b/MANIFEST.in index 9e9cfce0..835d5fc3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -24,7 +24,6 @@ global-exclude .ipynb_checkpoints include *.md include *.yml -include .bumpversion.cfg include mypy.ini include pytest.ini include .mailmap diff --git a/README.md b/README.md index b16dfbd8..60f06d93 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ $ python -m pep517.build . ## Resources - [Project Jupyter website](https://jupyter.org) -- [Documentation for Jupyter Console](https://jupyter-console.readthedocs.io/en/latest/) [[PDF](https://media.readthedocs.org/pdf/jupyter-console/latest/jupyter-notebook.pdf)] +- [Documentation for Jupyter Console](https://jupyter-console.readthedocs.io/en/latest/) [[PDF](https://media.readthedocs.org/pdf/jupyter-console/latest/jupyter-console.pdf)] - [Documentation for Project Jupyter](https://jupyter.readthedocs.io/en/latest/index.html) [[PDF](https://media.readthedocs.org/pdf/jupyter/latest/jupyter.pdf)] - [Issues](https://github.com/jupyter/jupyter_console/issues) - [Technical support - Jupyter Google Group](https://groups.google.com/forum/#!forum/jupyter) diff --git a/RELEASING.md b/RELEASING.md index 679beff6..92212540 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,36 +1,32 @@ # Releasing -## Prerequisites +## Using `jupyter_releaser` -- Install `bump2version` -- Install `twine` +The recommended way to make a release is to use [`jupyter_releaser`](https://github.com/jupyter-server/jupyter_releaser#checklist-for-adoption). -## Push to GitHub +## Manual Release -Change from patch to minor or major for appropriate version updates. +### 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` + +### Bump version + +- `export version=` +- `tbump ${version} --no-push` + +### Push to GitHub ```bash -# Commit, test, publish, tag release -bump2version minor # CHECK FIRST: If the patch version currently set is not sufficient -git commit -am "Prepared " -bump2version suffix # Remove the .dev -git commit -am "Generated release " -git tag -git push && git push --tags +git push upstream && git push upstream --tags ``` -## Push to PyPI +### Push to PyPI ```bash rm -rf dist/* rm -rf build/* -python setup.py sdist bdist_wheel -# Double check the dist/* files have the right verison (no `.dev`) and install the wheel to ensure it's good -pip install dist/* +python -m build . twine upload dist/* ``` - -## Prep repo for development - -- `bumpversion patch # Resets the patch and dev versions` -- `git commit -am "Resumed patch dev"; git push` diff --git a/docs/changelog.rst b/docs/changelog.rst deleted file mode 100644 index 5b3391d9..00000000 --- a/docs/changelog.rst +++ /dev/null @@ -1,95 +0,0 @@ -Changes in Jupyter console -========================== - -A summary of changes in Jupyter console releases. - -5.3 ---- - -- Highlight matching parentheses. :ghpull:`147` -- The config option ``JupyterConsoleApp.confirm_exit`` replaces - ``ZMQTerminalInteractiveShell.confirm_exit``, to avoid redundancy. - :ghpull:`141`. - -5.2 ---- - -- When using a kernel that the console did not start, exiting with Ctrl-D now - leaves it running. :ghpull:`127` -- Added Ctrl-\\ shortcut to quit the console. :ghpull:`130` -- Input prompt numbers are now updated when another frontend has executed - code in the same kernel. :ghpull:`119` -- Fix setting next input with newer versions of prompt_toolkit. :ghpull:`123` -- Ensure history entries are unicode, not bytes, on Python 2. :ghpull:`122` - -5.1 ---- - -- New ``ZMQTerminalInteractiveShell.true_color`` config option to use 24-bit - colour. -- New ``ZMQTerminalInteractiveShell.confirm_exit`` config option to turn off - asking 'are you sure' on exit. -- New ``--simple-prompt`` flag to explicitly use the fallback mode without - prompt_toolkit. -- Fixed executing an empty input. -- Fixed formatting for code and outputs from other frontends executing code. -- Avoid using functions which will be removed in IPython 6. - -5.0 ---- - -5.0.0 -~~~~~ - -Interactive Shell architecture -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- Disinherit shell class from IPython Interactive Shell (:ghpull:`68`). - This separates jupyter_console's ``ZMQTerminalInteractiveShell`` from - IPython's ``TerminalInteractiveShell`` and ``InteractiveShell`` classes. -- Update SIGINT handler to not use the old interactive API shell. :ghpull:`80` - -Image Handling improvement -^^^^^^^^^^^^^^^^^^^^^^^^^^ -- use PIL as default image handler :ghpull:`79` -- better indication of whether image data was handled :ghpull:`77` - -Prompts improvement -^^^^^^^^^^^^^^^^^^^ -- use prompt_toolkit 1.0 :ghpull:`74` -- don't use prompt_manager :ghpull:`75` -- remove ``colors_force`` flag that have no effects: :ghpull:`88` - -4.1 ---- - -4.1.1 -~~~~~ - -- fix for readline history -- don't confuse sys.path with virtualenvs - -4.1.0 -~~~~~ - -- readline/completion fixes -- use is_complete messages to determine if input is complete (important for non-Python kernels) -- fix: 4.0 was looking for jupyter_console_config in IPython config directories, not Jupyter - - -4.0 ---- - -4.0.3 -~~~~~ - -- fix ``jupyter console --generate-config`` - -4.0.2 -~~~~~ - -- setuptools fixes for Windows - -4.0.0 -~~~~~ - -First release as a standalone package. diff --git a/docs/conf.py b/docs/conf.py index 1a432bf1..a61206fa 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,6 +16,7 @@ import sys import os import shlex +import shutil # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -320,3 +321,9 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # otherwise, readthedocs.org uses their theme by default, so no need to specify it + + +def setup(app): + HERE = os.path.abspath(os.path.dirname(__file__)) + dest = os.path.join(HERE, 'changelog.md') + shutil.copy(os.path.join(HERE, '..', 'CHANGELOG.md'), dest) diff --git a/jupyter_console/_version.py b/jupyter_console/_version.py index aa4f6644..b255878d 100644 --- a/jupyter_console/_version.py +++ b/jupyter_console/_version.py @@ -1,10 +1,15 @@ -""" For beta/alpha/rc releases, the version number for a beta is X.Y.ZbN -**without dots between the last 'micro' number and b**. N is the number of -the beta released i.e. 1, 2, 3 ... +import re +from typing import List, Union -See PEP 440 https://www.python.org/dev/peps/pep-0440/ -""" +__version__ = "6.4.0" -version_info = (6, 4, 1, 'dev') - -__version__ = '.'.join(map(str, version_info[:3])) + ''.join(version_info[3:]) +# Build up version_info tuple for backwards compatibility +pattern = r'(?P\d+).(?P\d+).(?P\d+)(?P.*)' +match = re.match(pattern, __version__) +if match: + parts: List[Union[int, str]] = [int(match[part]) for part in ['major', 'minor', 'patch']] + if match['rest']: + parts.append(match['rest']) +else: + parts = [] +version_info = tuple(parts) diff --git a/pyproject.toml b/pyproject.toml index 2f210119..9dcc2a14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,23 @@ [build-system] requires = ["setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" + +[tool.jupyter-releaser] +skip = ["check-links"] + +[tool.check-manifest] +ignore = [".mailmap", "*.yml", "*.yaml"] + +[tool.tbump.version] +current = "6.4.0" +regex = ''' + (?P\d+)\.(?P\d+)\.(?P\d+) + ((?Pa|b|rc|.dev)(?P\d+))? +''' + +[tool.tbump.git] +message_template = "Bump to {new_version}" +tag_template = "v{new_version}" + +[[tool.tbump.file]] +src = "jupyter_console/_version.py" diff --git a/setup.cfg b/setup.cfg index b522a14c..7eaac12e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,4 +3,6 @@ max-line-length = 99 ignore = W291, E266, E265, E128, E251, E402, E124, E302, W293, E231, E222, W503, E126, E121, W391, E226, E127, W504 [metadata] -license_file = COPYING.md +name = jupyter_console +version = attr: jupyter_console._version.__version__ +license_file = LICENSE diff --git a/setup.py b/setup.py index f5ce9a4a..dc37c8a8 100644 --- a/setup.py +++ b/setup.py @@ -62,17 +62,13 @@ if os.path.exists(pjoin(d, '__init__.py')): packages.append(d[len(here)+1:].replace(os.path.sep, '.')) -version_ns = {} -with open(pjoin(here, name, '_version.py')) as f: - exec(f.read(), {}, version_ns) - setup_args = dict( name = name, - version = version_ns['__version__'], 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',