kopia lustrzana https://github.com/corrscope/corrscope
Merge pull request #375 from corrscope/update-deps
commit
f80730ffd7
|
@ -59,7 +59,7 @@ class MainWindow(QWidget):
|
||||||
|
|
||||||
width = 1280
|
width = 1280
|
||||||
height = 0
|
height = 0
|
||||||
MainWindow.resize(width * scale, height * scale)
|
MainWindow.resize(int(width * scale), int(height * scale))
|
||||||
|
|
||||||
s = LayoutStack(MainWindow)
|
s = LayoutStack(MainWindow)
|
||||||
|
|
||||||
|
|
Plik diff jest za duży
Load Diff
|
@ -19,34 +19,30 @@ repository = "https://github.com/corrscope/corrscope/"
|
||||||
documentation = "https://corrscope.github.io/corrscope/"
|
documentation = "https://corrscope.github.io/corrscope/"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.6"
|
python = "^3.6.2"
|
||||||
"ruamel.yaml" = "^0.16"
|
"ruamel.yaml" = "^0.17"
|
||||||
numpy = "^1.15"
|
numpy = "^1.15"
|
||||||
click = "^7.0"
|
click = "^8.0.1"
|
||||||
matplotlib = "^3.1"
|
matplotlib = "^3.1"
|
||||||
attrs = "^18.2.0"
|
attrs = "^21.2.0"
|
||||||
PyQt5 = "^5.11"
|
PyQt5 = "^5.15.4"
|
||||||
appdirs = "^1.4"
|
appdirs = "^1.4.4"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
pytest = "^4.0"
|
pytest = "^6.2.4"
|
||||||
pytest_mock = "^1.10"
|
pytest-mock = "^3.6.1"
|
||||||
hypothesis = "^3.84"
|
hypothesis = "^6.14.0"
|
||||||
delayed-assert = "^0.2.3"
|
delayed-assert = "^0.3.5"
|
||||||
|
|
||||||
pyinstaller = "^3.6"
|
pyinstaller = "^4.3"
|
||||||
|
|
||||||
# poetry fails to pick up pyinstaller's dependencies.
|
pefile = {version = "^2021.5.24", platform = "win32"}
|
||||||
# https://github.com/python-poetry/poetry/issues/1431#issuecomment-571661982
|
|
||||||
# https://github.com/pyinstaller/pyinstaller/issues/4609 fixed in pyinstaller, but not released yet.
|
|
||||||
pywin32-ctypes = {version = ">=0.2.0", platform = "win32"}
|
|
||||||
pefile = {version = ">=2017.8.1", platform = "win32"}
|
|
||||||
|
|
||||||
coverage = "^4.5"
|
coverage = "^5.5"
|
||||||
pytest-cov = "^2.6"
|
pytest-cov = "^2.12.1"
|
||||||
codecov = "^2.1"
|
codecov = "^2.1.11"
|
||||||
pytest_cases = "^1.2"
|
pytest-cases = "^3.6.1"
|
||||||
black = {version = "^18.3-alpha.0", allow-prereleases = true}
|
black = "^21.6b0"
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
corr = 'corrscope.cli:main'
|
corr = 'corrscope.cli:main'
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
|
from contextlib import ExitStack
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import hypothesis.strategies as hs
|
import hypothesis.strategies as hs
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
from hypothesis import given
|
from hypothesis import given
|
||||||
from pytest_mock import MockFixture
|
from unittest.mock import patch
|
||||||
|
|
||||||
import corrscope.channel
|
import corrscope.channel
|
||||||
import corrscope.corrscope
|
import corrscope.corrscope
|
||||||
|
@ -49,7 +50,6 @@ def test_config_channel_integration(
|
||||||
rsub: int,
|
rsub: int,
|
||||||
default_label: DefaultLabel,
|
default_label: DefaultLabel,
|
||||||
override_label: bool,
|
override_label: bool,
|
||||||
mocker: MockFixture,
|
|
||||||
):
|
):
|
||||||
"""(Tautologically) verify:
|
"""(Tautologically) verify:
|
||||||
- channel. r_samp (given cfg)
|
- channel. r_samp (given cfg)
|
||||||
|
@ -59,10 +59,11 @@ def test_config_channel_integration(
|
||||||
- rendered label (channel.label, given cfg, corr_cfg.default_label)
|
- rendered label (channel.label, given cfg, corr_cfg.default_label)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
with ExitStack() as stack:
|
||||||
# region setup test variables
|
# region setup test variables
|
||||||
corrscope.corrscope.PRINT_TIMESTAMP = False # Cleanup Hypothesis testing logs
|
corrscope.corrscope.PRINT_TIMESTAMP = False # Cleanup Hypothesis testing logs
|
||||||
|
|
||||||
Wave = mocker.patch.object(corrscope.channel, "Wave")
|
Wave = stack.enter_context(patch.object(corrscope.channel, "Wave"))
|
||||||
wave = Wave.return_value
|
wave = Wave.return_value
|
||||||
|
|
||||||
def get_around(sample: int, return_nsamp: int, stride: int):
|
def get_around(sample: int, return_nsamp: int, stride: int):
|
||||||
|
@ -128,7 +129,9 @@ def test_config_channel_integration(
|
||||||
|
|
||||||
## Ensure corrscope calls render using channel._render_samp and _render_stride.
|
## Ensure corrscope calls render using channel._render_samp and _render_stride.
|
||||||
corr = CorrScope(cfg, Arguments(cfg_dir=".", outputs=[]))
|
corr = CorrScope(cfg, Arguments(cfg_dir=".", outputs=[]))
|
||||||
renderer = mocker.patch.object(CorrScope, "_load_renderer").return_value
|
renderer = stack.enter_context(
|
||||||
|
patch.object(CorrScope, "_load_renderer")
|
||||||
|
).return_value
|
||||||
corr.play()
|
corr.play()
|
||||||
|
|
||||||
# Only Channel.get_render_around() (not NullTrigger) calls wave.get_around().
|
# Only Channel.get_render_around() (not NullTrigger) calls wave.get_around().
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import pytest
|
import pytest
|
||||||
from pytest_cases import pytest_fixture_plus
|
from pytest_cases import fixture
|
||||||
|
|
||||||
from corrscope.gui.model_bind import rgetattr, rsetattr, rhasattr, flatten_attr
|
from corrscope.gui.model_bind import rgetattr, rsetattr, rhasattr, flatten_attr
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class Residence(object):
|
||||||
self.sqft = sqft
|
self.sqft = sqft
|
||||||
|
|
||||||
|
|
||||||
@pytest_fixture_plus
|
@fixture
|
||||||
@pytest.mark.parametrize("s", ["__", "."])
|
@pytest.mark.parametrize("s", ["__", "."])
|
||||||
def separator(s: str) -> str:
|
def separator(s: str) -> str:
|
||||||
return s
|
return s
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
from contextlib import ExitStack
|
||||||
from typing import Optional, TYPE_CHECKING, List
|
from typing import Optional, TYPE_CHECKING, List
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
import hypothesis.strategies as hs
|
import hypothesis.strategies as hs
|
||||||
|
@ -396,15 +398,14 @@ def test_res_divisor_rounding_fixed(target_int: int, res_divisor: float):
|
||||||
|
|
||||||
|
|
||||||
@given(target_int=hs.integers(1, 10000), res_divisor=hs.floats(1, 100))
|
@given(target_int=hs.integers(1, 10000), res_divisor=hs.floats(1, 100))
|
||||||
def test_res_divisor_rounding_hypothesis(target_int: int, res_divisor: float, mocker):
|
def test_res_divisor_rounding_hypothesis(target_int: int, res_divisor: float):
|
||||||
verify_res_divisor_rounding(target_int, res_divisor, speed_hack=True, mocker=mocker)
|
verify_res_divisor_rounding(target_int, res_divisor, speed_hack=True)
|
||||||
|
|
||||||
|
|
||||||
def verify_res_divisor_rounding(
|
def verify_res_divisor_rounding(
|
||||||
target_int: int,
|
target_int: int,
|
||||||
res_divisor: float,
|
res_divisor: float,
|
||||||
speed_hack: bool,
|
speed_hack: bool,
|
||||||
mocker: "pytest_mock.MockFixture" = None,
|
|
||||||
):
|
):
|
||||||
"""Ensure that pathological-case float rounding errors
|
"""Ensure that pathological-case float rounding errors
|
||||||
don't cause inconsistent dimensions and assertion errors."""
|
don't cause inconsistent dimensions and assertion errors."""
|
||||||
|
@ -414,8 +415,11 @@ def verify_res_divisor_rounding(
|
||||||
cfg = RendererConfig(undivided_dim, undivided_dim, res_divisor=res_divisor)
|
cfg = RendererConfig(undivided_dim, undivided_dim, res_divisor=res_divisor)
|
||||||
cfg.before_preview()
|
cfg.before_preview()
|
||||||
|
|
||||||
|
with ExitStack() as stack:
|
||||||
if speed_hack:
|
if speed_hack:
|
||||||
mocker.patch.object(AbstractMatplotlibRenderer, "_save_background")
|
stack.enter_context(
|
||||||
|
patch.object(AbstractMatplotlibRenderer, "_save_background")
|
||||||
|
)
|
||||||
datas = []
|
datas = []
|
||||||
else:
|
else:
|
||||||
datas = [RENDER_Y_ZEROS]
|
datas = [RENDER_Y_ZEROS]
|
||||||
|
|
|
@ -7,7 +7,7 @@ from matplotlib.axes import Axes
|
||||||
from matplotlib.figure import Figure
|
from matplotlib.figure import Figure
|
||||||
|
|
||||||
# Pycharm assumes anything called "fixture" is pytest.fixture.
|
# Pycharm assumes anything called "fixture" is pytest.fixture.
|
||||||
from pytest_cases import pytest_fixture_plus as fixture
|
from pytest_cases import fixture
|
||||||
|
|
||||||
from corrscope import triggers
|
from corrscope import triggers
|
||||||
from corrscope.triggers import (
|
from corrscope.triggers import (
|
||||||
|
|
Ładowanie…
Reference in New Issue