Skip to content

Fallback to Pure Python if Compilation fails#76

Merged
sigmavirus24 merged 1 commit into
yaml:masterfrom
dstufft:robust-setup-py
Sep 12, 2017
Merged

Fallback to Pure Python if Compilation fails#76
sigmavirus24 merged 1 commit into
yaml:masterfrom
dstufft:robust-setup-py

Conversation

@dstufft
Copy link
Copy Markdown
Contributor

@dstufft dstufft commented Sep 8, 2017

Originally this code attempted to determine if compiling the C ext
would succeed, and if it thought it should, it would then require that
the C extension succeed in order to install. This fails in cases where
the detection code passes, but compiling ultimately fails (one instance
this might happen is if the Python headers are not installed).

Instead of "asking permission", this code will now just attempt to
compile the module, and will fall back to pure Python if that fails,
unless the person has explicitly asked for the C module, in which case
it will still just fail.

Originally this code attempted to determine if compiling the C ext
would succeed, and if it thought it should, it would then require that
the C extension succeed in order to install. This fails in cases where
the detection code passes, but compiling ultimately fails (one instance
this might happen is if the Python headers are not installed).

Instead of "asking permission", this code will now just attempt to
compile the module, and will fall back to pure Python if that fails,
unless the person has explicitly asked for the C module, in which case
it will still just fail.
Copy link
Copy Markdown

@JordonPhillips JordonPhillips left a comment

Choose a reason for hiding this comment

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

Looks good to me. This is more or less what other libraries do, such as ruamel.yaml.

@sigmavirus24
Copy link
Copy Markdown
Contributor

sigmavirus24 commented Sep 9, 2017

Less code is always better :D 👍

@sigmavirus24 sigmavirus24 merged commit 298e079 into yaml:master Sep 12, 2017
@wollerman
Copy link
Copy Markdown

@sigmavirus24 is there going to be a release with these changes? 3.12 was released August 2016 and these changes are from September 2017. I was hoping to take advantage of the update :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants