Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Mar 5, 2022
1 parent c0681aa commit 3d7afb0
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ repos:
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py36-plus]
args: [--py37-plus]
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Here's an example of how to set up some pre-commit hooks: put this in your `.pre

```yaml
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.2.3
rev: 1.3.0
hooks:
- id: nbqa-black
- id: nbqa-pyupgrade
Expand Down
6 changes: 6 additions & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog
=========

1.3.0 (2022-03-05)
~~~~~~~~~~~~~~~~~~
Removed support for Python 3.6.
Exit code for ``--nbqa-diff`` is now ``1`` is file would've been modified, and ``0`` otherwise.
Cells with just line magics will now be ignored.

1.2.3 (2022-01-11)
~~~~~~~~~~~~~~~~~~
Removed (unnecessary) upper-bound on ``tomli``.
Expand Down
4 changes: 2 additions & 2 deletions docs/pre-commit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Here's an example of what you could include in your ``.pre-commit-config.yaml``

repos:
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.2.3
rev: 1.3.0
hooks:
- id: nbqa-black
additional_dependencies: [black==20.8b1]
Expand All @@ -31,7 +31,7 @@ Custom hooks
If you have your own custom tool (e.g. ``customtool``) for which we currently don't have a built-in hook, you can define your own one with: ::

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.2.3
rev: 1.3.0
hooks:
- id: nbqa
entry: nbqa customtool
Expand Down
2 changes: 1 addition & 1 deletion nbqa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Attributes used by docs / packaging."""

__version__ = "1.2.3"
__version__ = "1.3.0"
5 changes: 2 additions & 3 deletions nbqa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,8 @@ def _run_command(
python_module = COMMAND_TO_PYTHON_MODULE.get(command, command)
output = subprocess.run(
[sys.executable, "-m", python_module, *args, *cmd_args],
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
universal_newlines=True, # from Python3.7 this can be replaced with `text`
capture_output=True,
text=True,
env=my_env,
)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_runtime_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_unable_to_reconstruct_message_pythonpath(monkeypatch: "MonkeyPatch") ->
[sys.executable, "-m", "nbqa", "remove_comments", path],
stderr=subprocess.PIPE,
env=os.environ,
universal_newlines=True, # from Python3.7 this can be replaced with `text`
text=True,
)
expected_stderr = f"\n\x1b[1mnbQA failed to process {path} with exception "
expected_returncode = 123
Expand Down
5 changes: 1 addition & 4 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
"""Check you can run :code:`nbqa --version`."""

import subprocess
from subprocess import PIPE

from nbqa import __version__


def test_version() -> None:
"""Check you can run :code:`nbqa --version`."""
output = subprocess.run(
["nbqa", "--version"], stdout=PIPE, stderr=PIPE, universal_newlines=True
)
output = subprocess.run(["nbqa", "--version"], capture_output=True, text=True)
assert output.stdout.strip() == f"nbqa {__version__}"
assert output.returncode == 0

0 comments on commit 3d7afb0

Please sign in to comment.