-
-
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
Require cython when building from git clone only #3189
Changes from 1 commit
33d8a7b
ee4ebf9
bb04d42
c6f015f
f05f688
a1342c2
21b2e8f
fc9f4eb
f6d1052
f856d64
6a1a1c2
d7b67e7
189186e
01a98e6
c874bc7
86479c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,13 +12,27 @@ | |
if sys.version_info < (3, 5, 3): | ||
raise RuntimeError("aiohttp 3.x requires Python 3.5.3+") | ||
|
||
here = pathlib.Path(__file__).parent | ||
|
||
try: | ||
from Cython.Build import cythonize | ||
USE_CYTHON = True | ||
except ImportError: | ||
USE_CYTHON = False | ||
|
||
if (here / '.git').exists() and not USE_CYTHON: | ||
print("Install cython when building from git clone") | ||
print("pip install cython") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add this to |
||
sys.exit(1) | ||
|
||
|
||
if (here / '.git').exists() and not (here / 'vendor/http-parser/README.md'): | ||
print("Install submodules when building from git clone") | ||
print("git submodule init") | ||
print("git submodule update") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's simpler to do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, how about to do that automagically if condition is met? Since we know which commands are need to run. Suddenly, it wouldn't be useful for Cython - setup_requires can't handle wheels /: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is for dev module only. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, that's fine for me. |
||
sys.exit(2) | ||
|
||
|
||
ext = '.pyx' if USE_CYTHON else '.c' | ||
|
||
|
||
|
@@ -62,7 +76,6 @@ def build_extension(self, ext): | |
raise BuildFailed() | ||
|
||
|
||
here = pathlib.Path(__file__).parent | ||
|
||
txt = (here / 'aiohttp' / '__init__.py').read_text('utf-8') | ||
try: | ||
|
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.
Please use stderr
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.
Good catch