inveniosoftware / inveniosoftware/invenio-cli

Check for `pyenv` in `check-requirements -d`

Open
#294 0 comments 0 reactions 0 assignees View on GitHub
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:
![image](https://user-images.githubusercontent.com/6437519/171209473-37c2cd72-cf60-4663-ad14-100a65260ac2.png)

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.