airflowctl is affected by the chicken-and-egg problem of Python version. No surprisingly it has the same burden as other Python environment & project managers (e.g., hatch, pipx, pyenv) :
If we start with pip, the version used in airflowctl built must match the same version as your pip environment:
Otherwise pyenv is invoked to get the correct python version (forcing users to use a specific version manager).
The above is the ideal instruction if we're going to use pip. With the current instructions, you can run into a lot of issues if you have one of these situation:
--python-version is not the same as the version used in pip install airflowctl
--python-version is not specified
pyenv is not available
python is a different version than the one installed with pip. For example:
In a broken environment where python and pip are related
User later on upgraded Python and did not reinstall airflowctl.
Here are my suggestions:
Installation instructions should remove pip as the primary method.
Ideally, airflowctl behaviors should not depend on the Python version it is installed to.
airflowctl build should fail if python_version does not exist in $PATH. Error message should ask users to have the correct Python version.
Alternatively, users can override which Python path to build the virtual environment with.
Provide a Python-agnostic installation method (e.g., brew, apt, yum, winget, choco, etc.)
Alternatively, although a bigger rewrite, switch to using hatch or rye.
airflowctl is affected by the chicken-and-egg problem of Python version. No surprisingly it has the same burden as other Python environment & project managers (e.g.,
hatch
,pipx
,pyenv
) :If we start with
pip
, the version used in airflowctl built must match the same version as your pip environment:Otherwise
pyenv
is invoked to get the correct python version (forcing users to use a specific version manager).The above is the ideal instruction if we're going to use
pip
. With the current instructions, you can run into a lot of issues if you have one of these situation:--python-version
is not the same as the version used inpip install airflowctl
--python-version
is not specifiedpyenv
is not availablepython
is a different version than the one installed withpip
. For example:python
andpip
are relatedairflowctl
.Here are my suggestions:
pip
as the primary method.airflowctl
behaviors should not depend on the Python version it is installed to.airflowctl build
should fail ifpython_version
does not exist in$PATH
. Error message should ask users to have the correct Python version.brew
,apt
,yum
,winget
,choco
, etc.)Alternatively, although a bigger rewrite, switch to using
hatch
orrye
.