-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build without cython (#3162) #3164
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also might want to have some test for this (missing deps).
@@ -57,7 +57,7 @@ def run(self): | |||
def build_extension(self, ext): | |||
try: | |||
build_ext.build_extension(self, ext) | |||
except (DistutilsExecError, | |||
except (CCompilerError, DistutilsExecError, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a workaround. We need a real fix, finding out why the file is missing or having a clear explanation of why this is happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanation is easy - build process relied on assumption that if we have no cython, than we will have compiler error and ignore extensions bundling. Later runtime will work with pure python implementations. This file is missing because cython is not available during build. So I can not understand what do you mean by real fix
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more note: I just reintroduced the way how it worked before and was broken in 28f1519, as I mentioned in the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, it might make sense. Let's wait for @asvetlov.
P.S. I still want to see this tested in CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And while you're on it you might want to extend docs to mention how things work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll require adding env combos to Travis CI as mandatory anyway.
@asvetlov mentioned that this is the bad idea, because it will increase even more the testing time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, just add it and then I'll make sure that it doesn't hit performance. I'll basically do to it what I did to OS X and it'll be a fine compromise: running those only on cron as opposed to having them in each build. Andrew trusts me to handle CI.
P.S. If we recognize that we need it on each commit we could always move it to another CI service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remark: while working on changing setup.py
it might be worth adding some env var for toggling strict mode for dev.
It could be smth like:
import os
...
class ve_build_ext(build_ext):
...
def build_extension(self, ext):
valid_build_exceptions = {CCompilerError, DistutilsExecError, DistutilsPlatformError, ValueError}
suppressed_build_exceptions = set()
if os.getenv('AIOHTTP_DEV_MODE'):
suppressed_build_exceptions = {CCompilerError, DistutilsExecError, DistutilsPlatformError}
try:
build_ext.build_extension(self, ext)
except tuple(valid_build_exceptions - suppressed_build_exceptions) as build_exc:
raise BuildFailed() from build_exc
cc: @asvetlov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's what I planned to implement.
Codecov Report
@@ Coverage Diff @@
## master #3164 +/- ##
=======================================
Coverage 98.09% 98.09%
=======================================
Files 43 43
Lines 7833 7833
Branches 1351 1351
=======================================
Hits 7684 7684
Misses 57 57
Partials 92 92 Continue to review full report at Codecov.
|
@@ -57,7 +57,7 @@ def run(self): | |||
def build_extension(self, ext): | |||
try: | |||
build_ext.build_extension(self, ext) | |||
except (DistutilsExecError, | |||
except (CCompilerError, DistutilsExecError, | |||
DistutilsPlatformError, ValueError): | |||
raise BuildFailed() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also useful to add from original_exception
part.
Superseded by #3189 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
What do these changes do?
Fixes build/install without cython
Are there changes in behavior for the user?
Nope
Related issue number
#3162
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.