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

More robust check of bash version #2639

Conversation

koliyo
Copy link

@koliyo koliyo commented Nov 29, 2023

More robust check of bash version.

Specifically on windows with git-bash, where python is the normal windows python install

Also use --norc flag to avoid recursively loading .bashrc (which can happen when the click completion loading does not work properly)

Testing should not require any additional tests, but rather make sure to run the existing shell completion tests on multiple platforms, eg Linux, Mac, Windows. Or how do you otherwise recommend adding tests for this?

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@koliyo
Copy link
Author

koliyo commented Dec 19, 2023

Would appreciate some feedback if this is not considered completed. As mentioned, automated testing of this is very context specific, so not sure how, or if, this should be added.

Regarding tox test, tox actually fails locally on my mac, but in a completely unrelated section. NOTE: this also fails in main!

typing: commands[0]> mypy
src/click/utils.py:492: error: Statement is unreachable  [unreachable]
        return os.path.join(
        ^
src/click/_termui_impl.py:616: error: Statement is unreachable  [unreachable]
        try:
        ^
Found 2 errors in 2 files (checked 16 source files)
typing: exit 1 (19.01 seconds) /Users/nils/Work/misc/click> mypy pid=19222
typing: FAIL ✖ in 24.66 seconds

My branch has the same test result as main.

@aenglander aenglander added this to the 8.1.8 milestone May 21, 2024
koliyo and others added 5 commits November 9, 2024 21:53
Specifically on windows with git-bash, where python is the normal windows python install

Also use `--norc` flag to avoid recursively loading .bashrc (which can happen when the click completion loading does not work properly)
@AndreasBackx AndreasBackx force-pushed the feature/more-robust-bash-version-check-for-windows branch from db0a63f to c36f7bb Compare November 9, 2024 21:54
@AndreasBackx AndreasBackx changed the base branch from main to stable November 9, 2024 21:55
@AndreasBackx AndreasBackx force-pushed the feature/more-robust-bash-version-check-for-windows branch from eb00003 to 6b18fec Compare November 9, 2024 21:55
@AndreasBackx AndreasBackx mentioned this pull request Nov 9, 2024
9 tasks
@AndreasBackx AndreasBackx merged commit 273fb90 into pallets:stable Nov 9, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shell completion bash version check fail in git-bash on windows
3 participants