Skip to content

Commit

Permalink
Merge pull request #258 from blink1073/auto-format
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Apr 2, 2022
2 parents 60a339b + c419830 commit e4067d8
Show file tree
Hide file tree
Showing 95 changed files with 5,743 additions and 5,420 deletions.
8 changes: 4 additions & 4 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ message = Bump version: {current_version} → {new_version}
tag = False
tag_name = {new_version}
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>[a-z]+)(?P<build>\d+))?
serialize =
serialize =
{major}.{minor}.{patch}{release}{build}
{major}.{minor}.{patch}

[bumpversion:part:release]
optional_value = prod
first_value = beta
values =
values =
beta
prod

[bumpversion:part:build]

[bumpversion:file:nbformat/_version.py]
parse = (?P<major>\d+),\s*(?P<minor>\d+),\s*(?P<patch>\d+)(,\s*['"](?P<release>[a-z]+)(?P<build>\d+)['"])?
serialize =
serialize =
{major}, {minor}, {patch}, '{release}{build}'
{major}, {minor}, {patch}
Expand All @@ -32,6 +32,6 @@ replace = version = '{new_version}'
[bumpversion:file:package.json]
parse = (?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(-(?P<release>[a-z]+)\.(?P<build>\d+))?
serialize =
serialize =
{major}.{minor}.{patch}-{release}.{build}
{major}.{minor}.{patch}
1 change: 0 additions & 1 deletion .github/scripts/create_npmrc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# coding: utf-8

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
Expand Down
1 change: 0 additions & 1 deletion .github/scripts/parse_ref.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python
# coding: utf-8

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
Expand Down
80 changes: 40 additions & 40 deletions .github/workflows/release_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,50 @@ name: Create Release and publish package
on:
push:
tags:
- '**'
- "**"

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
pip install --upgrade pip setuptools
pip install bump2version check-manifest twine wheel
- name: Build release
run: |
check-manifest -v
python setup.py sdist bdist_wheel
python -m twine check dist/*
- name: Parse tag
run: |
echo "RELEASE_TAG=$(python .github/scripts/parse_ref.py)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.RELEASE_TAG }}
name: Release ${{ env.RELEASE_TAG }}
artifacts: ${{ env.CURRENT_LOCALE_DIR }}/dist/*
body: Release ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish PyPI Package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: python -m twine upload dist/*
- name: Create NPM configuration
run: python .github/scripts/create_npmrc.py
- name: Publish NPM Package
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: |
pip install --upgrade pip setuptools
pip install bump2version check-manifest twine wheel
- name: Build release
run: |
check-manifest -v
python setup.py sdist bdist_wheel
python -m twine check dist/*
- name: Parse tag
run: |
echo "RELEASE_TAG=$(python .github/scripts/parse_ref.py)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.RELEASE_TAG }}
name: Release ${{ env.RELEASE_TAG }}
artifacts: ${{ env.CURRENT_LOCALE_DIR }}/dist/*
body: Release ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish PyPI Package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: python -m twine upload dist/*
- name: Create NPM configuration
run: python .github/scripts/create_npmrc.py
- name: Publish NPM Package
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish
64 changes: 32 additions & 32 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,40 @@ jobs:
strategy:
fail-fast: false
matrix:
OS: ['ubuntu-latest', 'windows-latest', 'macos-latest']
PYTHON_VERSION: ['3.7', '3.10', 'pypy-3.8']
OS: ["ubuntu-latest", "windows-latest", "macos-latest"]
PYTHON_VERSION: ["3.7", "3.10", "pypy-3.8"]
include:
- PYTHON_VERSION: '3.7'
- PYTHON_VERSION: "3.7"
EXTRA_DEPS: '"jsonschema<2.7"'
- PYTHON_VERSION: '3.10'
EXTRA_DEPS: ''
- PYTHON_VERSION: 'pypy-3.8'
- PYTHON_VERSION: "3.10"
EXTRA_DEPS: ""
- PYTHON_VERSION: "pypy-3.8"
EXTRA_DEPS: '"jsonschema<4"'
exclude:
- PYTHON_VERSION: 'pypy-3.8'
OS: 'windows-latest'
- PYTHON_VERSION: 'pypy-3.8'
OS: 'macos-latest'
- PYTHON_VERSION: "pypy-3.8"
OS: "windows-latest"
- PYTHON_VERSION: "pypy-3.8"
OS: "macos-latest"
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Install test dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install .[test]
pip install codecov pytest-cov
- name: Install nbformat
run: |
pip install . ${{ matrix.EXTRA_DEPS }}
pip freeze
- name: List dependencies
run: pip list
- name: Run tests
run: pytest -v --cov=nbformat --cov-report term-missing:skip-covered --no-cov-on-fail
- name: Check manfest
run: check-manifest -v
- name: Coverage
run: codecov
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Install test dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install .[test]
pip install codecov pytest-cov
- name: Install nbformat
run: |
pip install . ${{ matrix.EXTRA_DEPS }}
pip freeze
- name: List dependencies
run: pip list
- name: Run tests
run: pytest -v --cov=nbformat --cov-report term-missing:skip-covered --no-cov-on-fail
- name: Check manfest
run: check-manifest -v
- name: Coverage
run: codecov
2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ David Hirschfeld <david.hirschfeld@gazprom-mt.com> dhirschfeld <david.hirschfeld
David P. Sanders <dpsanders@gmail.com> David P. Sanders <dpsanders@ciencias.unam.mx>
David Warde-Farley <wardefar@iro.umontreal.ca> David Warde-Farley <>
Doug Blank <dblank@cs.brynmawr.edu> Doug Blank <doug.blank@gmail.com>
Eugene Van den Bulke <eugene.van-den-bulke@gmail.com> Eugene Van den Bulke <eugene.vandenbulke@gmail.com>
Eugene Van den Bulke <eugene.van-den-bulke@gmail.com> Eugene Van den Bulke <eugene.vandenbulke@gmail.com>
Evan Patterson <epatters@enthought.com> <epatters@EPattersons-MacBook-Pro.local>
Evan Patterson <epatters@enthought.com> <epatters@evan-laptop.localdomain>
Evan Patterson <epatters@enthought.com> <epatters@caltech.edu>
Expand Down
67 changes: 31 additions & 36 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,42 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
# - id: end-of-file-fixer
# - id: check-case-conflict
# - id: check-executables-have-shebangs
# - id: requirements-txt-fixer
- id: end-of-file-fixer
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: requirements-txt-fixer
- id: check-added-large-files
# - id: check-case-conflict
# - id: check-toml
# - id: check-yaml
# - id: debug-statements
# - id: forbid-new-submodules
# - id: check-builtin-literals
# - id: trailing-whitespace
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: forbid-new-submodules
- id: check-builtin-literals
- id: trailing-whitespace

# - repo: https://github.com/psf/black
# rev: 22.3.0
# hooks:
# - id: black
# args: ["--line-length", "100"]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: ["--line-length", "100"]

# - repo: https://github.com/PyCQA/isort
# rev: 5.10.1
# hooks:
# - id: isort
# files: \.py$
# args: [--profile=black]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
files: \.py$
args: [--profile=black]

# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: v2.6.1
# hooks:
# - id: prettier
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.1
hooks:
- id: prettier

# - repo: https://github.com/asottile/pyupgrade
# rev: v2.31.1
# hooks:
# - id: pyupgrade
# args: [--py37-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/PyCQA/doc8
rev: 0.11.0
Expand All @@ -59,11 +59,6 @@ repos:
# "flake8-implicit-str-concat==0.2.0",
# ]

# - repo: https://github.com/pre-commit/mirrors-eslint
# rev: v8.12.0
# hooks:
# - id: eslint

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.14.1
hooks:
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ version. Update the minor format for tests as well.
For example, for nbformat package version 4.5, if we see that there are material
changes in the spec, so do the following:

* Update `nbformat/v4/nbformat.v4.schema.json` so that its top-level description
- Update `nbformat/v4/nbformat.v4.schema.json` so that its top-level description
says spec version 4.4 (which is the next spec version), and its minimum minor
version number is 4 in the schema.
* Copy `nbformat/v4/nbformat.v4.schema.json` to
- Copy `nbformat/v4/nbformat.v4.schema.json` to
`nbformat/v4/nbformat.v4.4.schema.json` and commit the file as an archived
version of that particular nbformat specification.
* Update the `nbformat` and `nbformat_minor` variables in
- Update the `nbformat` and `nbformat_minor` variables in
`nbformat/v4/nbbase.py`

If there are inconsequential changes to the format spec in a package release
Expand Down
6 changes: 3 additions & 3 deletions COPYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Expand All @@ -47,8 +47,8 @@ Jupyter uses a shared copyright model. Each contributor maintains copyright
over their contributions to Jupyter. But, it is important to note that these
contributions are typically only changes to the repositories. Thus, the Jupyter
source code, in its entirety is not the copyright of any single person or
institution. Instead, it is the collective copyright of the entire Jupyter
Development Team. If individual contributors want to maintain a record of what
institution. Instead, it is the collective copyright of the entire Jupyter
Development Team. If individual contributors want to maintain a record of what
changes/contributions they have specific copyright on, they should indicate
their copyright in the commit message of the change, when they commit the
change to one of the Jupyter repositories.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ and Python APIs for working with notebooks.

There is also a JSON schema for notebook format versions >= 3.

[Jupyter Notebook format]: https://nbformat.readthedocs.org/en/latest/format_description.html
[jupyter notebook format]: https://nbformat.readthedocs.org/en/latest/format_description.html

## Installation

From the command line:

``` {.sourceCode .bash}
```{.sourceCode .bash}
pip install nbformat
```

## Using a different json schema validator

You can install and use [fastjsonschema](https://horejsek.github.io/python-fastjsonschema/) by running:

``` {.sourceCode .bash}
```{.sourceCode .bash}
pip install nbformat[fast]
```

Expand Down

0 comments on commit e4067d8

Please sign in to comment.