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

Refactor package manager handling #1640

Merged
merged 2 commits into from
Sep 24, 2024
Merged

Refactor package manager handling #1640

merged 2 commits into from
Sep 24, 2024

Conversation

edmorley
Copy link
Member

Previously, the buildpack didn't track which package manager was being used, but instead had a number of fragile file presence checks and env vars like SKIP_PIP_INSTALL scattered throughout (which won't work when the package manager isn't a binary choice).

As such, package manager handling has been refactored to allow for more easily adding Poetry support later.

This also continues the gradual migration of code from sourced bin/steps/ scripts, to functions declared in lib/. As part of this, I've started namespacing the lib functions using the module::fn_name() pattern described in:
https://google.github.io/styleguide/shellguide.html#function-names

On the most part I've tried to keep this refactoring a no-op (aside from fixes for a few quirks/bugs found whilst working on this). Longer term we will be deprecating/sunsetting several features, such as the setup.py fallback, using Pipenv without a lockfile, and support for apps that have ended up with the files for multiple package managers.

Prep for #796 / #932.

GUS-W-16811078.

Previously, the buildpack didn't track which package manager was being
used, but instead had a number of fragile file presence checks and env
vars like `SKIP_PIP_INSTALL` scattered throughout (which won't work
when the package manager isn't a binary choice).

As such, package manager handling has been refactored to allow for more
easily adding Poetry support later.

This also continues the gradual migration of code from sourced
`bin/steps/` scripts, to functions declared in `lib/`. As part of this,
I've started namespacing the lib functions using the `module::fn_name()`
pattern described in:
https://google.github.io/styleguide/shellguide.html#function-names

On the most part I've tried to keep this refactoring a no-op (aside from
fixes for a few quirks/bugs found whilst working on this). Longer term
we will be deprecating/sunsetting several features, such as the
`setup.py` fallback, using Pipenv without a lockfile, and support for
apps that have ended up with the files for multiple package managers.

GUS-W-16811078.
@edmorley edmorley self-assigned this Sep 24, 2024
@edmorley edmorley marked this pull request as ready for review September 24, 2024 12:50
@edmorley edmorley requested a review from a team as a code owner September 24, 2024 12:50
Copy link

@colincasey colincasey left a comment

Choose a reason for hiding this comment

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

Looks okay to me @edmorley. Just had a couple of minor comments for you to respond to.

lib/package_manager.sh Show resolved Hide resolved
bin/steps/python Show resolved Hide resolved
@edmorley edmorley enabled auto-merge (squash) September 24, 2024 15:40
@edmorley edmorley merged commit 8b00114 into main Sep 24, 2024
9 checks passed
@edmorley edmorley deleted the package-manager-refactor branch September 24, 2024 15:42
@heroku-linguist heroku-linguist bot mentioned this pull request Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants