Skip to content

Avoid latest click==8.1.0 that removed a deprecated feature#3413

Merged
himkt merged 1 commit intooptuna:masterfrom
hvy:pin-click
Mar 29, 2022
Merged

Avoid latest click==8.1.0 that removed a deprecated feature#3413
himkt merged 1 commit intooptuna:masterfrom
hvy:pin-click

Conversation

@hvy
Copy link
Copy Markdown
Member

@hvy hvy commented Mar 29, 2022

Motivation

Fixes a broken test rooted in a recent release of click==8.1.0.

___ ERROR collecting tests/integration_tests/allennlp_tests/test_allennlp.py ___
ImportError while importing test module '/home/runner/work/optuna/optuna/tests/integration_tests/allennlp_tests/test_allennlp.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/importlib/__init__.py:1[27](https://github.com/optuna/optuna/runs/5729471389?check_suite_focus=true#step:7:27): in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/integration_tests/allennlp_tests/test_allennlp.py:10: in <module>
    import allennlp.data
/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/allennlp/__init__.py:18: in <module>
    import transformers, spacy, torch, numpy  # noqa
/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/spacy/__init__.py:15: in <module>
    from .cli.info import info  # noqa: F[40](https://github.com/optuna/optuna/runs/5729471389?check_suite_focus=true#step:7:40)1
/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/spacy/cli/__init__.py:3: in <module>
    from ._util import app, setup_cli  # noqa: F401
/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/spacy/cli/_util.py:9: in <module>
    import typer
/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/typer/__init__.py:12: in <module>
    from click.termui import get_terminal_size as get_terminal_size
E   ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/click/termui.py)

https://github.com/optuna/optuna/runs/5729471389?check_suite_focus=true

Description of the changes

Temporarily avoid the latest click to keep the previous working behavior.
This change can be undone once fastapi/typer#375 is released.

@hvy hvy added the installation Installation and dependency. label Mar 29, 2022
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #3413 (53970e8) into master (4cec212) will decrease coverage by 0.02%.
The diff coverage is 96.47%.

@@            Coverage Diff             @@
##           master    #3413      +/-   ##
==========================================
- Coverage   91.82%   91.80%   -0.03%     
==========================================
  Files         156      156              
  Lines       12236    12262      +26     
==========================================
+ Hits        11236    11257      +21     
- Misses       1000     1005       +5     
Impacted Files Coverage Δ
optuna/storages/_rdb/storage.py 95.34% <90.90%> (-0.18%) ⬇️
optuna/storages/_redis.py 96.42% <95.45%> (-0.32%) ⬇️
optuna/storages/_base.py 70.54% <100.00%> (+0.08%) ⬆️
optuna/storages/_cached_storage.py 99.59% <100.00%> (-0.01%) ⬇️
optuna/storages/_in_memory.py 100.00% <100.00%> (ø)
optuna/study/study.py 96.01% <100.00%> (-0.04%) ⬇️
optuna/testing/integration.py 100.00% <100.00%> (ø)
optuna/testing/storage.py 94.28% <100.00%> (+0.16%) ⬆️
optuna/integration/botorch.py 97.80% <0.00%> (-0.88%) ⬇️
... and 1 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Copy Markdown
Member

@himkt himkt left a comment

Choose a reason for hiding this comment

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

Thank you for the quick patch, LGTM!

@himkt himkt self-assigned this Mar 29, 2022
@himkt himkt added this to the v3.0.0-b0 milestone Mar 29, 2022
@himkt himkt merged commit b40a1ab into optuna:master Mar 29, 2022
@hvy hvy deleted the pin-click branch March 29, 2022 01:43
@tiangolo
Copy link
Copy Markdown

Hello! I just released Typer 0.4.1, you can now upgrade the version and possibly unpin Click. 🚀 🤓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

installation Installation and dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants