python-constraint2 2.0.0__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- constraint/__init__.py +37 -0
- constraint/constraints.c +29807 -0
- constraint/constraints.py +786 -0
- constraint/domain.c +9306 -0
- constraint/domain.py +102 -0
- constraint/problem.c +16329 -0
- constraint/problem.py +256 -0
- constraint/solvers.c +23963 -0
- constraint/solvers.py +592 -0
- python_constraint2-2.0.0.dist-info/LICENSE +23 -0
- python_constraint2-2.0.0.dist-info/METADATA +238 -0
- python_constraint2-2.0.0.dist-info/RECORD +22 -0
- python_constraint2-2.0.0.dist-info/WHEEL +4 -0
- tests/__init__.py +0 -0
- tests/setup_teardown.py +40 -0
- tests/test_compilation.py +17 -0
- tests/test_constraint.py +127 -0
- tests/test_doctests.py +10 -0
- tests/test_problem.py +27 -0
- tests/test_solvers.py +72 -0
- tests/test_some_not_in_set.py +99 -0
- tests/test_toml_file.py +72 -0
tests/test_toml_file.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Tests for release information."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import tomli
|
|
6
|
+
|
|
7
|
+
package_root = Path(".").parent.parent
|
|
8
|
+
pyproject_toml_path = package_root / "pyproject.toml"
|
|
9
|
+
assert pyproject_toml_path.exists()
|
|
10
|
+
with open(pyproject_toml_path, mode="rb") as fp:
|
|
11
|
+
pyproject = tomli.load(fp)
|
|
12
|
+
project = pyproject["project"] if "project" in pyproject else pyproject["tool"]["poetry"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_read():
|
|
16
|
+
"""Test whether the contents have been read correctly and the required keys are in place."""
|
|
17
|
+
assert isinstance(pyproject, dict)
|
|
18
|
+
assert "build-system" in pyproject
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def test_name():
|
|
22
|
+
"""Ensure the name is consistent."""
|
|
23
|
+
assert "name" in project
|
|
24
|
+
assert project["name"] == "python-constraint2"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_versioning():
|
|
28
|
+
"""Test whether the versioning is PEP440 compliant."""
|
|
29
|
+
from pep440 import is_canonical
|
|
30
|
+
|
|
31
|
+
assert "version" in project
|
|
32
|
+
assert is_canonical(project["version"])
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def test_authors():
|
|
36
|
+
"""Ensure the authors are specified."""
|
|
37
|
+
assert "authors" in project
|
|
38
|
+
assert len(project["authors"]) > 0
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_license():
|
|
42
|
+
"""Ensure the license is set and the file exists."""
|
|
43
|
+
assert "license" in project
|
|
44
|
+
license = project["license"]
|
|
45
|
+
if isinstance(license, dict):
|
|
46
|
+
assert "file" in license
|
|
47
|
+
license = project["license"]["file"]
|
|
48
|
+
assert isinstance(license, str)
|
|
49
|
+
assert len(license) > 0
|
|
50
|
+
if license == "LICENSE":
|
|
51
|
+
assert Path(package_root / license).exists()
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def test_readme():
|
|
55
|
+
"""Ensure the readme is set and the file exists."""
|
|
56
|
+
assert "readme" in project
|
|
57
|
+
readme = project["readme"]
|
|
58
|
+
if isinstance(readme, dict):
|
|
59
|
+
assert "file" in readme
|
|
60
|
+
readme = project["readme"]["file"]
|
|
61
|
+
assert isinstance(readme, str)
|
|
62
|
+
assert len(readme) > 0
|
|
63
|
+
assert readme[:6] == "README"
|
|
64
|
+
assert Path(package_root / readme).exists()
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def test_project_keys():
|
|
68
|
+
"""Check whether the expected keys in [project] or [tool.poetry] are present."""
|
|
69
|
+
assert "description" in project
|
|
70
|
+
assert "keywords" in project
|
|
71
|
+
assert "classifiers" in project
|
|
72
|
+
assert "requires-python" in project or "python" in pyproject["tool"]["poetry"]["dependencies"]
|