Skip to content

Commit

Permalink
Bump rich dependency to version 13 (#512)
Browse files Browse the repository at this point in the history
**Context:** Old dependencies can hold back things which depend on the
MrMustard, which can be very deep in the dependency tree. The `rich`
package had a very old major version dependency (10.*.*) and this could
interact with other seemingly random packages when depending on
MrMustard.

**Description of the Change:** Bump the major version of `rich` to 13.
The only place I can see to test this version change is in the
ProgressBar class, and this seemed to work fine for me on testing using
the example code in the docs for using the optimizer.

**Benefits:** Other packages that depend on MrMustard won't get into a
tricky dependency situation with a very old package.

**Possible Drawbacks:** Possible subtle bugs as this dependency doesn't
appear to have unit tests.

---------

Co-authored-by: Anthony <anthonychytros@gmail.com>
  • Loading branch information
aplund and apchytr authored Oct 22, 2024
1 parent 242c806 commit 8905170
Show file tree
Hide file tree
Showing 7 changed files with 1,572 additions and 1,368 deletions.
9 changes: 9 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage:
status:
project:
default:
target: 89%
patch:
default:
target: auto
threshold: 0%
47 changes: 0 additions & 47 deletions .coveragerc

This file was deleted.

3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
* Loosen the upper-bound on `thewalrus` and upgrade it.
[(#454)](https://github.com/XanaduAI/MrMustard/pull/454)

* Update major version of `rich` dependency to version 13.
[(#512)](https://github.com/XanaduAI/MrMustard/pull/512)

### Bug fixes
* Fix the bug in the order of indices of the triples for DsMap CircuitComponent.
[(#385)](https://github.com/XanaduAI/MrMustard/pull/385)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PYTHON3 := $(shell which python3 2>/dev/null)
TESTRUNNER := -m pytest tests -p no:warnings
COVERAGE := --cov=mrmustard --cov-report=html:coverage_html_report --cov-append
COVERAGE := --cov=mrmustard --cov-report=html --cov-append

.PHONY: help
help:
Expand Down
2,821 changes: 1,505 additions & 1,316 deletions poetry.lock

Large diffs are not rendered by default.

55 changes: 54 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ numpy = "^1.23.5"
scipy = "^1.8.0"
numba = "^0.59"
thewalrus = ">=0.19.0,<1.0"
rich = "^10.15.1"
rich = "^13.9.0"
matplotlib = "^3.5.0"
ray = { version = "^2.5.0", extras = ["tune"], optional = true }
scikit-optimize = { version = "^0.9.0", optional = true }
Expand Down Expand Up @@ -97,6 +97,59 @@ xanadu-sphinx-theme = "0.1.0"
[tool.black]
line-length = 100

[tool.coverage.run]
source = ["mrmustard"]

[tool.coverage.report]
omit = ["mrmustard/lab/*", "mrmustard/training/*"]

# Regexes for lines to exclude from consideration
exclude_lines =[
# Have to re-enable the standard pragma
"pragma: no cover",

# Don't complain about missing debug-only code:
"def __repr__",
"def __eq__",
"if self\\.debug",

# print statements
"def __str__",
"def __format__",
"def _print_list",

# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
"raise NotApplicableError",
"raise Exception",
"raise ValueError",
"raise ZeroDivisionError",
"raise TypeError",
"raise RuntimeError",
"raise IndexError",
"raise FileNotFoundError",
"raise NotADirectoryError",
"raise MergeFailure",
"return __version__",
"if len(lst) != self._num_modes:",
"elif max(lst) >= self._trunc:",
"except NotImplementedError as err",

# Don't complain if non-runnable code isn't run:
"if 0:",
"pass",
"if __name__ == .__main__.:",
]

ignore_errors = true

[tool.coverage.html]
directory = "coverage_html_report"

[tool.pytest.ini_options]
filterwarnings = "ignore::DeprecationWarning"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
3 changes: 0 additions & 3 deletions pytest.ini

This file was deleted.

0 comments on commit 8905170

Please sign in to comment.