Enforcing quote format with black in develop.

This commit is contained in:
Romain Dorgueil
2018-08-11 16:15:26 +02:00
parent 52887a297f
commit ca464ef6f7
25 changed files with 193 additions and 185 deletions

View File

@ -8,7 +8,7 @@
import sys
if sys.version_info < (3, 5):
raise RuntimeError('Python 3.5+ is required to use Bonobo.')
raise RuntimeError("Python 3.5+ is required to use Bonobo.")
from bonobo._api import (
run,
@ -65,8 +65,8 @@ def _repr_html_():
'<div style="padding: 8px;">'
' <div style="float: left; width: 20px; height: 20px;">{}</div>'
' <pre style="white-space: nowrap; padding-left: 8px">{}</pre>'
'</div>'
).format(__logo__, '<br/>'.join(get_versions(all=True)))
"</div>"
).format(__logo__, "<br/>".join(get_versions(all=True)))
del sys

View File

@ -187,7 +187,7 @@ def get_examples_path(*pathsegments):
import os
import pathlib
return str(pathlib.Path(os.path.dirname(__file__), 'examples', *pathsegments))
return str(pathlib.Path(os.path.dirname(__file__), "examples", *pathsegments))
@api.register

View File

@ -1 +1 @@
__version__ = '0.6.3'
__version__ = "0.6.3"

View File

@ -4,10 +4,11 @@ import runpy
import sys
from contextlib import contextmanager
from mondrian import humanizer
import bonobo.util.environ
from bonobo.util import get_name
from bonobo.util.environ import get_argument_parser, parse_args
from mondrian import humanizer
class BaseCommand:

View File

@ -1,8 +1,9 @@
from mondrian import humanizer
import bonobo
from bonobo.commands import BaseCommand
from bonobo.registry import READER, WRITER, default_registry
from bonobo.util.resolvers import _resolve_options, _resolve_transformations
from mondrian import humanizer
class ConvertCommand(BaseCommand):

View File

@ -1,9 +1,9 @@
import os
from jinja2 import Environment, FileSystemLoader
from mondrian import humanizer
from bonobo.commands import BaseCommand
from mondrian import humanizer
class InitCommand(BaseCommand):
@ -31,16 +31,12 @@ class InitCommand(BaseCommand):
with open(filename, "w+") as f:
f.write(template.render(name=name))
print(
humanizer.Success(
"Generated {} using template {!r}.".format(filename, template_name)
)
)
print(humanizer.Success("Generated {} using template {!r}.".format(filename, template_name)))
def create_package(self, *, filename):
_, ext = os.path.splitext(filename)
if ext != '':
raise ValueError('Package names should not have an extension.')
if ext != "":
raise ValueError("Package names should not have an extension.")
try:
import medikit.commands
@ -60,16 +56,16 @@ class InitCommand(BaseCommand):
print(
humanizer.Success(
'Package "{}" has been created.'.format(package_name),
'',
"",
"Install it...",
'',
"",
" $ `pip install --editable {}`".format(filename),
'',
"",
"Then maybe run the example...",
'',
"",
" $ `python -m {}`".format(package_name),
'',
"Enjoy!"
"",
"Enjoy!",
)
)

View File

@ -1,6 +1,7 @@
from bonobo.commands import BaseCommand
from mondrian import humanizer
from bonobo.commands import BaseCommand
def get_versions(*, all=False, quiet=None):
import bonobo

View File

@ -68,7 +68,7 @@ class Container(dict):
if len(args) == 1:
if len(kwargs):
raise ValueError(
'You can either use {} with one positional argument or with keyword arguments, not both.'.format(
"You can either use {} with one positional argument or with keyword arguments, not both.".format(
cls.__name__
)
)

View File

@ -60,8 +60,8 @@ class ETLCommand(BaseCommand):
for i, graph in enumerate(graph_coll):
if not isinstance(graph, bonobo.Graph):
raise ValueError('Expected a Graph instance, got {!r}.'.format(graph))
print(term.lightwhite('{}. {}'.format(i + 1, graph.name)))
raise ValueError("Expected a Graph instance, got {!r}.".format(graph))
print(term.lightwhite("{}. {}".format(i + 1, graph.name)))
result = bonobo.run(graph, services=services, strategy=strategy)
results.append(result)
print(term.lightblack(" ... return value: " + str(result)))

View File

@ -134,7 +134,7 @@ def BagType(typename, fields, *, verbose=False, module=None):
if type(name) is not str:
raise TypeError("Type names and field names must be strings, got {name!r}".format(name=name))
if not isinstance(name, str):
raise TypeError('Type names and field names must be strings, got {name!r}'.format(name=name))
raise TypeError("Type names and field names must be strings, got {name!r}".format(name=name))
if not i:
if not name.isidentifier():
raise ValueError("Type names must be valid identifiers: {name!r}".format(name=name))

View File

@ -1,2 +1,2 @@
CLEAR_EOL = "\033[0K"
MOVE_CURSOR_UP = '\033[{}A'.format
MOVE_CURSOR_UP = "\033[{}A".format