fixing codacy issues
This commit is contained in:
@ -3,14 +3,12 @@ import os
|
|||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
try:
|
try:
|
||||||
import edgy.project
|
from edgy.project.__main__ import handle_init
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
'You must install "edgy.project" to use this command.\n\n $ pip install edgy.project\n'
|
'You must install "edgy.project" to use this command.\n\n $ pip install edgy.project\n'
|
||||||
) from exc
|
) from exc
|
||||||
|
|
||||||
from edgy.project.__main__ import handle_init
|
|
||||||
|
|
||||||
return handle_init(os.path.join(os.getcwd(), 'Projectfile'))
|
return handle_init(os.path.join(os.getcwd(), 'Projectfile'))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ def get_default_services(filename, services=None):
|
|||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
exec(code, context)
|
exec(code, context)
|
||||||
except Exception as exc:
|
except Exception:
|
||||||
raise
|
raise
|
||||||
return {
|
return {
|
||||||
**context[DEFAULT_SERVICES_ATTR](),
|
**context[DEFAULT_SERVICES_ATTR](),
|
||||||
@ -55,7 +55,7 @@ def execute(file, quiet=False):
|
|||||||
'but it is something that will be implemented in the future.\n\nExpected: 1, got: {}.'
|
'but it is something that will be implemented in the future.\n\nExpected: 1, got: {}.'
|
||||||
).format(len(graphs))
|
).format(len(graphs))
|
||||||
|
|
||||||
name, graph = list(graphs.items())[0]
|
graph = list(graphs.values())[0]
|
||||||
|
|
||||||
# todo if console and not quiet, then add the console plugin
|
# todo if console and not quiet, then add the console plugin
|
||||||
# todo when better console plugin, add it if console and just disable display
|
# todo when better console plugin, add it if console and just disable display
|
||||||
|
|||||||
@ -53,4 +53,4 @@ class Configurable(metaclass=ConfigurableMeta):
|
|||||||
)
|
)
|
||||||
|
|
||||||
for name, value in kwargs.items():
|
for name, value in kwargs.items():
|
||||||
setattr(self, name, kwargs[name])
|
setattr(self, name, value)
|
||||||
|
|||||||
@ -52,9 +52,9 @@ def contextual(cls_or_func):
|
|||||||
setattr(cls_or_func, _CONTEXT_PROCESSORS_ATTR, [])
|
setattr(cls_or_func, _CONTEXT_PROCESSORS_ATTR, [])
|
||||||
|
|
||||||
_processors = getattr(cls_or_func, _CONTEXT_PROCESSORS_ATTR)
|
_processors = getattr(cls_or_func, _CONTEXT_PROCESSORS_ATTR)
|
||||||
for name, value in cls_or_func.__dict__.items():
|
for processor in cls_or_func.__dict__.values():
|
||||||
if isinstance(value, ContextProcessor):
|
if isinstance(processor, ContextProcessor):
|
||||||
_processors.append(value)
|
_processors.append(processor)
|
||||||
|
|
||||||
# This is needed for python 3.5, python 3.6 should be fine, but it's considered an implementation detail.
|
# This is needed for python 3.5, python 3.6 should be fine, but it's considered an implementation detail.
|
||||||
_processors.sort(key=lambda proc: proc._creation_counter)
|
_processors.sort(key=lambda proc: proc._creation_counter)
|
||||||
|
|||||||
@ -14,10 +14,6 @@ from edgy.project.feature import Feature, SUPPORT_PRIORITY
|
|||||||
class BonoboFeature(Feature):
|
class BonoboFeature(Feature):
|
||||||
requires = {'python'}
|
requires = {'python'}
|
||||||
|
|
||||||
@subscribe('edgy.project.feature.make.on_generate', priority=SUPPORT_PRIORITY)
|
|
||||||
def on_make_generate(self, event):
|
|
||||||
makefile = event.makefile
|
|
||||||
|
|
||||||
@subscribe('edgy.project.on_start', priority=SUPPORT_PRIORITY)
|
@subscribe('edgy.project.on_start', priority=SUPPORT_PRIORITY)
|
||||||
def on_start(self, event):
|
def on_start(self, event):
|
||||||
package_path = event.setup['name'].replace('.', os.sep)
|
package_path = event.setup['name'].replace('.', os.sep)
|
||||||
|
|||||||
@ -24,11 +24,3 @@ class JupyterOutputPlugin(Plugin):
|
|||||||
finalize = run
|
finalize = run
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
TODO JUPYTER WIDGET
|
|
||||||
###################
|
|
||||||
|
|
||||||
# close the widget? what does it do?
|
|
||||||
https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Basics.html#Closing-widgets
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class CsvReader(CsvHandler, FileReader):
|
|||||||
field_count = len(headers.value)
|
field_count = len(headers.value)
|
||||||
|
|
||||||
if self.skip and self.skip > 0:
|
if self.skip and self.skip > 0:
|
||||||
for i in range(0, self.skip):
|
for _ in range(0, self.skip):
|
||||||
next(reader)
|
next(reader)
|
||||||
|
|
||||||
for row in reader:
|
for row in reader:
|
||||||
|
|||||||
@ -21,7 +21,7 @@ def test_file_writer_in_context(tmpdir, lines, output):
|
|||||||
|
|
||||||
context.start()
|
context.start()
|
||||||
context.recv(BEGIN, *map(Bag, lines), END)
|
context.recv(BEGIN, *map(Bag, lines), END)
|
||||||
for i in range(len(lines)):
|
for _ in range(len(lines)):
|
||||||
context.step()
|
context.step()
|
||||||
context.stop()
|
context.stop()
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ def test_entrypoint():
|
|||||||
def test_no_command(capsys):
|
def test_no_command(capsys):
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
entrypoint([])
|
entrypoint([])
|
||||||
out, err = capsys.readouterr()
|
_, err = capsys.readouterr()
|
||||||
assert 'error: the following arguments are required: command' in err
|
assert 'error: the following arguments are required: command' in err
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user