inveniosoftware / inveniosoftware/invenio-cli
Check for `pyenv` in `check-requirements -d`
- Dominant language
- Python
- Stars
- 14
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
## Introduction
If the cookiecutter'd version of InvenioRDM specifies a different Python version than the one globally installed, `pyenv` (or `asdf` with `asdf-python`) is required to create a virtual environment with the specified Python version.
Example: The installed Python is 3.10, but the cookiecutter'd InvenioRDM instance requires 3.8:

Note: In the screenshot, `pipenv` v2022.5.2 is used.
## Problem
`pipenv` is a direct dependency of `invenio-cli` and is thus very hard to miss.
However, because`pipenv` can work without a Python version manager (i.e. `pyenv` or `asdf`) if the global Python version matches the required one from the `Pipfile`, they are not strict dependencies of `pipenv`.
Thus, `pyenv`/`asdf` are easy to miss and can lead to unexpected errors (see screenshot above).
## Describe the solution you'd like
I feel that `check-requirements --development` should check if one of the Python version managers is installed, because it's likely that the `Pipfile` requires a different Python version than the one installed globally.
## Alternatives that you've considered
We could remove the Python version requirement from the `Pipfile` in the cookiecutter, causing the instance to use whatever is installed.
However, this would give up some control over the Python version in use, and thus open up other possibilities for errors.
Contributor guide
Assessment
This issue has not been assessed yet.