Skip to content

Comments

Fix deletion of Airflow source dir in virtualenv installation script#31653

Merged
hussein-awala merged 2 commits intoapache:mainfrom
renzepost:initialize_virtualenv_airflow_sources_bug
Jun 1, 2023
Merged

Fix deletion of Airflow source dir in virtualenv installation script#31653
hussein-awala merged 2 commits intoapache:mainfrom
renzepost:initialize_virtualenv_airflow_sources_bug

Conversation

@renzepost
Copy link
Contributor

@renzepost renzepost commented May 31, 2023


I was following the contributors quick start guide and my source directory kept getting deleted when running this command:
./scripts/tools/initialize_virtualenv.py
My source directory happened to be $HOME/airflow. With this fix, at least the check if airflow_home_dir == airflow_sources works again.
^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

"""
airflow_home_dir = Path(os.environ.get("AIRFLOW_HOME", Path.home() / "airflow"))
airflow_sources = Path(__file__).parents[2]
airflow_sources = Path(__file__).resolve().parents[2]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking if airflow_sources = Path(__file__).parents[2].resolve() is better, but it probably does not matter either way sicne we control the scripts/tools directory and there’s very unlikely any non-regular entries (e.g. symlinks).

Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@hussein-awala
Copy link
Member

The failed tests are not related to this PR and they will be fixed by #31664

@hussein-awala hussein-awala merged commit 4ebf1c8 into apache:main Jun 1, 2023
@renzepost renzepost deleted the initialize_virtualenv_airflow_sources_bug branch June 1, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants