Skip to content

Commit

Permalink
Update dependencies (#783)
Browse files Browse the repository at this point in the history
* Update dependencies

* Update formating

* Fix tests and lints

* Update upload-artifact to v4

* Try remove `libegl1-mesa`, which apparently no longer exists in recent ubuntu versions?
  • Loading branch information
abey79 authored Feb 16, 2025
1 parent 8ba242e commit f7a141d
Show file tree
Hide file tree
Showing 9 changed files with 1,494 additions and 1,321 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-lint-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq libegl1-mesa libegl1-mesa-dev
sudo apt-get install -y -qq libegl1-mesa-dev
# PYTEST STRATEGY
# macOS is the only runner who has working ModernGL behaviour
# macOS + 3.11 is used for code coverage
Expand All @@ -67,7 +67,7 @@ jobs:
if: matrix.os != 'macos-latest'
- name: Upload comparison test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test_report_${{ runner.os }}_${{ matrix.python-version }}
path: |
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
with:
script-file: scripts\\installer_win.nsi
arguments: /V4 /DVERSION=${{ env.version }}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: vpype-${{ env.version }}-setup.exe
path: dist/vpype-${{ env.version }}-setup.exe
2,784 changes: 1,478 additions & 1,306 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/test_substitution.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ def test_property_proxy(state_factory):
assert proxy["global_prop"] == proxy.global_prop == 10
with pytest.raises(KeyError):
assert proxy["local_prop"]
with pytest.raises(AttributeError):
with pytest.raises(KeyError):
assert proxy.local_prop

proxy = _PropertyProxy(dummy_state, False, True)
assert proxy["layer_prop"] == proxy.layer_prop == 1.5
with pytest.raises(KeyError):
assert proxy["global_prop"]
with pytest.raises(AttributeError):
with pytest.raises(KeyError):
assert proxy.global_prop


Expand Down
5 changes: 2 additions & 3 deletions vpype/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ def write_svg(

group.attribs["stroke"] = color.as_rgb_hex()
if color.alpha < 255:
group.attribs["stroke-opacity"] = f"{color.alpha/255:.3f}"
group.attribs["stroke-opacity"] = f"{color.alpha / 255:.3f}"
group.attribs["style"] = "display:inline"
group.attribs["id"] = f"layer{layer_id}"
if layer.property_exists(METADATA_FIELD_PEN_WIDTH):
Expand Down Expand Up @@ -840,8 +840,7 @@ def _get_hpgl_config(device: str | None, page_size: str) -> tuple[PlotterConfig,
paper_config = plotter_config.paper_config(page_size)
if paper_config is None:
raise ValueError(
f"no configuration available for paper size '{page_size}' with plotter "
f"'{device}'"
f"no configuration available for paper size '{page_size}' with plotter '{device}'"
)

return plotter_config, paper_config
Expand Down
2 changes: 1 addition & 1 deletion vpype_cli/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def pagesize(document: vp.Document, size, landscape) -> vp.Document:
SIZE may be one of:
{', '.join(vp.PAGE_SIZES.keys())}
{", ".join(vp.PAGE_SIZES.keys())}
Note that `tight` is special case, see below.
Expand Down
5 changes: 3 additions & 2 deletions vpype_cli/substitution.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def __getattr__(self, name):
if prop is not None:
return prop
else:
raise AttributeError(f"property '{name}' not found")
# Note: this cannot be `AttributeError` because they are silenced by asteval
raise KeyError(f"property '{name}' not found")

def __setattr__(self, name, value):
if name.startswith("_"):
Expand Down Expand Up @@ -254,7 +255,7 @@ def __init__(self, state: State):
}
# disabling numpy as its math functions such as `ceil` do not convert to int.
self._interpreter = asteval.Interpreter(
usersyms=symtable,
user_symbols=symtable,
readonly_symbols=symtable.keys() - vp.UNITS.keys(),
use_numpy=False,
)
Expand Down
4 changes: 2 additions & 2 deletions vpype_cli/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
command. The page size can be overridden using the `--page-size SIZE` option. `SIZE` may
be one of:
{', '.join(vp.PAGE_SIZES.keys())}
{", ".join(vp.PAGE_SIZES.keys())}
Alternatively, a custom size can be specified in the form of `WIDTHxHEIGHT`. `WIDTH` and
`HEIGHT` may include units. If only one has an unit, the other is assumed to have the
Expand Down Expand Up @@ -73,7 +73,7 @@
corresponding device must be configured in the built-in or a user-provided configuration file
(see the documentation for more details). The following devices are currently available:
{', '.join(vp.config_manager.get_plotter_list())}
{", ".join(vp.config_manager.get_plotter_list())}
In HPGL mode, this command will try to infer the paper size to use based on the current page
size (the current page size is set by the `read` command based on the input file and can be
Expand Down
3 changes: 2 additions & 1 deletion vpype_viewer/_painters.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import moderngl as mgl
import numpy as np
import numpy.typing as npt

import vpype as vp

Expand Down Expand Up @@ -326,7 +327,7 @@ def _build_buffers(lc: vp.LineCollection):
last point identical to their first point.
"""

indices = []
indices: list[npt.NDArray] = []
reset_index = np.array([-1])
start_index = 0
for i, line in enumerate(lc):
Expand Down
2 changes: 1 addition & 1 deletion vpype_viewer/qtviewer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self, current: float = 0.8, parent=None):
if current not in self.opacities:
self.opacities.append(current)
for w in sorted(self.opacities):
act = self.addAction(QAction(f"{int(w*100)}%"))
act = self.addAction(QAction(f"{int(w * 100)}%"))
act.setCheckable(True)
act.setChecked(w == current)
act.setData(w)
Expand Down

0 comments on commit f7a141d

Please sign in to comment.