-
Notifications
You must be signed in to change notification settings - Fork 46
Refactor: migrate C++ bindings to pybind11; modernize build, packaging & tests #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Acture
wants to merge
17
commits into
easy-graph:pybind11
Choose a base branch
from
Acture:refactor-build
base: pybind11
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,176
−2,979
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `test_suite` and `tests_require` arguments in `setup()` are legacy setuptools features that have been deprecated. Modern test runners like `pytest` and `tox` handle test discovery and dependency management externally. This commit removes these obsolete arguments to modernize the packaging configuration, reduce clutter, and silence deprecation warnings. Signed-off-by: acture <acturea@gmail.com>
The `setup.py` file used the deprecated license classifier `License :: OSI Approved :: BSD License`. Modern Python packaging standards (PyPA) recommend using specific, machine-readable SPDX identifiers. This commit replaces the old classifier with the precise `BSD-3-Clause` identifier in the `license` field. This aligns the project with best practices and silences setuptools deprecation warnings. Signed-off-by: acture <acturea@gmail.com>
…restructure project Replaced the legacy `setup.py` with modern `pyproject.toml` following PEP 517 and PEP 518 standards. Updated the project structure to move source files into a `src/` directory. Also, introduced `scikit-build` for efficient handling of C++ extensions. This change modernizes the project's packaging approach, aligns with best practices, and simplifies dependency management. Signed-off-by: acture <acturea@gmail.com>
Introduced a `.envrc` file to automate virtual environment setup using `direnv`. This inclusion ensures that the virtual environment is automatically initialized on directory entry and the necessary environment is activated. Signed-off-by: acture <acturea@gmail.com>
… for clarity This commit removes redundant imports, such as `deepcopy` and others from several modules, to reduce unnecessary dependencies. Additionally, improved the variable naming for better readability (e.g., `l` renamed to `length`). The changes optimize the codebase and enhance code clarity while preserving current functionality. Signed-off-by: acture <acturea@gmail.com>
Migrated from `Boost.Python` to `pybind11` for Python bindings, removing the dependency on Boost. Updated `CMakeLists.txt` to drop Boost requirements and refactored binding definitions to align with the pybind11 API. This includes updating function signatures and argument handling for consistency with pybind11. This migration simplifies the build process and reduces external dependencies while maintaining existing functionality. Signed-off-by: acture <acturea@gmail.com>
- Renamed `blogcatalog.mat` for consistency in the dataset samples. - Updated `.gitignore` by adding IDE-specific build directory patterns (e.g., `**/cmake-build-debug`). - Removed support for Python versions <3.10 in `pyproject.toml`. - Adjusted `pyproject.toml` to include `scikit-build`-specific details (`source-dir` added under `[tool.scikit-build.cmake]`). - Simplified package structure by modifying `setuptools.packages.find.where`. These changes streamline project organization, enhance compatibility with modern packaging standards, and refine dependency management. Signed-off-by: acture <acturea@gmail.com>
Completely replaced all Boost.Python bindings with modern pybind11 equivalents. All modules, method bindings, and function wrappers were rewritten to use pybind11’s C++17 interface (py::object, py::dict, py::list, etc.). Removed Boost.Python headers and adjusted build/CMake configuration accordingly. Signed-off-by: acture <acturea@gmail.com>
…ct structure - Removed `pytest.ini`, `tox.ini`, and `.flake8` as part of the configuration cleanup. - Updated and reorganized `pyproject.toml` with modern configurations for dependency management, linting, and testing. - Migrated build-related files from `cpp_easygraph` to `_cpp_easygraph` to align with updated CMake project structure. - Introduced Ruff linting with detailed rule selection and customization. - Consolidated `tox` configurations into `pyproject.toml`. These updates simplify project setup, align with modern tooling practices, and improve maintainability. Signed-off-by: acture <acturea@gmail.com>
- Replaced `from nose import SkipTest` with `from unittest import SkipTest` for compatibility with Python ≥3.12. - Removed all residual `nose` imports and related code paths. - Ensures pytest-native skip handling (`pytest.importorskip`, `pytest.skip`) is used consistently. This change removes an unmaintained dependency (`nose`) and restores compatibility with modern Python versions. Signed-off-by: acture <acturea@gmail.com>
- Introduced `graphviz` as an optional dependency in `pyproject.toml`, requiring `lxml>=6.0.2`. - Enables additional functionality for users needing Graphviz-related features. This addition improves the flexibility of the package by allowing optional integration with Graphviz. Signed-off-by: acture <acturea@gmail.com>
- Updated instances of `np.float_` to `np.float64` in `graphml.py`, `gexf.py`, and associated tests. - Ensures compatibility with newer NumPy versions where `np.float_` is deprecated. Signed-off-by: acture <acturea@gmail.com>
….14` - Replaced `lxml>=6.0.2` with `pygraphviz>=1.14` in `pyproject.toml` under `[project.optional-dependencies]`. - Ensures compatibility and better alignment with Graphviz-related features. Signed-off-by: acture <acturea@gmail.com>
- Updated `test_convert.py` to replace the deprecated `DataFrame.append` method with `pd.concat` for constructing dataframes. - Ensures compatibility with newer pandas versions where `DataFrame.append` is deprecated. Signed-off-by: acture <acturea@gmail.com>
…arsing logic - Removed unnecessary `warnings` imports and deprecated warnings in the GML parsing module (`gml.py`). - Fixed inconsistent indentation across GML and GraphML modules to adhere to PEP 8 standards. - Improved readability by cleaning up GML parsing logic, particularly around `parse_gml_lines` and helper functions. - Minor fix in GraphML Signed-off-by: acture <acturea@gmail.com>
- Updated all single-quoted strings in `directed_graph.py` to double-quoted strings for consistency. - Replaced `.format` with f-strings for improved readability and performance. - Simplified import statements by removing redundant imports and adhering to PEP 8 guidelines. - Used type hints with native `list` and `dict` instead of `List` and `Dict` from `typing`. These changes align the codebase with modern Python conventions and enhance readability. Signed-off-by: acture <acturea@gmail.com>
….suppress`
- Replaced `try-except` blocks catching generic exceptions with `contextlib.suppress` for improved readability and performance.
- Modified default mutable arguments (`{}` and `[]`) to `None` with proper initialization to prevent unintended side effects.
- Simplified `for` loop variables by prefixing unused ones with an underscore (`_`).
- Refactored conditional logic to use explicit boolean checks (`if not ...` for clarity).
- Updated `dict.keys()` and `dict.items()` iterations to directly iterate over dictionary views.
- Standardized function imports to ensure consistency by eliminating relative imports where applicable.
These updates improve readability, reduce potential bugs, and align the codebase with Python best practices.
Signed-off-by: acture <acturea@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Depends on #153.
Closes #154.
This PR is a comprehensive build system and packaging refactor following the pybind11 migration.
It consolidates all build logic under a modern, reproducible structure and aligns EasyGraph’s native extension, Python packaging, and test workflow.
While the diff is large (+3,176 −2,979, 142 files changed), most edits are:
No algorithmic logic is altered.
Key Changes