Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise error if mpas_analysis is installed in different worktree #1057

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Feb 3, 2025

Checklist

  • Testing comment in the PR documents testing used to verify the changes

@xylar xylar self-assigned this Feb 3, 2025
@xylar
Copy link
Collaborator Author

xylar commented Feb 3, 2025

Testing

I ran mpas_analysis --help in the "correct" directory worktree and everything works as normal. I then ran mpas_analysis --help in the "wrong" worktree and I see:

Traceback (most recent call last):
  File "/gpfs/fs1/home/ac.xylar/chrysalis/miniforge3/envs/mpas_dev/bin/mpas_analysis", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/gpfs/fs1/home/ac.xylar/mpas_work/MPAS-Analysis/add-wrong-worktree-error/mpas_analysis/__main__.py", line 981, in main
    but the package is installed in editable mode in a different directory.
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
            description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
            ^^^^^
OSError: 
The current working directory is the base of an mpas_analysis git branch,
but the package is installed in editable mode in a different directory.
Please reinstall mpas_analysis in editable mode using:
    python -m pip install --no-deps --no-build-isolation -e .

as expected.

@xylar xylar merged commit 24058d9 into MPAS-Dev:develop Feb 3, 2025
5 checks passed
@xylar xylar deleted the add-wrong-worktree-error branch February 3, 2025 23:07
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.

1 participant