Skip to content

ENH: flexibly encode the implementation#407

Closed
mattip wants to merge 1 commit into
scikit-build:masterfrom
mattip:pypy
Closed

ENH: flexibly encode the implementation#407
mattip wants to merge 1 commit into
scikit-build:masterfrom
mattip:pypy

Conversation

@mattip

@mattip mattip commented May 13, 2019

Copy link
Copy Markdown
Contributor

The interpreter implementation is hard coded, this PR at least extends the range of hard-coded values. It would be even better to read this out somewhere. platform.python_implementation() would get a unique name, maybe the possible values could be mapped to a canonical implementation name.

Right now PyPy's is pypy-c, but I put in pypy as well to maybe future-proof the logic.

With this change, and a few small tweaks to PyPy's sysconfig 'LIB and LIBDIR values, I can successfully build opencv-python (which uses scikit-build) on pypy2.7

@jcfr

jcfr commented May 13, 2019

Copy link
Copy Markdown
Contributor

Thanks for the contribution 👍

This is great, all test pass

Ps: the failure is unrelated to your changes and due to an issue with the testing pipeline, see #409

Comment thread skbuild/cmaker.py
for (pre, ext, ver, abi) in itertools.product(
for (pre, impl, ext, ver, abi) in itertools.product(
candidate_lib_prefixes,
('python', 'pypy', 'pypy-c'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do you think of using a global dictionary and lookup the implementation based on the return value of platform.python_implementation() ?

It would also be nice to setup CI for testing scikit-build with PyPy ? Is it something you could help with ? May be extending the existing CircleCI or azure-pipelines configuration ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Which one would you prefer, circleci or azure?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you end up using a Docker image, leveraging CircleCI may make more sense as you can easily specify a container to run the test with.

May be you could look into using one of these images: https://marketplace.automic.com/details/pypy-official-docker-image ?

On linux, I wonder if requirements for pypy are similar to the one for manylinux ? (meaning a compiling environment with a modern compiler but dependency on an older glibc. See pep-513 and pep-571)

After the details are ironed out, I also wonder if (similarly to what is done for manylinux) integrating an image in dockcross would be relevant. This would provide one (or multiple images) with a readily available compiling env.

@jcfr

jcfr commented Jun 5, 2019

Copy link
Copy Markdown
Contributor

Closing. This is superseded by #418

@jcfr jcfr closed this Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Project: pypy PyPy specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants