Skip to content

Comments

Allow Cython build#172

Merged
joewallwork merged 3 commits intomainfrom
allow-cython-build
Feb 23, 2026
Merged

Allow Cython build#172
joewallwork merged 3 commits intomainfrom
allow-cython-build

Conversation

@joewallwork
Copy link
Member

Local testing suggests that this should be sufficient to get the build in mesh-adaptation/animate#226 working.

@joewallwork joewallwork self-assigned this Feb 20, 2026
@joewallwork joewallwork added testing Extensions and improvements to the testing infrastructure install Installation instructions/process needs updating labels Feb 20, 2026
@joewallwork joewallwork moved this to Ready for review in Mesh Adaptation development board Feb 20, 2026
Copy link
Collaborator

@stephankramer stephankramer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, looks good

@github-project-automation github-project-automation bot moved this from Ready for review to Ready to merge in Mesh Adaptation development board Feb 23, 2026
@joewallwork joewallwork merged commit f09b273 into main Feb 23, 2026
7 checks passed
@joewallwork joewallwork deleted the allow-cython-build branch February 23, 2026 10:58
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Mesh Adaptation development board Feb 23, 2026
stephankramer added a commit that referenced this pull request Feb 23, 2026
In #172 the --no-build-isolation was added, needed to access to petsc
etc. packages during build of cython modules, but the -e flag was
dropped. It appears that this breaks importing a python module with a cython submodule, from the source directory of that python module itself.

E.g. if you are in the animate/ source directory, "import animate" in
python, it will try to import it from the local directory, but if that
module was built without the -e flag, the
numbering.cpython-312-x86_64-linux-gnu.so is not available in
animate/numbering/ but only in the installed directory
(/usr/local/lib/...) and therefore the import will fail on "from
.cython.numbering import to_petsc_local_numbering"
Therefore you can no longer run pytest within the animate/ directory.

With the -e flag, the dynamic .so is placed in animate/numbering/ and it
is able to "import animate" from within the local directory, as well as
from anywhere else.
joewallwork pushed a commit that referenced this pull request Feb 23, 2026
In #172 the --no-build-isolation was added, needed to access to petsc
etc. packages during build of cython modules, but the -e flag was
dropped. It appears that the latter breaks importing a python module
with a cython submodule, from the source directory of that python module
itself.

E.g. if you are in the animate/ source directory, "import animate" in
python, it will try to import it from the local directory, but if that
module was built without the -e flag, the
numbering.cpython-312-x86_64-linux-gnu.so is not available in
animate/numbering/ but only in the installed directory
(/usr/local/lib/...) and therefore the import will fail on "from
.cython.numbering import to_petsc_local_numbering" Therefore you can no
longer run pytest within the animate/ directory.

With the -e flag, the dynamic .so is placed in animate/numbering/ and it
is able to "import animate" from within the local directory, as well as
from anywhere else.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

install Installation instructions/process needs updating testing Extensions and improvements to the testing infrastructure

Development

Successfully merging this pull request may close these issues.

2 participants