Fix click compatibility and update python support#92
Merged
Conversation
From click 8.3.0 flag_value is set as a sentinel value UNSET instead of None, and since we maintain a PluggableCommanLineOption subclass, we need to maintain the same default values for an Option to avoid issues. Reference: https://github.com/pallets/click/releases/tag/8.3.0 Reference: aboutcode-org/scancode-toolkit#4572 Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
This removes a warning seen in initial virtualenv configuration. Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
9bfd0f3 to
a4f89a1
Compare
Reference: aboutcode-org/scancode-toolkit#4369 Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Remove special file '6-FIFOTYPE' from types.tar to fix test failure as in py3.14 tarfiles extraction fails with tarfile.SpecialFileError for special files. Reference: #88 Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
woakas
pushed a commit
to ubidots/ubidots-cli
that referenced
this pull request
Mar 18, 2026
This PR fixes the compatibility issue with Click 8.3.0. ## Summary Click 8.3.0 (released September 18, 2024) introduced stricter validation that rejects secondary flags (like `-p`, `-n`) on non-boolean parameters, causing the error: `TypeError: Secondary flag is not valid for non-boolean flag`. When installing the wheel in a fresh venv, pip installs the latest Click version (8.3.1), which breaks the CLI. The code was working 4 months ago with Click 8.1.8. **Solution**: Pin Click to `>=8.1.0,<8.2.0` in `pyproject.toml` to ensure compatible Click version is installed. **Why Click 8.1.x?** - ✅ Industry standard: Multiple major projects did the same - ✅ Backward compatible: Maintains the behavior from 4 months ago - ✅ Low risk: Click 8.1.8 is proven stable with Typer 0.9.x - ✅ Quick fix: No code changes needed - ✅ Future-proof: Can update code later to support Click 8.3.0+ when needed ## Source Links for Click 8.3.0 Compatibility Issues ### 1. RELION Project (Scientific Software) - **Issue**: 3dem/relion#1301 - **Title**: "Possible incompatibility between versions of typer and click in relion-5.0 conda environment" - **Date**: September 22, 2024 - **Solution**: Pinned `click<8.2.0` in environment.yml - **Key quote**: "Adding `click<8.2.0` to the environment.yml file and regenerating the conda environment fixes this." ### 2. ScanCode Toolkit - **Issue**: aboutcode-org/scancode-toolkit#4573 - **Title**: "Compatibility Issue: ScanCode fails with Click 8.3.0 - 'Secondary flag is not valid for non-boolean flag'" - **Date**: September 26, 2024 - **Solution**: Fixed in commoncode-32.4.0 release - **Fix PR**: aboutcode-org/commoncode#92 ### 3. Open-WebUI - **Issue**: open-webui/open-webui#17606 - **Title**: "0.6.30 fails to start with 'Secondary flag is not valid for non-boolean flag' error message" - **Date**: September 19, 2024 ### 4. Click Release Information - **Click 8.3.0 Release**: https://github.com/pallets/click/releases/tag/8.3.0 - **Release Date**: September 18, 2024 - **Changelog**: Shows the stricter validation changes ### 5. Click Source Code (the validation check) - **File**: https://github.com/pallets/click/blob/master/src/click/core.py - **Line 2793**: Where the error is raised: `raise TypeError("Secondary flag is not valid for non-boolean flag.")`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Do not set flag_value as None in click Option
From click 8.3.0 flag_value is set as a sentinel
value UNSET instead of None, and since we maintain a PluggableCommanLineOption subclass, we need to
maintain the same default values for an Option to
avoid issues.
Also drops python 3.9 support and adds python 3.14 support.
Reference: https://github.com/pallets/click/releases/tag/8.3.0
Reference:
clickpackage scancode-toolkit#4572