-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Bundle command implementation #2682
Conversation
e991f59
to
cd16e9d
Compare
I feel like we are re-implementing a fair amount of logic here wrt building, env management, and installation. I am not a 100% sure if it is out of necessity (haven't looked at the code changes in detail yet). With the creation of the Overall I am a bit weary of this functionality, while useful, introduces a fair amount of fragility. |
I don't understand. This command does not re-implement anything but uses existing modules (env management, building and installation) in a specific way, i.e. to bundle the project and its dependencies in a "portable" way. The purpose of the |
I haven't looked thru the implementation in detail - but is the goal to achieve something like what shiv is doing ? I've been using poetry build + shiv to produce a deployable artifact. Great if this can all be done thru poetry. I guess the key difference is that Shiv is also packing things into an executable .zip ( .pyz ), but otherwise the packaging of dependencies looks pretty similar. |
docs/docs/cli.md
Outdated
If the virtual environment already exists, two things can happen: | ||
|
||
- **The python version of the virtual environment is the same as the main one**: the dependencies will be synced (updated or removed). | ||
- **The python version of the virtual environment is different**: the virtual environment will be recreated from scratched. |
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.
scratch ?
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 haven't looked thru the implementation in detail - but is the goal to achieve something like what shiv is doing ? I've been using poetry build + shiv to produce a deployable artifact. Great if this can all be done thru poetry. I guess the key difference is that Shiv is also packing things into an executable .zip ( .pyz ), but otherwise the packaging of dependencies looks pretty similar.
@Imaclean74 any chance you can provide more details on this?
+1, just to contribute to the conversation. This feature is a must for FaaS scenarios such as AWS lambda, where we need to deploy a fully contained app, with all the dependencies @abn @sdispater |
docs/docs/cli.md
Outdated
If the virtual environment already exists, two things can happen: | ||
|
||
- **The python version of the virtual environment is the same as the main one**: the dependencies will be synced (updated or removed). | ||
- **The python version of the virtual environment is different**: the virtual environment will be recreated from scratched. |
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.
scratch
- **The python version of the virtual environment is different**: the virtual environment will be recreated from scratched. | |
- **The python version of the virtual environment is different**: the virtual environment will be recreated from scratch. |
@sdispater with all the things going on around venv/zipapp/wheelhouse etc; I think I need to revisit my stance on this. I think I am amenable to this top-level command being introduced to Moving this to draft for now in order verify things are still up-to-date. Will review once rebased and marked as ready again. |
+1 on the zipapp bundler. Done right - it would remove the need to use a separate tool like shiv or pex |
It's possible to clone the workings of the |
cd16e9d
to
d020c19
Compare
Closing in favor of an official plugin (https://github.com/python-poetry/poetry-bundle-plugin) which will be made extensible so that users can add their own bundlers to the command. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR adds a new
bundle venv
command as discussed initially in #537 and formalized in #1992.Basically, this command creates a virtual environment in the given directory and install the dependencies of the project and the project itself inside it.
Pull Request Check List
Resolves: #537
Resolves: #1992