← Back to issue list

Allow for modifications to build environment of "charmcraft build" to accomodate for extra prerequisites

View original Github issue

Metadata

Project
charmcraft
Number
#696
Type
issue
State
closed
Author
Vultaire
Labels
—
Created
Updated
Closed

Current evaluation

Closed as already supported: charm-python-packages installs Python prerequisites before charm requirements. Ordering was later made explicit in Charmcraft 3.2 by PR #1727.

Resolution: closed not a bug

Reason: Maintainer facundobatista explained on 2022-03-03 that pre-requirement Python packages were already supported and linked setup guidance, so no new flag was needed. Later issue #1664 identified an ordering guarantee gap; PR #1727 (commit 51a55f73) fixed it in Charmcraft 3.2.

Evaluated by: mr-cal-bot

No scores available.

Issue body

I hit an issue with jinja2 recently while writing an operator-based charm. If I specify jinja2 as a dependency, I end up hitting a build bug since jinja2 is pulled via sources rather than via wheels. I was able to reproduce this in a normal venv, and thus suspected a jinja2 issue, filing this bug: https://github.com/pallets/jinja/issues/1610 However, the jinja2 team came back saying that the setuptools and pip I'm using are too old to work with the latest jinja2. Sure enough, when I upgraded those 2 packages first, I could install jinja2 cleanly. ...I seem to be able to work around this by using an older jinja2, but this is obviously less than ideal. Based on this experience, I'd like to suggest: can we have a flag so that we can pull and use the latest versions of setuptools/pip prior to installing the packages from requirements.txt? Or alternatively, can we allow for multiple ```pip install``` stages, allowing us to force ordering of package installs in the case of badly-behaved packages? (The latter is more just an idea; the former is the real need that I think needs to be addressed.)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug Closed as already supported: charm-python-packages installs Python prerequisites before charm requirements. Ordering was later made explicit in Charmcraft 3.2 by PR #1727.
stealth/space-bunny-alpha — closed not a bug Closed as already supported: Charmcraft’s build-packages configuration installs setuptools or pip before requirements, as confirmed by maintainer facundobatista on 2022-03-03.
qwen3.6-35b-a3b-mtp-q6 — — Closed. The requested feature already exists. Users can pre-install packages like setuptools or pip before processing requirements.txt by specifying them in the charmcraft configuration, as detailed in the linked documentation.
qwen/qwen3.6-35b-a3b — — Closed without code changes. Maintainer clarified that the requested functionality already exists by specifying prerequisite packages to install before requirements, pointing to existing documentation.
qwen3.6-35b-a3b-mtp-q6 — — Closed as already implemented. Maintainers confirmed that specifying packages to install before requirements is already supported, providing a forum link for usage. No code changes required.

Update history

No update history recorded yet.

Related work

  • Related To: jinja#1610 (confidence 100%)

    Underlying Jinja installation report cited by the reporter.

  • Related To: charmcraft#1664 (confidence 99%)

    Later tracked the missing guarantee that charm-python-packages installs before requirements.

  • Likely Fixed By: charmcraft#1727 (confidence 99%)

    Merged as commit 51a55f73, making prerequisite installation occur before requirements and charm libraries.

Related issues

Issue Project State Summary Similarity
#1664 `charm-python-packages` does not guarantee these packages are installed before packages in `requirements.txt` charmcraft closed Fixed in Charmcraft 3.2 by merged PR #1727 (commit 51a55f73), which installs charm-python-packages before requirements and charm libraries.
76%
#553 parts,charm_builder: add charm-python-packages plugin property (CRAFT-552) charmcraft merged Merged PR #553 added charm-python-packages, installing listed Python packages before requirements dependencies; implementation landed in commit 4b2d291b.
73%
#555 Charmcraft doesn't allow to pull non-published operator framework charmcraft closed Closed as a duplicate of canonical/charmcraft#498; Git-based Python requirements work when git is declared in the charm part's build-packages.
70%