From f2dbad637185ea403cf096ca373ea27b9f40c038 Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Wed, 24 Sep 2025 14:28:17 +0300 Subject: [PATCH 01/15] style(workflows): fix formatting --- .github/workflows/build-and-publish.yml | 102 ++++++++++++------------ .github/workflows/build-and-test.yml | 5 +- .github/workflows/codacy-analysis.yml | 6 +- .github/workflows/codeql-analysis.yml | 70 ++++++++-------- 4 files changed, 91 insertions(+), 92 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 626bbc7..3fb2804 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,4 +1,4 @@ -name: Build and publish pyfactxx +name: Build and publish pyfactxx on: release: @@ -16,60 +16,60 @@ jobs: working-directory: ./FaCT++.Python steps: - - uses: actions/checkout@v3 - - uses: ilammy/msvc-dev-cmd@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel auditwheel scikit-build cmake cython - - name: Build a wheel - run: | - python setup.py bdist_wheel - - name: Audit a wheel - if: runner.os == 'Linux' - run: | - auditwheel repair --plat manylinux_2_27_x86_64 dist/* - rm -rf dist/* - mv wheelhouse/* dist - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ runner.os }}-${{ matrix.python-version }} - path: FaCT++.Python/dist/pyfactxx* + - uses: actions/checkout@v3 + - uses: ilammy/msvc-dev-cmd@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel auditwheel scikit-build cmake cython + - name: Build a wheel + run: | + python setup.py bdist_wheel + - name: Audit a wheel + if: runner.os == 'Linux' + run: | + auditwheel repair --plat manylinux_2_27_x86_64 dist/* + rm -rf dist/* + mv wheelhouse/* dist + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ runner.os }}-${{ matrix.python-version }} + path: FaCT++.Python/dist/pyfactxx* publish: runs-on: ubuntu-latest - needs: build + needs: build defaults: run: working-directory: ./FaCT++.Python steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.8 - uses: actions/setup-python@v3 - with: - python-version: 3.8 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel auditwheel scikit-build cmake cython - - name: Build a source distribution - run: | - python setup.py sdist - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - path: FaCT++.Python/wheels/ - - name: Move wheels - run: | - mv wheels/*/*.whl dist/ - - name: Publish packages - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - packages_dir: FaCT++.Python/dist \ No newline at end of file + - uses: actions/checkout@v3 + - name: Set up Python 3.8 + uses: actions/setup-python@v3 + with: + python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel auditwheel scikit-build cmake cython + - name: Build a source distribution + run: | + python setup.py sdist + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: FaCT++.Python/wheels/ + - name: Move wheels + run: | + mv wheels/*/*.whl dist/ + - name: Publish packages + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: FaCT++.Python/dist diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 31dc8e8..e1649d1 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -3,13 +3,12 @@ name: Build and test pyfactxx on: workflow_dispatch: push: - branches: [ $default-branch, "wheels" ] + branches: [master, "wheels"] pull_request: - branches: [ $default-branch, "wheels" ] + branches: [master, "wheels"] jobs: build: - runs-on: ubuntu-latest defaults: run: diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index e2eba20..f6f94ef 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -2,12 +2,12 @@ name: Codacy Security Scan on: push: - branches: [ master ] + branches: [master] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [master] schedule: - - cron: '32 23 * * 5' + - cron: "32 23 * * 5" jobs: codacy-security-scan: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0c5194d..0fb60a9 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,12 +2,12 @@ name: "CodeQL" on: push: - branches: [ master ] + branches: [master] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [master] schedule: - - cron: '30 3 * * 0' + - cron: "30 3 * * 0" jobs: analyze: @@ -21,37 +21,37 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'cpp', 'java', 'python' ] + language: ["cpp", "java", "python"] steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 16aa4b82e5f15f786801fbdae9fcfaf8940cf3b4 Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Wed, 24 Sep 2025 14:30:40 +0300 Subject: [PATCH 02/15] ci: bump actions/checkout to v5 --- .github/workflows/build-and-publish.yml | 2 +- .github/workflows/build-and-test.yml | 2 +- .github/workflows/codacy-analysis.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 3fb2804..fa091c0 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -16,7 +16,7 @@ jobs: working-directory: ./FaCT++.Python steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - uses: ilammy/msvc-dev-cmd@v1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index e1649d1..7533f26 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -18,7 +18,7 @@ jobs: python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - uses: ilammy/msvc-dev-cmd@v1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index f6f94ef..fb22813 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -16,7 +16,7 @@ jobs: steps: # Checkout the repository to the GitHub Actions runner - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v5 # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI From baf7b8beffaf1477dfd60b21f089f6cd0a035a08 Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Fri, 10 Oct 2025 20:04:16 +0300 Subject: [PATCH 03/15] fix: find Python interpreter in virtual env first --- FaCT++.Python/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FaCT++.Python/CMakeLists.txt b/FaCT++.Python/CMakeLists.txt index d372039..20bf5af 100644 --- a/FaCT++.Python/CMakeLists.txt +++ b/FaCT++.Python/CMakeLists.txt @@ -1,7 +1,9 @@ set(CMAKE_VERBOSE_MAKEFILE ON) -cmake_minimum_required(VERSION 3.13.0) +cmake_minimum_required(VERSION 3.15) set(CMAKE_CXX_STANDARD 11) -find_program(PYTHON "python") + +set(Python_FIND_VIRTUALENV FIRST) +find_package(Python3 COMPONENTS Interpreter) if (PYTHON) @@ -19,4 +21,4 @@ if (PYTHON) add_custom_target(pyfactxx-build ALL DEPENDS ${OUTPUT}) install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)") -endif() \ No newline at end of file +endif() From 27de5aed904a7a199a2fbbe1b75e2c614d0ccd43 Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Fri, 17 Oct 2025 16:20:05 +0300 Subject: [PATCH 04/15] fix: wrong module loading Rename python package dir to "src" to be different from installed package. --- FaCT++.Python/.gitignore | 6 ++-- FaCT++.Python/CMakeLists.txt | 2 +- FaCT++.Python/MANIFEST.in | 5 ++- FaCT++.Python/setup.cfg | 2 +- FaCT++.Python/setup.py | 32 ++++++++----------- .../{pyfactxx => src}/CMakeLists.txt | 2 +- FaCT++.Python/{pyfactxx => src}/__init__.py | 3 +- FaCT++.Python/{pyfactxx => src}/coras | 0 .../{pyfactxx => src}/lib_factxx.pyx | 0 .../{pyfactxx => }/tests/__init__.py | 0 .../{pyfactxx => }/tests/conftest.py | 0 .../{pyfactxx => }/tests/test_concept.py | 0 .../{pyfactxx => }/tests/test_d_role.py | 0 .../{pyfactxx => }/tests/test_instance.py | 0 .../{pyfactxx => }/tests/test_o_role.py | 0 .../{pyfactxx => }/tests/test_one_to_one.py | 0 .../tests/test_query_instances.py | 0 .../{pyfactxx => }/tests/test_set_op.py | 0 18 files changed, 22 insertions(+), 30 deletions(-) rename FaCT++.Python/{pyfactxx => src}/CMakeLists.txt (93%) rename FaCT++.Python/{pyfactxx => src}/__init__.py (99%) rename FaCT++.Python/{pyfactxx => src}/coras (100%) rename FaCT++.Python/{pyfactxx => src}/lib_factxx.pyx (100%) rename FaCT++.Python/{pyfactxx => }/tests/__init__.py (100%) rename FaCT++.Python/{pyfactxx => }/tests/conftest.py (100%) rename FaCT++.Python/{pyfactxx => }/tests/test_concept.py (100%) rename FaCT++.Python/{pyfactxx => }/tests/test_d_role.py (100%) rename FaCT++.Python/{pyfactxx => }/tests/test_instance.py (100%) rename FaCT++.Python/{pyfactxx => }/tests/test_o_role.py (100%) rename FaCT++.Python/{pyfactxx => }/tests/test_one_to_one.py (100%) rename FaCT++.Python/{pyfactxx => }/tests/test_query_instances.py (100%) rename FaCT++.Python/{pyfactxx => }/tests/test_set_op.py (100%) diff --git a/FaCT++.Python/.gitignore b/FaCT++.Python/.gitignore index 77b9fe4..5db6e40 100644 --- a/FaCT++.Python/.gitignore +++ b/FaCT++.Python/.gitignore @@ -5,9 +5,9 @@ __pycache__/ dist/ MANIFEST -# cythonized files -pyfactxx/*.cpp -pyfactxx/*.so +# cythonized files +src/*.cpp +src/*.so # scikit-build files _skbuild/ diff --git a/FaCT++.Python/CMakeLists.txt b/FaCT++.Python/CMakeLists.txt index 20bf5af..154d6e0 100644 --- a/FaCT++.Python/CMakeLists.txt +++ b/FaCT++.Python/CMakeLists.txt @@ -10,7 +10,7 @@ if (PYTHON) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py") - set(DEPS "${CMAKE_CURRENT_SOURCE_DIR}/pyfactxx/__init__.py") + set(DEPS "${CMAKE_CURRENT_SOURCE_DIR}/src/__init__.py") set(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp") add_custom_command(OUTPUT ${OUTPUT} diff --git a/FaCT++.Python/MANIFEST.in b/FaCT++.Python/MANIFEST.in index 4f3040a..7fff1be 100644 --- a/FaCT++.Python/MANIFEST.in +++ b/FaCT++.Python/MANIFEST.in @@ -1,6 +1,5 @@ global-include CMakeLists.txt -prune _skbuild/ -recursive-include pyfactxx *.py *.pyx -prune pyfactxx/tests +prune _skbuild/ +recursive-include src *.py *.pyx graft lib include COPYING pyproject.toml README.md setup.py diff --git a/FaCT++.Python/setup.cfg b/FaCT++.Python/setup.cfg index 8c70520..4aa14c2 100644 --- a/FaCT++.Python/setup.cfg +++ b/FaCT++.Python/setup.cfg @@ -36,7 +36,7 @@ tests_require = pytest, pytest-cov formats = zip [tool:pytest] -addopts = --cov=pyfactxx +addopts = --cov=src [coverage:report] show_missing = 1 diff --git a/FaCT++.Python/setup.py b/FaCT++.Python/setup.py index a7f7996..01cc5e9 100644 --- a/FaCT++.Python/setup.py +++ b/FaCT++.Python/setup.py @@ -19,35 +19,29 @@ # along with this program. If not, see . # -import re import ast import pathlib -from skbuild import setup +import re +from skbuild import setup root = pathlib.Path(__file__).parent.resolve() DEBUG = False -_version_re = re.compile(r'__version__\s+=\s+(.*)') +_version_re = re.compile(r"__version__\s+=\s+(.*)") -with open('pyfactxx/__init__.py', 'rb') as f: - version = str(ast.literal_eval(_version_re.search( - f.read().decode('utf-8')).group(1))) +with open("src/__init__.py", "rb") as f: + version = str( + ast.literal_eval(_version_re.search(f.read().decode("utf-8")).group(1)) + ) -config = 'Debug' if DEBUG else 'Release' -cmake_args = [ - f'-DCMAKE_BUILD_TYPE={config}', - f'-DPYFACTXX_ROOT={root.as_posix()}' -] +config = "Debug" if DEBUG else "Release" +cmake_args = [f"-DCMAKE_BUILD_TYPE={config}", f"-DPYFACTXX_ROOT={root.as_posix()}"] setup( version=version, - packages=[ - "pyfactxx", - "pyfactxx.coras"], - package_dir={ - "pyfactxx": "pyfactxx", - "pyfactxx.coras": "pyfactxx/coras"}, - cmake_source_dir=str(root/'pyfactxx'), - cmake_args=cmake_args + packages=["pyfactxx", "pyfactxx.coras"], + package_dir={"pyfactxx": "src", "pyfactxx.coras": "src/coras"}, + cmake_source_dir=str(root / "src"), + cmake_args=cmake_args, ) diff --git a/FaCT++.Python/pyfactxx/CMakeLists.txt b/FaCT++.Python/src/CMakeLists.txt similarity index 93% rename from FaCT++.Python/pyfactxx/CMakeLists.txt rename to FaCT++.Python/src/CMakeLists.txt index 72243ab..39aa55a 100644 --- a/FaCT++.Python/pyfactxx/CMakeLists.txt +++ b/FaCT++.Python/src/CMakeLists.txt @@ -18,7 +18,7 @@ target_include_directories(lib_factxx PRIVATE ${FACT_DIR} Kernel) target_link_libraries(lib_factxx Kernel) python_extension_module(lib_factxx) -install(TARGETS lib_factxx LIBRARY DESTINATION pyfactxx) +install(TARGETS lib_factxx LIBRARY DESTINATION src) set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) diff --git a/FaCT++.Python/pyfactxx/__init__.py b/FaCT++.Python/src/__init__.py similarity index 99% rename from FaCT++.Python/pyfactxx/__init__.py rename to FaCT++.Python/src/__init__.py index 3a64261..51019c5 100644 --- a/FaCT++.Python/pyfactxx/__init__.py +++ b/FaCT++.Python/src/__init__.py @@ -17,9 +17,8 @@ # along with this program. If not, see . # -from .lib_factxx import Reasoner # pylint: disable=no-name-in-module from .coras import Coras - +from .lib_factxx import Reasoner # pylint: disable=no-name-in-module __version__ = "1.8.1" diff --git a/FaCT++.Python/pyfactxx/coras b/FaCT++.Python/src/coras similarity index 100% rename from FaCT++.Python/pyfactxx/coras rename to FaCT++.Python/src/coras diff --git a/FaCT++.Python/pyfactxx/lib_factxx.pyx b/FaCT++.Python/src/lib_factxx.pyx similarity index 100% rename from FaCT++.Python/pyfactxx/lib_factxx.pyx rename to FaCT++.Python/src/lib_factxx.pyx diff --git a/FaCT++.Python/pyfactxx/tests/__init__.py b/FaCT++.Python/tests/__init__.py similarity index 100% rename from FaCT++.Python/pyfactxx/tests/__init__.py rename to FaCT++.Python/tests/__init__.py diff --git a/FaCT++.Python/pyfactxx/tests/conftest.py b/FaCT++.Python/tests/conftest.py similarity index 100% rename from FaCT++.Python/pyfactxx/tests/conftest.py rename to FaCT++.Python/tests/conftest.py diff --git a/FaCT++.Python/pyfactxx/tests/test_concept.py b/FaCT++.Python/tests/test_concept.py similarity index 100% rename from FaCT++.Python/pyfactxx/tests/test_concept.py rename to FaCT++.Python/tests/test_concept.py diff --git a/FaCT++.Python/pyfactxx/tests/test_d_role.py b/FaCT++.Python/tests/test_d_role.py similarity index 100% rename from FaCT++.Python/pyfactxx/tests/test_d_role.py rename to FaCT++.Python/tests/test_d_role.py diff --git a/FaCT++.Python/pyfactxx/tests/test_instance.py b/FaCT++.Python/tests/test_instance.py similarity index 100% rename from FaCT++.Python/pyfactxx/tests/test_instance.py rename to FaCT++.Python/tests/test_instance.py diff --git a/FaCT++.Python/pyfactxx/tests/test_o_role.py b/FaCT++.Python/tests/test_o_role.py similarity index 100% rename from FaCT++.Python/pyfactxx/tests/test_o_role.py rename to FaCT++.Python/tests/test_o_role.py diff --git a/FaCT++.Python/pyfactxx/tests/test_one_to_one.py b/FaCT++.Python/tests/test_one_to_one.py similarity index 100% rename from FaCT++.Python/pyfactxx/tests/test_one_to_one.py rename to FaCT++.Python/tests/test_one_to_one.py diff --git a/FaCT++.Python/pyfactxx/tests/test_query_instances.py b/FaCT++.Python/tests/test_query_instances.py similarity index 100% rename from FaCT++.Python/pyfactxx/tests/test_query_instances.py rename to FaCT++.Python/tests/test_query_instances.py diff --git a/FaCT++.Python/pyfactxx/tests/test_set_op.py b/FaCT++.Python/tests/test_set_op.py similarity index 100% rename from FaCT++.Python/pyfactxx/tests/test_set_op.py rename to FaCT++.Python/tests/test_set_op.py From d9e0210d9d2ef6f188da160c0d893265804468b4 Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Fri, 17 Oct 2025 16:26:19 +0300 Subject: [PATCH 05/15] fix: do not use editable install Editable install is broken since Setuptools 64 https://github.com/pypa/setuptools/issues/3504 Not supported by scikit-build https://github.com/scikit-build/scikit-build/issues/740 https://github.com/scikit-build/scikit-build/issues/770 https://github.com/scikit-build/scikit-build/issues/939 --- .github/workflows/build-and-test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7533f26..3160b59 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -29,9 +29,8 @@ jobs: python -m pip install --upgrade pip pip install scikit-build cmake cython pytest pytest-cov - name: Install package - working-directory: ./FaCT++.Python run: | - pip install -e . + pip install . - name: Test with pytest run: | - pytest FaCT++.Python + pytest From 9f7e05e35029dd69ed865b97d131be7842986b9f Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Fri, 17 Oct 2025 16:28:55 +0300 Subject: [PATCH 06/15] fix: bump versions of build tools and supported interpreters --- FaCT++.Python/pyproject.toml | 8 ++++---- FaCT++.Python/setup.cfg | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/FaCT++.Python/pyproject.toml b/FaCT++.Python/pyproject.toml index a203ce9..bc76eb3 100644 --- a/FaCT++.Python/pyproject.toml +++ b/FaCT++.Python/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = [ - "setuptools>=42", +requires = [ + "setuptools>=64", "cython>0.25", "wheel", "scikit-build", - "cmake", + "cmake>=3.15", "ninja; platform_system!='Windows'" ] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" diff --git a/FaCT++.Python/setup.cfg b/FaCT++.Python/setup.cfg index 4aa14c2..cf97b83 100644 --- a/FaCT++.Python/setup.cfg +++ b/FaCT++.Python/setup.cfg @@ -8,27 +8,28 @@ maintainer_email = ir@tilde.pro url = https://github.com/tilde-lab/pyfactxx long_description = file: README.md long_description_content_type = text/markdown -license = GNU GPL 3.0 -license_files = file: COPYING +license = GPL-3.0-only +license_files = + COPYING classifiers = Development Status :: 4 - Beta Intended Audience :: Science/Research Topic :: Scientific/Engineering :: Artificial Intelligence - License :: OSI Approved :: GNU General Public License v3 (GPLv3) Programming Language :: C++ Programming Language :: Cython Programming Language :: Lisp Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 + Programming Language :: Python :: 3.13 + Programming Language :: Python :: 3.14 [options] zip_safe = False include_package_data = True -python_requires = >=3.7 +python_requires = >=3.9 install_requires = rdflib tests_require = pytest, pytest-cov @@ -41,4 +42,3 @@ addopts = --cov=src [coverage:report] show_missing = 1 partial_branches = 1 - From 9a7a3f08a988d19b6838fc0b15af8987e935d642 Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Fri, 17 Oct 2025 16:29:21 +0300 Subject: [PATCH 07/15] ci: bump versions of actions and supported interpreters --- .github/workflows/build-and-test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3160b59..79db93a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -7,6 +7,9 @@ on: pull_request: branches: [master, "wheels"] +permissions: + contents: read # access to check out code and install dependencies + jobs: build: runs-on: ubuntu-latest @@ -15,13 +18,13 @@ jobs: working-directory: ./FaCT++.Python strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v5 - uses: ilammy/msvc-dev-cmd@v1 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install dependencies From a1c0c367a1f6538bf1838839edc9cc83b71c1118 Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Fri, 17 Oct 2025 17:39:49 +0300 Subject: [PATCH 08/15] ci: no need to install deps manually --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 79db93a..0d71e68 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -30,7 +30,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install scikit-build cmake cython pytest pytest-cov + pip install pytest pytest-cov - name: Install package run: | pip install . From 0208e7e7c5eab44a228ce971b642a0906a16c513 Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Wed, 22 Oct 2025 23:16:49 +0300 Subject: [PATCH 09/15] ci: update build matrix --- .github/workflows/build-and-publish.yml | 8 ++++---- .github/workflows/build-and-test.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index fa091c0..f38d6b4 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -9,8 +9,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ["ubuntu-20.04", "windows-latest"] - python-version: ["3.7", "3.8", "3.9", "3.10"] + os: ["ubuntu-22.04", "windows-2025"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] defaults: run: working-directory: ./FaCT++.Python @@ -32,7 +32,7 @@ jobs: - name: Audit a wheel if: runner.os == 'Linux' run: | - auditwheel repair --plat manylinux_2_27_x86_64 dist/* + auditwheel repair --plat manylinux_2_34_x86_64 dist/*whl rm -rf dist/* mv wheelhouse/* dist - name: Upload artifact @@ -52,7 +52,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: 3.14 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0d71e68..0f7ddae 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -12,7 +12,7 @@ permissions: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 defaults: run: working-directory: ./FaCT++.Python From cf3d4afd4c097b12a61eef6fb39cce902a47141c Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Wed, 22 Oct 2025 23:19:42 +0300 Subject: [PATCH 10/15] ci: update action versions --- .github/workflows/build-and-publish.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index f38d6b4..26bbff7 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -17,9 +17,13 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: ilammy/msvc-dev-cmd@v1 + - uses: actions/setup-node@v6 + with: + node-version: "24" + # TODO: migrate to the upstream + - uses: knopki/msvc-dev-cmd@221ec3af3b87c0c8189236347c1c0788d2022272 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -36,7 +40,7 @@ jobs: rm -rf dist/* mv wheelhouse/* dist - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ runner.os }}-${{ matrix.python-version }} path: FaCT++.Python/dist/pyfactxx* @@ -48,9 +52,9 @@ jobs: run: working-directory: ./FaCT++.Python steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.8 - uses: actions/setup-python@v3 + - uses: actions/checkout@v5 + - name: Set up Python + uses: actions/setup-python@v6 with: python-version: 3.14 - name: Install dependencies @@ -61,14 +65,14 @@ jobs: run: | python setup.py sdist - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v5 with: path: FaCT++.Python/wheels/ - name: Move wheels run: | mv wheels/*/*.whl dist/ - name: Publish packages - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@v1.13.0 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From 796d9efc92b8c48746bc7aa0309dfd36852ebc1b Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Thu, 23 Oct 2025 00:14:42 +0300 Subject: [PATCH 11/15] ci: fixes --- .github/workflows/build-and-publish.yml | 27 +++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 26bbff7..7d8e642 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -4,6 +4,9 @@ on: release: types: [created] +permissions: + contents: read # access to check out code and install dependencies + jobs: build: runs-on: ${{ matrix.os }} @@ -29,7 +32,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel auditwheel scikit-build cmake cython + pip install setuptools wheel scikit-build cmake cython + - name: Install Linux-only dependencies + if: runner.os == 'Linux' + run: | + pip install auditwheel patchelf - name: Build a wheel run: | python setup.py bdist_wheel @@ -46,11 +53,16 @@ jobs: path: FaCT++.Python/dist/pyfactxx* publish: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: build defaults: run: working-directory: ./FaCT++.Python + environment: + name: pypi + url: https://pypi.org/p/pyfactxx + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - uses: actions/checkout@v5 - name: Set up Python @@ -60,7 +72,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel auditwheel scikit-build cmake cython + pip install setuptools wheel scikit-build cmake cython - name: Build a source distribution run: | python setup.py sdist @@ -74,6 +86,9 @@ jobs: - name: Publish packages uses: pypa/gh-action-pypi-publish@v1.13.0 with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - packages_dir: FaCT++.Python/dist + packages-dir: FaCT++.Python/dist/ + # # useful for testing: + # verbose: true + # repository-url: https://test.pypi.org/legacy/ + # user: __token__ + # password: ${{ secrets.PYPI_API_TOKEN }} From 897e434e49620564aea932bab3e3734145e6dd6f Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Thu, 23 Oct 2025 00:26:24 +0300 Subject: [PATCH 12/15] fix: bump min cmake version to 3.15 --- CMakeLists.txt | 2 +- FaCT++.C/CMakeLists.txt | 2 +- FaCT++.JNI/CMakeLists.txt | 2 +- FaCT++.Python/src/CMakeLists.txt | 2 +- FaCT++/CMakeLists.txt | 2 +- Kernel/CMakeLists.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 550231d..1b81c7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.15) project(factplusplus) # global definition diff --git a/FaCT++.C/CMakeLists.txt b/FaCT++.C/CMakeLists.txt index 93455fd..fec14d4 100644 --- a/FaCT++.C/CMakeLists.txt +++ b/FaCT++.C/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.15) set(SOURCE_FILES fact.cpp diff --git a/FaCT++.JNI/CMakeLists.txt b/FaCT++.JNI/CMakeLists.txt index 3c146d9..56a9b27 100644 --- a/FaCT++.JNI/CMakeLists.txt +++ b/FaCT++.JNI/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.15) # We are using JNI and need to #include find_package(JNI REQUIRED) diff --git a/FaCT++.Python/src/CMakeLists.txt b/FaCT++.Python/src/CMakeLists.txt index 39aa55a..6147375 100644 --- a/FaCT++.Python/src/CMakeLists.txt +++ b/FaCT++.Python/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13.0) +cmake_minimum_required(VERSION 3.15) project(pyfactxx) set(CMAKE_CXX_STANDARD 11) include(CMakePrintHelpers) diff --git a/FaCT++/CMakeLists.txt b/FaCT++/CMakeLists.txt index 040bf38..305a317 100644 --- a/FaCT++/CMakeLists.txt +++ b/FaCT++/CMakeLists.txt @@ -1,5 +1,5 @@ project(FaCT++) -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.15) set(SOURCE_FILES AD.cpp diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index f287b74..1422d7e 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.15) set(SOURCE_FILES Actor.cpp From 072e8189a5534aaec97e22fb1e52f8e6a67cfa0d Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Thu, 23 Oct 2025 14:40:36 +0300 Subject: [PATCH 13/15] ci: fix codacy --- .github/workflows/codacy-analysis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml index fb22813..2ade04b 100644 --- a/.github/workflows/codacy-analysis.yml +++ b/.github/workflows/codacy-analysis.yml @@ -36,6 +36,10 @@ jobs: # Upload the SARIF file generated in the previous step - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@v1 + uses: github/codeql-action/upload-sarif@v4 + # Codacy is broken now + # https://github.com/codacy/codacy-analysis-cli/issues/541 + continue-on-error: true with: sarif_file: results.sarif + wait-for-processing: true From eb2edd704a740eaac91c0b4fd8043154e7bed3ed Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Thu, 23 Oct 2025 14:40:44 +0300 Subject: [PATCH 14/15] ci: fix codeql --- .github/workflows/codeql-analysis.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0fb60a9..3826736 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,7 +12,7 @@ on: jobs: analyze: name: Analyze - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: actions: read contents: read @@ -29,7 +29,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -40,7 +40,8 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + if: matrix.language != 'cpp' + uses: github/codeql-action/autobuild@v3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -49,9 +50,16 @@ jobs: # and modify them (or add more) to build your code if your project # uses a compiled language - #- run: | - # make bootstrap - # make release + - name: Install dependencies + if: matrix.language == 'cpp' + run: | + sudo apt-get update + sudo apt-get install cmake default-jdk + - name: Build + if: matrix.language == 'cpp' + run: | + cmake . + make - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v3 From f5cff44fc53713409a3426c7d3b6050acd9accbb Mon Sep 17 00:00:00 2001 From: Sergei Korolev Date: Thu, 23 Oct 2025 16:23:13 +0300 Subject: [PATCH 15/15] fix: port to GCC 13 (Ubuntu 24.04) --- Kernel/flags.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Kernel/flags.h b/Kernel/flags.h index 418577a..213197b 100644 --- a/Kernel/flags.h +++ b/Kernel/flags.h @@ -16,6 +16,7 @@ You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #ifndef FLAGS_H #define FLAGS_H