Skip to content

Commit

Permalink
Remove exception on cloup.Color import
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Mar 4, 2024
1 parent 2f0fc08 commit bd8c574
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 46 deletions.
10 changes: 1 addition & 9 deletions click_extra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,7 @@ def cache(user_function):
"Choice",
"clear",
"ClickException",
# XXX Color cannot be imported from cloup. It leads to an issue in the way autodoc
# is trying to render it:
# Exception occurred:
# File ".../python3.11/site-packages/cloup/_util.py", line 128, in __setattr__
# raise Exception("you can't set attributes on this class")
# Exception: you can't set attributes on this class
# This has been reported upstream at: https://github.com/janluke/cloup/issues/177
# and https://github.com/sphinx-doc/sphinx/issues/11986
# "Color",
"Color",
"color_option",
"ColorOption",
"Command",
Expand Down
9 changes: 0 additions & 9 deletions click_extra/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ def fetch_root_members(module):
click_members = fetch_root_members(click)

cloup_members = {m for m in cloup.__all__ if not m.startswith("_")}
# XXX Color cannot be imported from cloup. It leads to an issue in the way autodoc
# is trying to render it:
# Exception occurred:
# File ".../python3.11/site-packages/cloup/_util.py", line 128, in __setattr__
# raise Exception("you can't set attributes on this class")
# Exception: you can't set attributes on this class
# This has been reported upstream at: https://github.com/janluke/cloup/issues/177
# and https://github.com/sphinx-doc/sphinx/issues/11986
cloup_members.remove("Color")

tree = ast.parse(Path(__file__).parent.joinpath("../__init__.py").read_bytes())
click_extra_members = []
Expand Down
39 changes: 14 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ boltons = "^23.0.0"
# https://github.com/pallets/click/issues/2416
# https://github.com/pallets/click/pull/2417
click = "^8.1.4"
# Cloup 3.0.0 changed HelpTheme to a dataclass: https://github.com/janluke/cloup/pull/163
# Cloup 3.0.1 fixed copying of Constraint: https://github.com/janluke/cloup/issues/166
cloup = "^3.0.1"
# Cloup 3.0.5 fix incompatibility with autodoc: https://github.com/janluke/cloup/issues/177
cloup = "^3.0.5"
commentjson = "^0.9.0"
mergedeep = "^1.3.4"
# Pallets-Sphinx-Themes 2.1.1 is the first version removing old and conflicting Python 2 code.
Expand Down

0 comments on commit bd8c574

Please sign in to comment.