GithubHelp home page GithubHelp logo

Comments (10)

Marco-Sulla avatar Marco-Sulla commented on June 12, 2024

Yes, it's in the TODO list:

Ponder to remove the py wheel and make the C Extension optional

Not very difficult to do:

myextension = Extension(
    "myextension",
    ["myextension.c"],
    optional=os.environ.get('CIBUILDWHEEL', '0') != '1',
)

https://cibuildwheel.readthedocs.io/en/stable/faq/#optional-extensions

from python-frozendict.

Marco-Sulla avatar Marco-Sulla commented on June 12, 2024

It should be fixed with the new release:
https://github.com/Marco-Sulla/python-frozendict/releases/tag/v2.3.5

Can you confirm it?

from python-frozendict.

mgorny avatar mgorny commented on June 12, 2024

It's not fixed. We still can't tell it not to try building the C extension for Python 3.11. Furthermore, now we need to explicitly pass CIBUILDWHEEL=1 to ensure that it silently doesn't ignore unrelated build failures on other Python versions.

from python-frozendict.

Marco-Sulla avatar Marco-Sulla commented on June 12, 2024

What's the problem of trying to build the C Extension for Python 3.11?

from python-frozendict.

Marco-Sulla avatar Marco-Sulla commented on June 12, 2024

The problem here is pip and not supported platforms.

If someone wants to install the module for an architecture X and the arch X binary is not present on Pypi, pip downloads and install the pure py wheel if present. It does not try to install the sdist package, even if present.

On the contrary, if an sdist package is present and a wheel is not present, it tries to compile the sdist. But if so, the C Extension must be optional by default, or if the sdist install fails, no module will be installed.

This is much more simple for the end user, and a bit more complicated for devs. But I'm confident that devs are much more expert and it's quite trivial for them to add an env variable. I have to do the same on Conda.

Anyway, I could change how CIBUILDWHEEL works now. If 1, the Extension will be added as mandatory. If zero, the module will be compiled with no extension. If None, the above default behavior acts (Ext enabled but optional).

from python-frozendict.

mgorny avatar mgorny commented on June 12, 2024

I think something akin #69 is the best option where the user (or packager) can easily say "I want the C extension if it's supported on my interpreter" and the package takes care of "knowing" which Python versions are supported and which are not.

from python-frozendict.

Marco-Sulla avatar Marco-Sulla commented on June 12, 2024

#69 is not about this, but it's a good solution for your case, since it checks if a dir with C source files exists. If not, the py wheel is produced.

Since no src dir exists for Python 3.11, the PR will enable for 3.11 the py package by default.

This has also a side benefit to have a pure py package on Conda without trouble.

I'll accept the PR.

from python-frozendict.

mgorny avatar mgorny commented on June 12, 2024

Thank you.

from python-frozendict.

Marco-Sulla avatar Marco-Sulla commented on June 12, 2024

Released in 2.3.6, let me know if it's all OK.

from python-frozendict.

mgorny avatar mgorny commented on June 12, 2024

Thanks, it seems to work fine for us!

from python-frozendict.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.