From 5285a065867f68a8c35c634327bf8a8840ab2875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iy=C3=A1n=20M=C3=A9ndez=20Veiga?= Date: Sun, 2 Feb 2025 10:16:49 +0100 Subject: [PATCH 1/5] Find module path at runtime Currently, this test only passes if you run the test while being in the source repository. Trying to run the test after installing the generated wheel package in a different directory will fail because "./constraint" may not exist, or worse, give a false failure since the shared libraries might exist in the wheel package but not in the source directory. --- tests/test_compilation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_compilation.py b/tests/test_compilation.py index dc67b2b..90fbf40 100644 --- a/tests/test_compilation.py +++ b/tests/test_compilation.py @@ -3,15 +3,15 @@ def test_if_compiled(): """Test whether C-extensions are succesfully ran, if enabled.""" - from constraint import check_if_compiled + import constraint # check if the .so files are commented - dir = Path("./constraint") + dir = Path(constraint.__file__).resolve().parent assert dir.exists() files = list(dir.glob("_*.so")) # check if the code uses C-extensions if len(files) > 0: - assert check_if_compiled() is False + assert constraint.check_if_compiled() is False else: - assert check_if_compiled() + assert constraint.check_if_compiled() From dd005f5168a8855560d93a598af3ea9be203f9e8 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 4 Feb 2025 10:38:45 +0100 Subject: [PATCH 2/5] Changed required coverage percentage in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc4c544..ba330f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ All notable changes to this code base will be documented in this file, for every - Switched from `setup.py` to `pyproject.toml` - Added `nox` for testing against all supported Python versions - Added `ruff` for codestyle testing - - Achieved and requires test coverage of at least 65% + - Achieved and requires test coverage of at least 80% - Moved the documentation to GitHub Pages - Moved test & publishing automation to GitHub Actions - Switched dependency & build system to Poetry From 99b1dc9e36649f330d0289d8f8fbc20d0a5469d8 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 4 Feb 2025 11:37:23 +0100 Subject: [PATCH 3/5] Added path filters to GitHub workflows to avoid unnecessary action runs --- .github/workflows/build-test-python-package.yml | 7 +++++++ .github/workflows/publish-documentation.yml | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/build-test-python-package.yml b/.github/workflows/build-test-python-package.yml index 8013326..62da4f6 100644 --- a/.github/workflows/build-test-python-package.yml +++ b/.github/workflows/build-test-python-package.yml @@ -7,6 +7,13 @@ on: branches: - main - release/* + paths: + - "constraint/**" + - "tests/**" + - "cythonize_build.py" + - "noxfile.py" + - "pyproject.toml" + - ".github/workflows/build-test-python-package.yml" pull_request: branches: - main diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml index 90e9a65..77050ba 100644 --- a/.github/workflows/publish-documentation.yml +++ b/.github/workflows/publish-documentation.yml @@ -5,6 +5,11 @@ name: Publish documentation on: push: branches: [main] # branch to trigger deployment + paths: + - "docs/**" + - "constraint/**" + - "pyproject.toml" + - ".github/workflows/publish-documentation.yml" release: types: [published] # releases trigger deployment as well From a8fd096ce7974a4f5b6e8a5f34064ce37b3eca10 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Sat, 8 Feb 2025 14:35:41 +0100 Subject: [PATCH 4/5] Update README.rst Updated roadmap --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 0711258..ba4ab03 100644 --- a/README.rst +++ b/README.rst @@ -168,8 +168,9 @@ For an overview of recent changes, visit the `Changelog `_ automated with `GH actions `_ - Versioned documentation Contact From ff3b966a503dd10e215c8843dca29a5691c3f868 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 11 Feb 2025 12:26:05 +0100 Subject: [PATCH 5/5] Bumped version in pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 353c3c5..49620b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ packages = [ ] include = [{ path = "constraint/*.so", format = "wheel" }] description = "python-constraint is a module for efficiently solving CSPs (Constraint Solving Problems) over finite domains." -version = "2.0.2" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 +version = "2.0.3" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 authors = [ "Gustavo Niemeyer ", "Sébastien Celles ",