Click >= 8.2 upgrade#2219
Merged
Merged
Conversation
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Flix6x
June 2, 2026 17:45
View session
Closed
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Copilot
AI
changed the title
Make CLI deprecated-option parsing compatible with Click 8.2+
Fix Python 3.10 schema MRO breakage after Click 8.2 upgrade and align changelog entries
Jun 2, 2026
Flix6x
marked this pull request as ready for review
June 2, 2026 18:58
Flix6x
approved these changes
Jun 2, 2026
nhoening
approved these changes
Jun 2, 2026
nhoening
left a comment
Member
There was a problem hiding this comment.
LGTM
Was there also the option to move to Click's own (new) option.deprecated syntax? Or does that concern something else, actually?
Member
|
This PR only avoids the naming conflict rather than rewriting the implementation to use Click’s native mechanism. Click’s built-in deprecation support is about a whole parameter/option being deprecated, not about selectively deprecating one alias spelling while retaining another alias as first-class and giving a targeted replacement message. |
This was referenced Jul 12, 2026
Flix6x
added a commit
that referenced
this pull request
Jul 12, 2026
…2.2+, swallowed CLI validation messages, task page 500) (#2303) * fix: three long-standing failures on main - Forecasting with past/future regressors raised a TypeError on pandas 2.2+: _slice_closed used the deprecated Series.view("int64") detour and then set values into an existing column with .loc[:, col], which validates against that column's dtype. Search the datetime64 values directly, and replace the column instead of setting into it. - CLI validation messages were swallowed for every marshmallow-typed option: since the click 8.2 upgrade (#2219) removed the click.ParamType base, click wraps these fields in FuncParamType, whose convert() reports the offending *value* and discards the reason. Raise a click error carrying the validation message instead (the ParamType base stays off, to keep the Python 3.10 MRO fix intact). - The task detail page returned a 500 for jobs whose meta data is not JSON-serializable, because rq-dashboard serializes meta with a bare json.dumps(). Give it a tolerant default (see rq-dashboard#510). Fixes #2302 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rbix8k1JfeUWNXEmHEZVpX * fix: three more long-standing failures on main - [GET] /api/ops/getLatestTaskRun turned any database error into an opaque 500: the retry in get_task_run() ran on the still-aborted transaction, so it was rejected with InFailedSqlTransaction and the original error was never surfaced. Roll back before retrying. - test_api_task_run_get_recent_entry did not declare the fixture seeding its data, so it queried a database without the latest_task_run table at all (which is what aborted the transaction above). - test_build_asset_jobs_data and test_get_job_status_requires_read_access asserted on job counts and job identity without flushing the Redis job cache, so leftover jobs from earlier tests (which @job_cache also reuses for identical requests) made them fail depending on test order. Both now use the existing clean_redis fixture. Fixes #2302 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rbix8k1JfeUWNXEmHEZVpX --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Click 8.2 introduced deprecated support on options, which collided with FlexMeasures’ custom
DeprecatedOptionattribute usage and broke multiple CLI commands. This PR removes that collision and lifts the temporary Click version pin.Problem summary
DeprecatedOptionsCommandfailed withTypeError: argument of type 'bool' is not iterable when running with Click 8.2+.Option.deprecatedboolean/string field.CLI compatibility fix
DeprecatedOptionnow stores deprecated aliases on a dedicated deprecated_options attribute.DeprecatedOptionsCommandnow reads deprecated_options when checking whether an invoked flag is deprecated.Dependency update
Regression coverage
MRO issue
CI test collection on Python 3.10 started failing with
TypeError: Cannot create a consistent method resolution order (MRO) for bases ABC, Genericafter dependency updates. This PR removes the incompatible inheritance pattern.Root cause addressed: Marshmallow/Click type compatibility on Python 3.10
click.ParamTypeinheritance fromMarshmallowClickMixinto avoidABC/GenericMRO conflicts with marshmallow fields.__call__) and a stable__name__so Click can still consume field instances where it falls back to callable conversion.convert()behavior for CLI parameter handling.Field class inheritance cleanup
MarshmallowClickMixinbefore marshmallow field classes in affected schema fields:AccountIdFieldDataSourceIdFieldUserIdFieldClick 8.2 compatibility clarity
DeprecatedOptioncompatibility approach (deprecated_optionsinstead ofdeprecated) and added an inline rationale comment for maintainability.