Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ on:
branches: '*'

jobs:

pre-commit:
name: Run pre-commit formatters and linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- uses: pre-commit/[email protected]

build-n-test-n-coverage:
name: Build, test and code coverage
runs-on: ${{ matrix.os }}
Expand Down
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
ci:
autoupdate_schedule: monthly
autofix_prs: true

repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
# - id: check-json

- repo: https://github.com/mgedmin/check-manifest
rev: "0.46"
hooks:
- id: check-manifest
additional_dependencies: [setuptools>=46.4.0]

- repo: https://github.com/pycqa/isort
rev: 5.9.3
hooks:
- id: isort

- repo: https://github.com/asottile/pyupgrade
rev: v2.25.0
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/psf/black
rev: 21.7b0
hooks:
- id: black

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.1
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Change Log

See the Change Log in the [nbclient documentation](https://nbclient.readthedocs.io/en/latest/changelog.html).
See the Change Log in the [nbclient documentation](https://nbclient.readthedocs.io/en/latest/changelog.html).
28 changes: 25 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,38 @@ We follow the
[Jupyter Contribution Workflow](https://jupyter.readthedocs.io/en/latest/contributor/content-contributor.html)
and the [IPython Contributing Guide](https://github.com/ipython/ipython/blob/master/CONTRIBUTING.md).

# Testing
## Code formatting

Use the [pre-commit](https://pre-commit.com/) tool to format and lint the codebase:

```console
# to apply to only staged files
$ pre-commit run
# to run against all files
$ pre-commit run --all-files
# to install so that it is run before commits
$ pre-commit install
```

## Testing

In your environment `pip install -e '.[test]'` will be needed to be able to
run all of the tests.

# Documentation
The recommended way to do this is using [tox](https://tox.readthedocs.io/en/latest/):

```console
# to list all environments
$ tox -av
# to run all tests for a specific environment
$ tox -e py38
```

## Documentation

NbClient needs some PRs to copy over documentation!

# Releasing
## Releasing

If you are going to release a version of `nbclient` you should also be capable
of testing it and building the docs.
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ include requirements-dev.txt
include *.md
include .bumpversion.cfg
include tox.ini
include mypy.ini
include pyproject.toml
include .pre-commit-config.yaml

# Code and test files
recursive-include nbclient *.ipynb
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Support parsing of IPython dev version [#150](https://github.com/jupyter/nbclient/pull/150) ([@cphyc](https://github.com/cphyc))
- Set `IPYKERNEL_CELL_NAME = <IPY-INPUT>` [#147](https://github.com/jupyter/nbclient/pull/147) ([@davidbrochart](https://github.com/davidbrochart))
- Print useful error message on exception [#142](https://github.com/jupyter/nbclient/pull/142) ([@certik](https://github.com/certik))

## 0.5.3

- Fix ipykernel's `stop_on_error` value to take into account `raises-exception` tag and `force_raise_errors` [#137](https://github.com/jupyter/nbclient/pull/137)
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# nbclient documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 26 16:00:00 2020.
Expand All @@ -20,6 +19,8 @@
import os
import sys

import nbclient

sys.path.insert(0, os.path.abspath('..'))

# -- General configuration ------------------------------------------------
Expand Down Expand Up @@ -61,7 +62,6 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
import nbclient

# The short X.Y version.
version = '.'.join(nbclient.__version__.split('.')[0:2])
Expand Down Expand Up @@ -115,7 +115,7 @@

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#html_sidebars = {}
# html_sidebars = {}

html_title = "nbclient"

Expand Down
24 changes: 0 additions & 24 deletions mypy.ini

This file was deleted.

5 changes: 3 additions & 2 deletions nbclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import sys
import subprocess
from .client import NotebookClient, execute # noqa: F401
import sys

from ._version import version as __version__ # noqa: F401
from .client import NotebookClient, execute # noqa: F401


def _cleanup() -> None:
Expand Down
Loading