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

synadm doesn't work after v0.38 with Click 7.0 #106

Closed
lfom opened this issue Mar 25, 2023 · 8 comments · Fixed by #107
Closed

synadm doesn't work after v0.38 with Click 7.0 #106

lfom opened this issue Mar 25, 2023 · 8 comments · Fixed by #107
Labels
bug Something isn't working

Comments

@lfom
Copy link

lfom commented Mar 25, 2023

Hi, there.

Thank you for creating and maintaining synadm. I have been using it for a while on Ubuntu 20.04 and after I updated today to version 0.41 it stopped working with this error:

Traceback (most recent call last):
  File "/home/ubuntu/.local/bin/synadm", line 5, in <module>
    from synadm.cli import root
  File "/home/ubuntu/.local/lib/python3.8/site-packages/synadm/cli/__init__.py", line 486, in <module>
    from synadm.cli import room, user, media, group, history, matrix, regtok, notice  # noqa: F401, E402, E501
  File "/home/ubuntu/.local/lib/python3.8/site-packages/synadm/cli/room.py", line 336, in <module>
    def block(helper, room_id, block):
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 173, in decorator
    _param_memo(f, OptionClass(param_decls, **option_attrs))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1601, in __init__
    raise TypeError('Got secondary option for non boolean flag.')
TypeError: Got secondary option for non boolean flag.

Then I noticed this when upgrading:

Requirement already satisfied: Click<8.0,>=7.0 in /usr/lib/python3/dist-packages (from synadm) (7.0)

And then tried to install only this package (newer version from pip), what worked:

píp install -U click

Now I have this for my user:

$ pip list --user      
Package            Version
------------------ -------
click              8.1.3  
click-option-group 0.5.5  
dnspython          2.3.0  
synadm             0.41 

I did not find click in logs, so I guess that was the version installed by default on Ubuntu 20.04. Maybe the version needs to be updated in the dependencies.

PS: while troubleshooting it seems that the builtin version works with synadm up to v0.38 and fails after that.

Regards

@JacksonChen666
Copy link
Collaborator

@lfom

  • What command did you run that caused the error?
  • What version of Click was installed when the error occurred?
  • Do you still have the error after upgrading Click?

@JacksonChen666 JacksonChen666 added the bug Something isn't working label Mar 25, 2023
@lfom
Copy link
Author

lfom commented Mar 25, 2023

@lfom

* What command did you run that caused the error?

* What version of `Click` was installed when the error occurred?

* Do you still have the error after upgrading `Click`?
  • any synadm command
  • click 7.0 (stock system package)
$ apt list --installed | grep click
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
python3-click/focal,now 7.0-3 all [installed,automatic]
  • no, everything seems to work fine with click 8.1.3 installed via pip

@JacksonChen666
Copy link
Collaborator

JacksonChen666 commented Mar 25, 2023

Requirement already satisfied: Click<8.0,>=7.0 in /usr/lib/python3/dist-packages (from synadm) (7.0)

Well, that's odd...

v0.41 specifies Click<9.0,>=7.0, but your install logs show something else.

@lfom Could you try upgrading the synadm package through pip? (Did you install synadm outside of pip?)

@lfom
Copy link
Author

lfom commented Mar 25, 2023

@JacksonChen666 Thank you for taking time to look into this. Maybe I was not clear enough, so please let me try to clarify it:

  1. synadm was installed with pip since the beginning
  2. synadm works with builtin click (v7.0) up to version 0.38
  3. From synadm version 0.39 and up, it shows the same error when I try to run it with any arguments, what as fixed after updating click via pip.

In other words, when using pip to install/update synadm it does not complain about the builtin click version, since it satisfies the requirements (Click<9.0,>=7.0), but it does not work (giving the error log above) from version 0.39 and above. That is why I suggested updating the minimum click version for these versions of synadm.

This setup works just fine on Ubuntu 20.04 with latest updates on ARM64:

$ pip list --user      
Package            Version
------------------ -------
click              8.1.3  
click-option-group 0.5.5  
dnspython          2.3.0  
synadm             0.41 

@JacksonChen666
Copy link
Collaborator

Ok so I just installed Click==7.0 and it definitely does not work, giving the same error message (not stacktrace). 7.1 seems to work though.

I will create a PR to fix this issue. @JOJ0 just a heads up for that.

@JacksonChen666
Copy link
Collaborator

63fa8e5 is the first commit to cause the issue (yes, it's mine, i have no idea how it's causing issues, that's for later)

@JacksonChen666 JacksonChen666 changed the title pip installation on Ubuntu 20.04 does not work due to old dependency synadm doesn't work after v0.39 with Click 7.0 Mar 25, 2023
JacksonChen666 added a commit that referenced this issue Mar 25, 2023
due to 63fa8e5, it does not work with
Click==7.0, only Click==7.1.
I don't know why it doesn't work, but that's for another time to figure
out.

References: #106
@JacksonChen666
Copy link
Collaborator

Anyways, thanks for reporting this issue!

@lfom lfom changed the title synadm doesn't work after v0.39 with Click 7.0 synadm doesn't work after v0.38 with Click 7.0 Mar 25, 2023
@JOJ0 JOJ0 closed this as completed in #107 Mar 25, 2023
@JOJ0
Copy link
Owner

JOJ0 commented Mar 25, 2023

Thank you both for reporting and digging into a fix! We'll release this shortly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants