-
Notifications
You must be signed in to change notification settings - Fork 0
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
Build wheel with pip if build is not available #323
base: main
Are you sure you want to change the base?
Conversation
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
@doctrino what do you think of this? Meant as an idea. If you agree I can extend to a complete PR. |
if "build" in sys.modules: | ||
ProjectBuilder(build_dir).build(distribution="wheel", output_directory=str(output_dir)) | ||
else: | ||
subprocess.run([sys.executable, '-m', 'pip', 'wheel', '--no-deps', '--no-build-isolation', '-w', output_dir, build_dir], check=True) |
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.
--no-build-isolation
wil make this work even when the user has no internet connection
Hmm, a few questions: Is there a particular use case for it? Or more a slight convenience to not have to run It is not necessary, I am happy to approve it either way, but it is always good to ensure we are not adding more code just in case as maintenance is always an issue. |
I have first-hand experience with CDF being used in enterprise environments where PyPi is blocked (together with much of the internet), and where there might be some approval process for the packages you want to install or some other unconventient process to get new Python packages into the enterprise environment. |
The difference between the options as I see it are:
|
Got it, that is a good use case, go for it. |
Description
Make the build wheel function work even if the user forgot to install the 'cli' dependencies. The only assumption is that the user has a reasonably new version of pip installed, which will be the case almost always.
Another solution could be to include 'build' as part of the non-optional dependencies.
Checklist:
python dev.py bump --patch
(replace--patch
with--minor
or--major
per semantic versioning).export PYTHONPATH=. && python dev.py generate
. Need to be run bothfor
pydantic
v1
andv2
environments.