Skip to content

Commit

Permalink
Unpin black (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
josiah-wolf-oberholtzer committed Sep 1, 2021
1 parent 5e9f735 commit 9e7a31a
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 50 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ help: ## Display this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

black-check: ## Run black formatting check
black --target-version py36 --diff --check ${formatPaths}
black --skip-magic-trailing-comma --target-version py36 --diff --check ${formatPaths}

black-reformat: ## Reformat via black
black --target-version py36 ${formatPaths}
black --skip-magic-trailing-comma --target-version py36 ${formatPaths}

build: ## Build distribution archive
python setup.py sdist
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def read_version():
install_requires = [
"Sphinx >= 3.2.0",
"Unidecode >= 1.0.0",
"black == 19.10b0", # Trailing comma behavior in 20.x needs work
"black",
"sphinx-rtd-theme >= 0.5.0",
]

Expand All @@ -43,7 +43,6 @@ def read_version():

extras_require = {
"test": [
"black == 19.10b0", # Trailing comma behavior in 20.x needs work
"flake8 >= 3.9.0",
"isort >= 5.9.0",
"mypy >= 0.900",
Expand Down
10 changes: 1 addition & 9 deletions tests/test_graphs_Table.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
from uqbar.graphs import (
Graph,
LineBreak,
Node,
Table,
TableCell,
TableRow,
Text,
)
from uqbar.graphs import Graph, LineBreak, Node, Table, TableCell, TableRow, Text
from uqbar.strings import normalize


Expand Down
2 changes: 1 addition & 1 deletion uqbar/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = (0, 5, 5)
__version_info__ = (0, 5, 6)
__version__ = ".".join(str(x) for x in __version_info__)
11 changes: 1 addition & 10 deletions uqbar/apis/InheritanceGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
import inspect
import types
from typing import Any # noqa
from typing import (
Dict,
List,
Mapping,
MutableMapping,
Sequence,
Set,
Tuple,
Union,
)
from typing import Dict, List, Mapping, MutableMapping, Sequence, Set, Tuple, Union

import uqbar.graphs
import uqbar.strings
Expand Down
2 changes: 1 addition & 1 deletion uqbar/book/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def setup_console(cls, console, monkeypatch):
for key, value in console.proxy_options.items()
if key.startswith("graphviz/")
},
),
)
),
)

Expand Down
18 changes: 4 additions & 14 deletions uqbar/book/sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
from docutils.utils import new_document
from sphinx.util.nodes import set_source_info

from uqbar.book.console import (
Console,
ConsoleError,
ConsoleInput,
ConsoleOutput,
)
from uqbar.book.console import Console, ConsoleError, ConsoleInput, ConsoleOutput

try:
import black
Expand All @@ -44,10 +39,7 @@ class UqbarBookDirective(Directive):
required_arguments = 0
optional_arguments = 0
final_argument_whitespace = True
option_spec: Dict[str, Any] = {
"allow-exceptions": flag,
"hide": flag,
}
option_spec: Dict[str, Any] = {"allow-exceptions": flag, "hide": flag}

def run(self):
self.assert_has_content()
Expand Down Expand Up @@ -86,9 +78,7 @@ class UqbarBookImportDirective(Directive):
has_content = False
required_arguments = 1
optional_arguments = 0
option_spec = {
"hide": flag,
}
option_spec = {"hide": flag}

def run(self):
block = uqbar_book_import_block()
Expand Down Expand Up @@ -235,7 +225,7 @@ def interpret_code_blocks(
)
elif isinstance(block, (literal_block, doctest_block)):
console_output, errored, has_exception = interpret_literal_block(
console, block, use_black=use_black,
console, block, use_black=use_black
)
if errored:
traceback = find_traceback(console_output)
Expand Down
2 changes: 1 addition & 1 deletion uqbar/cli/CLIAggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _setup_argument_parser(self, parser):
key, help="{{{}}} subcommand(s)".format(", ".join(subkeys))
)
group_subparsers = group_subparser.add_subparsers(
dest="subsubparser_name", title="{} subcommands".format(key),
dest="subsubparser_name", title="{} subcommands".format(key)
)
for subkey in subkeys:
cli_class = alias_map[key][subkey]
Expand Down
6 changes: 2 additions & 4 deletions uqbar/graphs/Grapher.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ class Grapher:

### INITIALIZER ###

def __init__(
self, graphable, format_="pdf", layout="dot", output_directory=None,
):
def __init__(self, graphable, format_="pdf", layout="dot", output_directory=None):
if layout not in self._valid_layouts:
raise ValueError("Invalid layout: {layout!r}")
if format_ not in self._valid_formats:
Expand Down Expand Up @@ -129,6 +127,6 @@ def persist_string(self, string, input_path):

def run_command(self, command: str) -> Tuple[str, int]:
completed_process = subprocess.run(
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
return completed_process.stdout.decode(), completed_process.returncode == 0
7 changes: 1 addition & 6 deletions uqbar/sphinx/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@
from typing import Any, Dict, List

from sphinx.util import logging
from sphinx.util.console import ( # type: ignore
bold,
darkgreen,
darkred,
purple,
)
from sphinx.util.console import bold, darkgreen, darkred, purple # type: ignore

import uqbar.apis

Expand Down

0 comments on commit 9e7a31a

Please sign in to comment.