This is part of a major overhaul of the installer I hope to complete in
a relatively short time. This first pass makes sure we use consistent
directories on all platforms by preferring the documented paths to a
possibly unexpected `site.getuserbase()` (which results in a Library
path on macOS Framework builds, like Homebrew and OS-provided Pythons).
Path handling as a whole is updated to take advantage of `pathlib` and
DRY up some tedious code. It also starts the first stage of increasing
use of classes and careful thought as to the visibility of class-level
attributes in this script -- I hope to end up with a DSL-like end result
that is as informative as possible to the reader of this script.
* chore(ci): remove obsolete `code-quality` workflow
* chore(ci): test against Python 3.11
* chore(ci): use `1.1.13` for Poetry version to install
* chore(ci): bump actions
* chore(pre-commit): pin `flake8-bugbear`
* chore(pre-commit): remove unneeeded `toml` extra for `isort`
* chore(isort): remove options already in `black` profile
python[.exe], when installed via (msys) MinGW on Windows, can be found under a
path structure similar to that you might find on *nix systems.
The install-python.py script was not taking this into consideration, causing
installation failure under Windows + MinGW.
A similar fault in poetry itself was resolved with python-poetry/poetry#3713.
This resolves some code smells found during python-poetry/poetry#4773. I
have not yet added the new lints to this repo, but I once they're
relatively stable/agreed on the main repo I will PR them here.
* installer: improve error handling and logging
Co-authored-by: Bjorn Neergaard <bjorn@neersighted.com>
* installer: default to using in-built venv module
This change refactors virtual environment creation and introduces a new
wrapper to handle command execution etc. If venv module is not
available, in cases like that of the ubuntu distribution where the
module is not part of the default python install, the virtualenv
package is used by fetching the appropriate zipapp for the package for
the python runtime.
Resolves: #4089Resolves: #4093
* ci/installer: upload failure logs
* installer: preserve existing environment on failure
This change ensures that if creation of a new environment fails, any
previously existing environment is restored.
Co-authored-by: Bjorn Neergaard <bjorn@neersighted.com>
When installing Poetry through `install-poetry.py`, if `pip` is not
available, Exception should not be raised, rather installation should
be aborted with user-friendly error msg.
Fixes#4521
Co-authored-by: TurtleNishant <nishant@turtlelectric.com>
Co-authored-by: Bjorn Neergaard <bjorn@neersighted.com>