-
-
Notifications
You must be signed in to change notification settings - Fork 947
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
Adopt pep517 + try compile with cython #1709
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1709 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 63 63
Lines 6610 6610
Branches 1067 1067
=========================================
Hits 6610 6610 Continue to review full report at Codecov.
|
@vytas7 @kgriffs I'm not sure how we could test how robust is this solution. From experience in sqlalchemy, pep517 is still not very stable right now, and numerous install issues have surfaced once the pyproject.toml was included in the distribution. |
I tend to agree it is probably worth explicitly removing Note that people installing straight from GitHub (either directly with |
@CaselIT just checking if you are determined to continue this endeavour, or should we just create a new PR to remove |
Yes we could continue this endeavor, I mean it's all a lot less relevant now since we ship wheels. but I guess sooner or later pip will start complaining that the install is not pep517 compliant |
If we are going to circle back on this post-3.0 do we want to remove |
I think that it may be a great idea for now, until we figure a stable implementation for pep517 On sqlalchemy side we have had no problems since we removed it from the pypi package via the manifest file |
shall we resurrect this one? |
I'm absolutely for it, but the question is whether there is an easy way to do this...
Some packages opt to ship |
this should work in any case. note that since we have a pyproject.toml file we are actually already using pep517 in legacy mode
we could add an env variable, like sqlalchemy. I don't think pip accepts arguments that can be passed down on install.
sure, it's already what this does, if it fails it falls back to the pure python install.
using pep517 that's not needed, since we can list cython as a build time requirement so it's always available when installing |
Updated |
Could you try to install falcon using this branch to see if some issues came up in some cases?
of without cython
|
run_setup(False) | ||
|
||
status_msgs( | ||
'Cython compilation could not be completed, speedups are not enabled.', |
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.
Wouldn't this message be repeated twice in the case pure Python build succeeds?
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.
Consider that this is only visible if the verbose flag is passed (aka almost no-one)
This is what is printed:
building 'falcon.api_helpers' extension
***************************************************************************
Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Cython compilation could not be completed, speedups are not enabled.
Failure information, if any, is above.
Retrying the build without the C extension now.
***************************************************************************
running develop
running egg_info
writing falcon.egg-info\PKG-INFO
writing dependency_links to falcon.egg-info\dependency_links.txt
writing entry points to falcon.egg-info\entry_points.txt
writing top-level names to falcon.egg-info\top_level.txt
warning: the 'license_file' option is deprecated, use 'license_files' instead
adding license file 'LICENSE' (matched pattern 'LICENSE')
reading manifest file 'falcon.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'falcon.egg-info\SOURCES.txt'
running build_ext
Creating c:\users\cfede\miniconda3\envs\falcon\lib\site-packages\falcon.egg-link (link to .)
Adding falcon 3.0.2.dev1 to easy-install.pth file
Installing falcon-bench-script.py script to C:\Users\cfede\miniconda3\envs\falcon\Scripts
Installing falcon-bench.exe script to C:\Users\cfede\miniconda3\envs\falcon\Scripts
Installing falcon-inspect-app-script.py script to C:\Users\cfede\miniconda3\envs\falcon\Scripts
Installing falcon-inspect-app.exe script to C:\Users\cfede\miniconda3\envs\falcon\Scripts
Installing falcon-print-routes-script.py script to C:\Users\cfede\miniconda3\envs\falcon\Scripts
Installing falcon-print-routes.exe script to C:\Users\cfede\miniconda3\envs\falcon\Scripts
Installed c:\users\cfede\dev\github\falcon
***************************************************************************
Cython compilation could not be completed, speedups are not enabled.
Pure-Python build succeeded.
***************************************************************************
Successfully installed falcon
I think in makes sense, maybe we could invert the working:
Pure-Python build succeeded.
Cython compilation could not be completed, speedups are not enabled.
@@ -15,6 +15,7 @@ jobs: | |||
# four jobs are defined make-wheel-win-osx, make-wheel-linux, make-source-dist and make-emulated-wheels | |||
# the wheels jobs do the the same steps, but linux wheels need to be build to target manylinux | |||
make-wheel-win-osx: | |||
needs: make-source-dist |
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've added a needs, since in the source dist we verify that the version is correct
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 looks good, well done. But I'm yet to test various scenarios myself.
I've tried to install in docker on
and I did not have issues, both with or without c compiler |
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 works well on every platform I've tested: PyPy3, Pyston, various odd CPython 3.5 combinations, 3.10.0b1 in Docker.
LGTM 💯
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.
Just a couple of nits and this is good to go IMO. Nice work, esp. considering how poor the pep517 docs are.
@kgriffs updated. |
Thanks for the documentation fixes @kgriffs |
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 think this is ready to rock. ⚡
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.
🤘
Summary of Changes
This is just a WIP POC to see if something like this could work.
setuy.py
has been updated to try to compile using cython and then falling back to a normal install.This logic is based mostly on SQLAlchemy
setup.py
How do I test it
See: #1709 (comment)
Related Issues
#1683
Changes:
--no-use-pep517
from readme