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.
Fix build issues and improve code consistency
Overview
This PR addresses compilation and installation issues while improving code consistency across Pyfhel modules. The changes focus on fixing build system compatibility with modern Python environments and harmonizing internal attribute handling patterns.
Changes Summary
1. PyPoly.pyx Improvements
Added imports for consistency:
from .Pyfhel import Pyfhelfor type checkingfrom Pyfhel.Pyfhel cimport to_Scheme_tfor unified enum conversionUnified
_schemeattribute handling:to_Scheme_t(self._scheme)for consistency withPyCtxt.pyxandPyPtxt.pyxto_Scheme_t(new_scheme)then storesnew_scheme.valueto avoid Python-level dependency on C enum typesself._scheme = Scheme_t.none.valueFixed Cython syntax issues:
Impact: External API behavior remains unchanged; only internal
_schemehandling is harmonized with other modules for better consistency and maintainability.2. Build System Updates (pyproject.toml)
Updated setuptools dependency:
setuptools<=60.9tosetuptools>=68pkg_resourcesinterfaceAdded CMake policy configuration:
CMAKE_POLICY_VERSION_MINIMUM = '3.5'to SEAL cmake options3. Documentation Updates (README.md)
conda install -y -c conda-forge libxcryptsudo apt-get install -y libxcrypt-devcrypt.hheader files required for extension compilationEnvironment & Dependencies
The changes address common build failures on modern Linux distributions where the
libxcryptsystem library is required but not automatically available. The updated installation instructions in the README provide clear guidance for users to install the necessary system dependencies.Testing
Fixes
This PR ensures Pyfhel can be successfully built and installed in modern Python environments while maintaining backward compatibility and improving internal code consistency.