-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Install main dependency group only by default #182
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
base: main
Are you sure you want to change the base?
feat: Install main dependency group only by default #182
Conversation
|
* Choose additionnal dependency groups to install via BP_POETRY_INSTALL_WITH env variable
ca25f4c to
be22893
Compare
|
Thanks @Mehdi-H - could you sign the CLA? The bot above has a link. You can either sign as an individual or as part of a corporate CLA. |
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.
Thank you for submitting this! This generally looks good. I have a few comments/suggestions/questions inline, and once we address those I think we'll be good to merge this.
| SetDefaultEventuallyTimeout(30 * time.Second) | ||
|
|
||
| suite := spec.New("Integration", spec.Report(report.Terminal{})) | ||
| suite("Default", testDefault, spec.Parallel()) |
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 see we removed the spec.Parallel() - was that intentional? Did you observe the tests failing with that present?
| MatchRegexp(fmt.Sprintf( | ||
| " Running 'POETRY_CACHE_DIR=/layers/%s/cache POETRY_VIRTUALENVS_PATH=/layers/%s/poetry-venv poetry install --with dev'", | ||
| strings.ReplaceAll(buildpackInfo.Buildpack.ID, "/", "_"), | ||
| strings.ReplaceAll(buildpackInfo.Buildpack.ID, "/", "_"), |
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 don't think we need this strings.ReplaceAll twice - the second invocation should be redundant.
| MatchRegexp(fmt.Sprintf(` PATH -> "/layers/%s/poetry-venv/default-app-.*-py\d+\.\d+/bin:\$PATH"`, strings.ReplaceAll(buildpackInfo.Buildpack.ID, "/", "_"))), | ||
| MatchRegexp(fmt.Sprintf(` POETRY_VIRTUALENVS_PATH -> "/layers/%s/poetry-venv"`, strings.ReplaceAll(buildpackInfo.Buildpack.ID, "/", "_"))), | ||
| MatchRegexp(fmt.Sprintf(` PYTHONPATH -> "/layers/%s/poetry-venv/default-app-.*-py\d+\.\d+/lib/python\d+\.\d+/site-packages:\$PYTHONPATH"`, strings.ReplaceAll(buildpackInfo.Buildpack.ID, "/", "_"))), | ||
| "", |
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.
Can you remove the "" and replace it with another invocation of Expect(logs).To(ContainLines(...))?
We've found that asserting on empty log lines is brittle, because sometimes extra lines get inserted due to environment issues (deprecation warnings, etc).
A second invocation of ContainLines() will continue to preserve the assertions on the line ordering.
| // check an SBOM file to make sure it has an entry for a poetry dependency | ||
| contents, err := os.ReadFile(filepath.Join(sbomDir, "sbom", "launch", strings.ReplaceAll(buildpackInfo.Buildpack.ID, "/", "_"), "poetry-venv", "sbom.cdx.json")) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| Expect(string(contents)).To(ContainSubstring(`"name": "flask"`)) |
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.
For this test, could you also add the environment variable: WithEnv(map[string]string{"BP_POETRY_INSTALL_WITH": "dev"}). and could you also add an assertion that the SBOM contains a dev dependency?
Similarly, could you add an assertion to the default_test to assert that the SBOM does not contain a dev dependency?
|
Also, as discussed in #180 - although this is technically a breaking change, I don't think it will break any users in practice, as I don't believe users are expecting their apps to contain dependencies other than the As such, I'm labeling this as: |
|
@Mehdi-H as far as the CLA, I think part of the issue is that your commit was made from an email that isn't associated with your github account. The links in the CLA bot's comment above should help. |
|
Hi @Mehdi-H @robdimsdale , We would like to see this issue fixed as well. I think Mehdi has done all of the heavy lifting here but this PR seems to have fallen off. Would y'all have any objections if I picked it up and finished it? Here is a draft PR with all the review comments addressed. It passes unit and integration tests. Thank you, |
|
Hi @Mehdi-H @robdimsdale any progress on this one? |
Summary
This PR is linked to #180
pyproject.tomlBP_POETRY_INSTALL_WITH, mirroring the--withoption frompoetry install commandREADME.mdis updated to describe this new behaviorsUse Cases
Check #180 discussion for more details
Checklist