Closed ketozhang closed 4 days ago
I have switched to using uv
(PR: https://github.com/kaxil/airflowctl/pull/39) and created 0.2.11. Let me know if you try it out
$ uv tool install airflowctl
$ airflowctl init my_airflow_project --build-start
$ ls -la my_airflow_project
total 1416
drwxr-xr-x 15 keto staff 480 Nov 18 10:28 .
drwx------ 3 keto staff 96 Nov 18 10:27 ..
drwxr-xr-x 3 keto staff 96 Nov 18 10:27 .airflowctl
-rw-r--r-- 1 keto staff 316 Nov 18 10:27 .env
-rw-r--r-- 1 keto staff 150 Nov 18 10:27 .gitignore
drwxr-xr-x 9 keto staff 288 Nov 18 10:27 .venv
-rw------- 1 keto staff 87628 Nov 18 10:27 airflow.cfg
-rw-r--r-- 1 keto staff 581632 Nov 18 10:28 airflow.db
drwxr-xr-x 4 keto staff 128 Nov 18 10:28 dags
drwxr-xr-x 4 keto staff 128 Nov 18 10:28 logs
drwxr-xr-x 2 keto staff 64 Nov 18 10:27 plugins
-rw-r--r-- 1 keto staff 0 Nov 18 10:27 requirements.txt
-rw-r--r-- 1 keto staff 717 Nov 18 10:27 settings.yaml
-rw------- 1 keto staff 16 Nov 18 10:27 standalone_admin_password.txt
-rw-r--r-- 1 keto staff 4762 Nov 18 10:28 webserver_config.py
That's much better. Thank you!
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
.