Skip to content

Commit 6a3b0eb

Browse files
authored
ENH: upgrade to python-constraint2 (#268)
* MAINT: update pip constraints files
1 parent e8a55ac commit 6a3b0eb

File tree

9 files changed

+11
-51
lines changed

9 files changed

+11
-51
lines changed

.constraints/py3.10.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pytest==8.2.1
124124
pytest-cov==5.0.0
125125
pytest-profiling==1.7.0
126126
pytest-xdist==3.6.1
127-
python-constraint==1.4.0
127+
python-constraint2==2.0.0b5
128128
python-dateutil==2.9.0.post0
129129
python-json-logger==2.0.7
130130
python-lsp-jsonrpc==1.1.2
@@ -165,7 +165,6 @@ sphinxcontrib-htmlhelp==2.0.5
165165
sphinxcontrib-jsmath==1.0.1
166166
sphinxcontrib-qthelp==1.0.7
167167
sphinxcontrib-serializinghtml==1.1.10
168-
sphobjinv==2.3.1
169168
sqlalchemy==2.0.30
170169
stack-data==0.6.3
171170
starlette==0.37.2

.constraints/py3.11.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pytest==8.2.1
123123
pytest-cov==5.0.0
124124
pytest-profiling==1.7.0
125125
pytest-xdist==3.6.1
126-
python-constraint==1.4.0
126+
python-constraint2==2.0.0b5
127127
python-dateutil==2.9.0.post0
128128
python-json-logger==2.0.7
129129
python-lsp-jsonrpc==1.1.2
@@ -164,7 +164,6 @@ sphinxcontrib-htmlhelp==2.0.5
164164
sphinxcontrib-jsmath==1.0.1
165165
sphinxcontrib-qthelp==1.0.7
166166
sphinxcontrib-serializinghtml==1.1.10
167-
sphobjinv==2.3.1
168167
sqlalchemy==2.0.30
169168
stack-data==0.6.3
170169
starlette==0.37.2

.constraints/py3.12.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pytest==8.2.1
123123
pytest-cov==5.0.0
124124
pytest-profiling==1.7.0
125125
pytest-xdist==3.6.1
126-
python-constraint==1.4.0
126+
python-constraint2==2.0.0b5
127127
python-dateutil==2.9.0.post0
128128
python-json-logger==2.0.7
129129
python-lsp-jsonrpc==1.1.2
@@ -164,7 +164,6 @@ sphinxcontrib-htmlhelp==2.0.5
164164
sphinxcontrib-jsmath==1.0.1
165165
sphinxcontrib-qthelp==1.0.7
166166
sphinxcontrib-serializinghtml==1.1.10
167-
sphobjinv==2.3.1
168167
sqlalchemy==2.0.30
169168
stack-data==0.6.3
170169
starlette==0.37.2

.constraints/py3.7.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ sphinxcontrib-htmlhelp==2.0.0
171171
sphinxcontrib-jsmath==1.0.1
172172
sphinxcontrib-qthelp==1.0.3
173173
sphinxcontrib-serializinghtml==1.1.5
174-
sphobjinv==2.3.1
175174
sqlalchemy==1.4.52
176175
tabulate==0.9.0
177176
terminado==0.17.1

.constraints/py3.8.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pytest==8.2.1
129129
pytest-cov==5.0.0
130130
pytest-profiling==1.7.0
131131
pytest-xdist==3.6.1
132-
python-constraint==1.4.0
132+
python-constraint2==2.0.0b5
133133
python-dateutil==2.9.0.post0
134134
python-json-logger==2.0.7
135135
python-lsp-jsonrpc==1.1.2
@@ -171,7 +171,6 @@ sphinxcontrib-htmlhelp==2.0.1
171171
sphinxcontrib-jsmath==1.0.1
172172
sphinxcontrib-qthelp==1.0.3
173173
sphinxcontrib-serializinghtml==1.1.5
174-
sphobjinv==2.3.1
175174
sqlalchemy==2.0.30
176175
stack-data==0.6.3
177176
tabulate==0.9.0

.constraints/py3.9.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pytest==8.2.1
124124
pytest-cov==5.0.0
125125
pytest-profiling==1.7.0
126126
pytest-xdist==3.6.1
127-
python-constraint==1.4.0
127+
python-constraint2==2.0.0b5
128128
python-dateutil==2.9.0.post0
129129
python-json-logger==2.0.7
130130
python-lsp-jsonrpc==1.1.2
@@ -165,7 +165,6 @@ sphinxcontrib-htmlhelp==2.0.5
165165
sphinxcontrib-jsmath==1.0.1
166166
sphinxcontrib-qthelp==1.0.7
167167
sphinxcontrib-serializinghtml==1.1.10
168-
sphobjinv==2.3.1
169168
sqlalchemy==2.0.30
170169
stack-data==0.6.3
171170
starlette==0.37.2

docs/conf.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import os
44
import sys
55

6-
import sphobjinv as soi
76
from sphinx_api_relink.helpers import (
87
get_branch_name,
98
get_execution_mode,
@@ -15,34 +14,6 @@
1514
sys.path.insert(0, os.path.abspath("."))
1615
from _extend_docstrings import extend_docstrings # noqa: PLC2701
1716

18-
19-
def create_constraints_inventory() -> None:
20-
inv = soi.Inventory()
21-
inv.project = "constraint"
22-
constraint_object_names = [
23-
"Constraint",
24-
"Domain",
25-
"Problem",
26-
"Solver",
27-
"Variable",
28-
]
29-
for object_name in constraint_object_names:
30-
inv.objects.append(
31-
soi.DataObjStr(
32-
name=f"{inv.project}.{object_name}",
33-
domain="py",
34-
role="class",
35-
priority="1",
36-
uri=f"{inv.project}.{object_name}-class.html",
37-
dispname="-",
38-
)
39-
)
40-
text = inv.data_file(contract=True)
41-
ztext = soi.compress(text)
42-
soi.writebytes("constraint.inv", ztext)
43-
44-
45-
create_constraints_inventory()
4617
extend_docstrings()
4718
set_intersphinx_version_remapping({
4819
"ipython": {
@@ -250,7 +221,7 @@ def create_constraints_inventory() -> None:
250221
"ampform": ("https://ampform.readthedocs.io/en/stable", None),
251222
"attrs": (f"https://www.attrs.org/en/{pin('attrs')}", None),
252223
"compwa": ("https://compwa.github.io", None),
253-
"constraint": ("https://labix.org/doc/constraint/public", "constraint.inv"),
224+
"constraint": ("https://python-constraint.github.io/python-constraint", None),
254225
"graphviz": ("https://graphviz.readthedocs.io/en/stable", None),
255226
"IPython": (f"https://ipython.readthedocs.io/en/{pin('IPython')}", None),
256227
"jsonschema": ("https://python-jsonschema.readthedocs.io/en/stable", None),

pyproject.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ dependencies = [
3131
"attrs >=20.1.0", # on_setattr and https://www.attrs.org/en/stable/api.html#next-gen
3232
"jsonschema",
3333
"particle",
34-
"python-constraint",
3534
"tqdm >=4.24.0", # autonotebook
35+
'python-constraint2; python_version >="3.8.0"',
36+
'python-constraint; python_version <"3.8.0"',
3637
'typing-extensions; python_version <"3.8.0"', # Literal, Protocol
3738
]
3839
description = "Rule-based particle reaction problem solver on a quantum number level"
@@ -77,7 +78,6 @@ doc = [
7778
"sphinx-thebe",
7879
"sphinx-togglebutton",
7980
"sphinxcontrib-bibtex >=2",
80-
"sphobjinv",
8181
'sphinx-api-relink >=0.0.4',
8282
'sphinx-pybtex-etal-style',
8383
]
@@ -114,7 +114,6 @@ types = [
114114
"ipython",
115115
"pydot <2", # problem with pydot.graph_from_dot_data
116116
"pytest",
117-
"sphobjinv",
118117
"types-PyYAML",
119118
"types-setuptools",
120119
'sphinx-api-relink >=0.0.4',
@@ -200,10 +199,6 @@ module = ["pydot.*"]
200199
ignore_missing_imports = true
201200
module = ["sphinx.*"]
202201

203-
[[tool.mypy.overrides]]
204-
ignore_missing_imports = true
205-
module = ["sphobjinv.*"]
206-
207202
[[tool.mypy.overrides]]
208203
ignore_missing_imports = true
209204
module = ["tqdm.*"]

src/qrules/solving.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ class _VariableContainer:
415415
class CSPSolver(Solver):
416416
"""Solver reducing the task to a Constraint Satisfaction Problem.
417417
418-
Solving this done with the python-constraint module.
418+
Solving this done with the :doc:`constraint<constraint:reference>` package.
419419
420420
The variables are the quantum numbers of particles/edges, but also some composite
421421
quantum numbers which are attributed to the interaction nodes (such as angular
@@ -782,7 +782,7 @@ def rule_passes(self) -> dict[tuple[int, Rule], int]:
782782

783783

784784
class _GraphElementConstraint(Generic[_QNType], Constraint):
785-
"""Wrapper class of the python-constraint Constraint class.
785+
"""Wrapper class of the `~constraints.Constraint` class.
786786
787787
This allows a customized definition of conservation rules, and hence a cleaner user
788788
interface.
@@ -903,7 +903,7 @@ def __update_variable_lists(
903903
class _ConservationRuleConstraintWrapper(
904904
Constraint # pyright: ignore[reportUntypedBaseClass]
905905
):
906-
"""Wrapper class of the python-constraint Constraint class.
906+
"""Wrapper class of the `~constraints.Constraint` class.
907907
908908
This allows a customized definition of conservation rules, and hence a cleaner user
909909
interface.

0 commit comments

Comments
 (0)