8000 CircleCI updates: Unify requirements, drop conda, refactor to reduce duplication by jonmmease · Pull Request #3164 · plotly/plotly.py · GitHub
[go: up one dir, main page]

Skip to content

CircleCI updates: Unify requirements, drop conda, refactor to reduce duplication #3164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Apr 23, 2021
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
46e06e8
Remove miniconda2 installation branch
jonmmease Apr 22, 2021
37628c9
Install requirements for orca test from same requirements.txt file
jonmmease Apr 22, 2021
6b19e1e
disable non-orca tests temporarily
jonmmease Apr 22, 2021
513251f
disable dev-build
jonmmease Apr 22, 2021
28b3349
Use same circleci image for orca job as optional jobs
jonmmease Apr 22, 2021
56eb217
remove editable plotly-geo from optional requirements.txt
jonmmease Apr 22, 2021
8c7c3c6
Fix orca test path
jonmmease Apr 22, 2021
b0b2367
Install poppler
jonmmease Apr 22, 2021
0b390fb
store failed images as artifacts
jonmmease Apr 22, 2021
30420e8
Update orca image baselines
jonmmease Apr 22, 2021
ec4911c
Try global npm install
jonmmease Apr 22, 2021
1f6b2fb
Try again with orca install from npm
jonmmease Apr 22, 2021
0729420
try orca path fix
jonmmease Apr 22, 2021
8141262
baseline
jonmmease Apr 22, 2021
273835e
Revert "baseline"
jonmmease Apr 22, 2021
d9197f8
Specify orca engine explicitly
jonmmease Apr 22, 2021
31228a7
blacken
jonmmease Apr 22, 2021
18ff7d9
baselines
jonmmease Apr 22, 2021
665b78d
reduce duplication with circleci commands
jonmmease Apr 22, 2021
f5053a7
stay with .circleci version 2
jonmmease Apr 22, 2021
64f3b15
use underscores for command names
jonmmease Apr 22, 2021
0a46829
Update to 2.1
jonmmease Apr 22, 2021
dd9db8d
Fix optional command
jonmmease Apr 22, 2021
e1e5421
Use optional requirements.txt from percy CI job
jonmmease Apr 22, 2021
738a1dc
Split optional and orca commands
jonmmease Apr 22, 2021
ca7bb77
Re-enable all CI tests
jonmmease Apr 22, 2021
13b7c77
Remove old conda ci configuration files
jonmmease Apr 22, 2021
44f312a
Remove extra double-quote
jonmmease Apr 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Specify orca engine explicitly
  • Loading branch 8000 information
jonmmease committed Apr 22, 2021
commit d9197f82c8dbf2c8dbc41d7929f9e3f88182ce03
26 changes: 13 additions & 13 deletions packages/python/plotly/plotly/tests/test_orca/test_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ def assert_image_bytes(img_bytes, file_name, _raise=True):
# Tests
# -----
def test_simple_to_image(fig1, format):
img_bytes = pio.to_image(fig1, format=format, width=700, height=500)
img_bytes = pio.to_image(fig1, format=format, width=700, height=500, engine="orca")
assert_image_bytes(img_bytes, "fig1." + format)


def test_to_image_default(fig1, format):
pio.orca.config.default_format = format
img_bytes = pio.to_image(fig1, width=700, height=500)
img_bytes = pio.to_image(fig1, width=700, height=500, engine="orca")
assert_image_bytes(img_bytes, "fig1." + format)


Expand All @@ -206,7 +206,7 @@ def test_write_image_string(fig1, format):
file_path = tmp_dir + file_name

pio.write_image(
fig1, os.path.join(tmp_dir, file_name), format=format, width=700, height=500
fig1, os.path.join(tmp_dir, file_name), format=format, width=700, height=500, engine="orca"
)

with open(file_path, "rb") as f:
Expand All @@ -225,7 +225,7 @@ def test_write_image_writeable(fig1, format):
expected_bytes = f.read()

mock_file = MagicMock()
pio.write_image(fig1, mock_file, format=format, width=700, height=500)
pio.write_image(fig1, mock_file, format=format, width=700, height=500, engine="orca")

mock_file.write.assert_called_once_with(expected_bytes)

Expand All @@ -236,7 +236,7 @@ def test_write_image_string_format_inference(fig1, format):
file_path = os.path.join(tmp_dir, file_name)

# Use file extension to infer image type.
pio.write_image(fig1, os.path.join(tmp_dir, file_name), width=700, height=500)
pio.write_image(fig1, os.path.join(tmp_dir, file_name), width=700, height=500, engine="orca")

with open(file_path, "rb") as f:
written_bytes = f.read()
Expand All @@ -253,7 +253,7 @@ def test_write_image_string_no_extension_failure(fig1):

# Use file extension to infer image type.
with pytest.raises(ValueError) as err:
pio.write_image(fig1, file_path)
pio.write_image(fig1, file_path, engine="orca")

assert "add a file extension or specify the type" in str(err.value)

Expand All @@ -264,7 +264,7 @@ def test_write_image_string_bad_extension_failure(fig1):

# Use file extension to infer image type.
with pytest.raises(ValueError) as err:
pio.write_image(fig1, file_path)
pio.write_image(fig1, file_path, engine="orca")

assert "must be specified as one of the following" in str(err.value)

Expand All @@ -274,7 +274,7 @@ def test_write_image_string_bad_extension_override(fig1):
file_name = "fig1.bogus"
tmp_path = os.path.join(tmp_dir, file_name)

pio.write_image(fig1, tmp_path, format="eps", width=700, height=500)
pio.write_image(fig1, tmp_path, format="eps", width=700, height=500, engine="orca")

with open(tmp_path, "rb") as f:
written_bytes = f.read()
Expand All @@ -288,14 +288,14 @@ def test_write_image_string_bad_extension_override(fig1):
# Topojson
# --------
def test_topojson_fig_to_image(topofig, format):
img_bytes = pio.to_image(topofig, format=format, width=700, height=500)
img_bytes = pio.to_image(topofig, format=format, width=700, height=500, engine="orca")
assert_image_bytes(img_bytes, "topofig." + format)


# Latex / MathJax
# ---------------
def test_latex_fig_to_image(latexfig, format):
img_bytes = pio.to_image(latexfig, format=format, width=700, height=500)
img_bytes = pio.to_image(latexfig, format=format, width=700, height=500, engine="orca")
assert_image_bytes(img_bytes, "latexfig." + format)


Expand All @@ -308,7 +308,7 @@ def test_problematic_environment_variables(fig1, format):
os.environ["ELECTRON_RUN_AS_NODE"] = "1"

# Do image export
img_bytes = pio.to_image(fig1, format=format, width=700, height=500)
img_bytes = pio.to_image(fig1, format=format, width=700, height=500, engine="orca")
assert_image_bytes(img_bytes, "fig1." + format)

# Check that environment variables were restored
Expand All @@ -322,12 +322,12 @@ def test_invalid_figure_json():
# Do image export
bad_fig = {"foo": "bar"}
with pytest.raises(ValueError) as err:
pio.to_image(bad_fig, format="png")
pio.to_image(bad_fig, format="png", engine="orca")

assert "Invalid" in str(err.value)

with pytest.raises(ValueError) as err:
pio.to_image(bad_fig, format="png", validate=False)
pio.to_image(bad_fig, format="png", validate=False, engine="orca")

assert "The image request was rejected by the orca conversion utility" in str(
err.value
Expand Down
0