Skip to content
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

Allow editable installs of dev Python packages #7097

Merged
merged 2 commits into from
May 21, 2021

Conversation

jen20
Copy link
Contributor

@jen20 jen20 commented May 20, 2021

Description

This commit adds a fallback for the README definition in the generated setup.py files for Python SDKs, thus allowing editable installs of packages which not yet been built.

Checklist

  • I have added tests that prove my fix is effective or that my feature works

Codegen tests do not appear to test setup.py generation.

This commit adds a fallback for the README definition in the generated
setup.py files for Python SDKs, thus allowing editable installs of
packages which not yet been built.
@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@jaxxstorm
Copy link
Contributor

/run-acceptance-tests

@github-actions
Copy link

Please view the results of the PR Build + Acceptance Tests Run Here

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

Copy link
Member

@lukehoban lukehoban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself LGTM.

Is this the only issue that currently prevents the source Python package from being installed?

@lukehoban lukehoban merged commit 64f4a22 into pulumi:master May 21, 2021
@jen20
Copy link
Contributor Author

jen20 commented May 21, 2021

@lukehoban Yes - the missing README gave an ENOENT and fails when trying to install the package from source in place (useful for examples in a component monorepo etc), so adding an obviously-fake README seems like the best fallback (rather than encoding path information to read from the repository root, or copying the top-level README during generation). There's a second issue which I'll follow up with relating to the version placeholder, but that actually does not block installation.

@jen20 jen20 deleted the jen20/editable-installs-python branch May 21, 2021 14:52
bors bot added a commit that referenced this pull request Oct 1, 2022
10894: [sdk/python] Allow editable installs without build step r=justinvp a=justinvp

This commit modifies `setup.py` to use a Python variable as the source of the package version instead of a placeholder string and adds a fallback for the README definition. This makes the package installable via the `-e` flag directly from its source directory (`sdk/python/lib`), rather than having a build step and having to `-e` install the built directory (`sdk/python/env/src`).

This is equivalent to some changes we've made in our generated Python provider SDKs (#7097 and #7479), making the core SDK consistent with those.

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants