From 2e9f7ad0cf2e3af191af4d21207b9f7d8ea5d814 Mon Sep 17 00:00:00 2001 From: Marcus Fedarko Date: Tue, 22 Feb 2022 02:12:15 -0800 Subject: [PATCH] Fix autoformatting re: ** operator; un-break CI (for real this time) (#218) * STY: Un-break CI Oh, apparently it was still running anyway? huh * STY: black >= 22.1.0; ** formatting See https://github.com/psf/black/releases/tag/22.1.0. This should fix the build failing (knock on wood) * STY: re-format setup.py this is like trying to cut the heads off a hydra --- .../graph_objects/assembly_graph/test_node_scaling.py | 4 ++-- setup.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/metagenomescope/tests/graph_objects/assembly_graph/test_node_scaling.py b/metagenomescope/tests/graph_objects/assembly_graph/test_node_scaling.py index eed2d0e2..1ed5c84d 100644 --- a/metagenomescope/tests/graph_objects/assembly_graph/test_node_scaling.py +++ b/metagenomescope/tests/graph_objects/assembly_graph/test_node_scaling.py @@ -62,7 +62,7 @@ def get_dims(rl, lp): area = config.MIN_NODE_AREA + ( rl * (config.MAX_NODE_AREA - config.MIN_NODE_AREA) ) - hgt = area ** lp + hgt = area**lp wid = area / hgt return (wid, hgt) @@ -99,7 +99,7 @@ def test_compute_node_dimensions_all_lengths_equal(): default_area = config.MIN_NODE_AREA + ( 0.5 * (config.MAX_NODE_AREA - config.MIN_NODE_AREA) ) - default_height = default_area ** config.MID_LONGSIDE_PROPORTION + default_height = default_area**config.MID_LONGSIDE_PROPORTION default_width = default_area / default_height # This double-checks that the defaults we expect here are computed diff --git a/setup.py b/setup.py index 05e4bee1..746865cf 100644 --- a/setup.py +++ b/setup.py @@ -74,7 +74,12 @@ "pyfastg", "jinja2", ], - extras_require={"dev": ["pytest", "pytest-cov", "flake8", "black"]}, + # The reason I pin the black version to at least 22.1.0 is that this + # version changes how the ** operator is formatted (no surrounding spaces, + # usually). Not being consistent causes the build to fail, hence the pin. + extras_require={ + "dev": ["pytest", "pytest-cov", "flake8", "black>=22.1.0"] + }, entry_points={"console_scripts": ["mgsc=metagenomescope._cli:run_script"]}, zip_safe=False, )