Skip to content

Commit

Permalink
Prepare for use with Jupyter Releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Mar 6, 2022
1 parent 5b82a2b commit bad9ddd
Show file tree
Hide file tree
Showing 14 changed files with 199 additions and 150 deletions.
18 changes: 0 additions & 18 deletions .bumpversion.cfg

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dist
_build
docs/gh-pages
docs/config_options.rst
docs/changelog.md
*.py[co]
__pycache__
*.egg-info
Expand Down
75 changes: 75 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Changes in Jupyter Console {#changelog}

<!-- <START NEW CHANGELOG ENTRY> -->

## 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)

<!-- <END NEW CHANGELOG ENTRY> -->

## 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.
File renamed without changes.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ global-exclude .ipynb_checkpoints

include *.md
include *.yml
include .bumpversion.cfg
include mypy.ini
include pytest.ini
include .mailmap
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
38 changes: 17 additions & 21 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -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=<NEW_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 <release-id>"
bump2version suffix # Remove the .dev
git commit -am "Generated release <release-id>"
git tag <release_version_here>
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`
95 changes: 0 additions & 95 deletions docs/changelog.rst

This file was deleted.

7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
21 changes: 13 additions & 8 deletions jupyter_console/_version.py
Original file line number Diff line number Diff line change
@@ -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__ = "5.3.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<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)'
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)
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "5.3.0"
regex = '''
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
((?P<channel>a|b|rc|.dev)(?P<release>\d+))?
'''

[tool.tbump.git]
message_template = "Bump to {new_version}"
tag_template = "v{new_version}"

[[tool.tbump.file]]
src = "jupyter_console/_version.py"
Loading

0 comments on commit bad9ddd

Please sign in to comment.