-
Notifications
You must be signed in to change notification settings - Fork 139
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
Update Poetry build system & normalise on Python 3.11 #2703
Comments
The relevant file in this case is our build.sh however we also need to address a similar install instantiated in our scriptlets of the rockstor-rpmbuild repository: |
To avoid excessively long package updates, where we already (necessarily) wipe and rebuild our .venv, it is proposed that we try to read the current version of Poetry installed; and if this is 1.1.15 (the only version employed to date) we do the uninstall re-install to presumably latest. Our current Python 3.9 should support this and we will likely be at 3.10 min by that time anyway give the associated/related Milestone: https://github.com/rockstor/rockstor-core/milestone/25 |
In both build.sh: Line 13 in 75d7cf6
and within our %build rpmbuild scriptlet: We install poetry using the default Python3, which on Leap is 3.6.15: lbuildvm:~ # python3 --version But on tumbleweed this varies, but has been at 3.11 for some time now: twbuildvm:~ # python3 --version As a consequence of this, it is proposed that we standardise on the version used during the poerty install itself, as per our python version specification in pyproject.toml for all other dependencies. This way we can hopefully avoid breakages such as we have already observed here re TW's default Python updating breaking our Poetry install itself, and thus creating a blocker on our ability to build installers from then on. |
We need also to update the following within our pyproject.toml: Lines 1 to 3 in 75d7cf6
To whatever the equivalent is for our chosen Poetry version. |
From: https://python-poetry.org/docs/#system-requirements
for the current 1.7.1 version. |
If we install poetry under Py3.11 we get the following when doing a
However if we try to also align our pyproject.toml with the venv python we installed under (3.11) Poetry fails re futures:
suggesting we have some mixed python version issue here when we use the same Python version within our .venv as Poetry was installed under !! |
Reverting pyproject to our existing Py3.9 and we have a successful .venv install again:
|
If alternatively we install Poetry latest using the OS default Python 3.6.15 we get:
where:
As latest Poetry requires at least Py3.8, we have Py3.6 (OS default) and Py3.10 from prior install, and trying to use Py3.11 for both Poetry and rockstor-core. |
The above failure re moving to Py3.11 along with Poetry looks to be realated to our likely Py3.6 compatible venv:
I.e.:
Experimenting with:
The OS python311-virtualenv is a red-herring as Poetry builds it's own venv containing, with Python3.11 as installer:
|
Installing the last major Poetry version update of 1.6.1 under Py3.11:
with our pyproject.toml set also to py3.11 and we get the same issue:
with:
|
Installing under our current Py3.9 via:
and we have the same virtualenv
But we now have functioning
and:
But not ideal to have to hand-on to Py3.9 just for Poetry official installer. @FroggyFlox has had more promising success with using alternative Poetry install methods: more to follow. |
Given the difficulties above and @FroggyFlox more promising approach re pip installed Poetry (under Py3.11 venv) I'm now looking to use python3.11 pipx to install Poetry (globally) via the distro provided And Poetry's own: https://python-poetry.org/docs/#installing-with-pipx Instructions
|
OS native python 3.11 pipx package Leap 15.5:
|
PIPX, os package supplied, is managed by alternatives:
And we can then install via:
In the above under-test scenario we are looking to avoid the home defaults with a view to issue: The above install results in:
Where this script entry point for Poetry is as follows:
And the python binary in that case is:
|
We have the following incidental update:
|
Uninstall prior Poetry 1.1.15, if found, using official installer script, and install 1.7.1 using Python 3.11 and OS pipx package: `build.sh`. ## Includes: - New Poetry install location: `/root/.local/bin` to `/usr/local/bin` - Update rockstor.service & rockstor-pre.service Poetry path. - Python 3.9 to Python 3.11 in pyproject.toml. - Refreshed poetry.lock created using Poetry 1.7.1. - Incidental update of setuptools (68.2.2 -> 69.0.2). - Incidental clarification re developer instructions in build.sh. - .gitignore addition re poetry-installer-error logs.
Closing as: |
We currently still depend upon a now outdated Poetry version of 1.1.15: employed to transition us from our prior Py2.7 to our current Py3.9. But now that we are well under-way with our Py3.9 dependency update we can move to updating our Poetry to re-enable our Tumbleweed install build capability: there exists an incompatibility with installing (but not using) Poetry that break new installer builds that should be addressed by this issue.
A significant element in addressing this issue is that there is no update path in Poetry from 1.1.15 to 1.2.x:
https://python-poetry.org/blog/announcing-poetry-1.1.15/#compatibility-between-poetry-11-and-12
https://python-poetry.org/docs/#installation
I.e. we will likely have to remove and re-install rather than just do a
poetry self update
.The text was updated successfully, but these errors were encountered: