-
Notifications
You must be signed in to change notification settings - Fork 73
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
[charmcraft 1.3]: Cannot pack a charm with Jinja2 as dependency #551
Comments
1.3.0 no builds with --no-binary which is the most plausible root cause for this. |
|
Note that older Jinja installs ok. I opened this issue in their project. @heitorPB may you try using Jinja 2.11.3? thanks! |
Thanks for looking into that! Curiously, installing |
How did you install it? We were considering to add a new property to the charm plugin to allow installation of python packages before requirements, but maybe you found a different way to solve the issue? |
I mean, manually it works: $ virtualenv venv
created virtual environment CPython3.8.10.final.0-64 in 145ms
creator CPython3Posix(dest=/tmp/asdfasdf/venv, clear=False, global=False)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/h/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
$ source venv/bin/activate
(venv)
$ pip install --no-binary :all: markupsafe
Collecting markupsafe
Using cached MarkupSafe-2.0.1.tar.gz (18 kB)
Skipping wheel build for markupsafe, due to binaries being disabled for it.
Installing collected packages: markupsafe
Running setup.py install for markupsafe ... done
Successfully installed markupsafe-2.0.1
(venv)
$ pip install --no-binary :all: jinja2
Collecting jinja2
Using cached Jinja2-3.0.1.tar.gz (267 kB)
Requirement already satisfied: MarkupSafe>=2.0 in ./venv/lib/python3.8/site-packages (from jinja2) (2.0.1)
Skipping wheel build for jinja2, due to binaries being disabled for it.
Installing collected packages: jinja2
Running setup.py install for jinja2 ... done
Successfully installed jinja2-3.0.1
(venv)
That's already possible for "normal" packages, right? Having something similar for Python sounds awkward to me, but if it works: it works. |
Ah, manually, ok. Our plan is to add a |
Proposed implementation in PR #553 |
This should be fixed by updating setuptools using |
@cmatsuoka and @facundobatista, what are your thoughts on always including This was not the first time I see python packages breaking because pip/setuptools are not the most recent releases... |
IIRC there were situations (in Snapcraft?) where the opposite happened and packages didn't install correctly if the tools are newer than expected. The virtual environment is created with the Python interpreter from the base (the same that will be used at runtime) so the default tools would keep everything consistent. We could do some magic to check if the version needs update, but we're trying to avoid having too much magic happening behind the scenes in order to let the developer understand what's happening during the packing process. If the outdated setuptools problem starts to happen with other packages or if we notice that it's too much of an annoyance we can pursue some other solution. @facundobatista btw |
Jinja2 requires a very up to date setuptools package, that must be available before starting the charm build container. See canonical/charmcraft#551
New minor release of charmcraft requires us to change the code, as it introduced a breaking change. This patch adds git and updates setuptools before packing the charm. See canonical/charmcraft#551 for discussion
New minor release of charmcraft requires us to change the code, as it introduced a breaking change. This patch adds git and updates setuptools before packing the charm. See canonical/charmcraft#551 for discussion
Charmcraft 1.3 fails to pack our slurmd charm. Reverting to 1.2 works again.
Here's part of the log:
The text was updated successfully, but these errors were encountered: