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

Consider adding support for Ubuntu Focal #206

Closed
eloquence opened this issue Sep 15, 2022 · 4 comments · Fixed by #241
Closed

Consider adding support for Ubuntu Focal #206

eloquence opened this issue Sep 15, 2022 · 4 comments · Fixed by #241
Assignees
Milestone

Comments

@eloquence
Copy link
Member

Ubuntu 20.04 is still supported until April 2025, so we should consider adding it to the list of supported releases for users who haven't moved to Jammy yet.

@eloquence eloquence added this to the 0.4.0 milestone Sep 15, 2022
@deeplow
Copy link
Contributor

deeplow commented Oct 19, 2022

Apparently podman (on which the linux version depdends) is not available on ubuntu focal and it requires external repos (linked from the podman blog).

And actually we do test podman on this exact ubuntu version (it's where the CI tests the document conversion process). And dangerzone had been available in the past for that ubuntu version.

@apyrgio will add the documentation to the installation instructions after successful testing & confirmation the packagecloud deb works for that version.

@deeplow
Copy link
Contributor

deeplow commented Oct 26, 2022

It doesn't support python3.10 (which we now need) unless we add the deadsnakes as a dependency

@apyrgio
Copy link
Contributor

apyrgio commented Oct 31, 2022

Our Packagecloud repos for Ubuntu Focal do have a Dangerzone package, but the latest version is 0.2.1, which is the last version that supported Ubuntu Focal. See also #160 (comment). This means that we need to partially revert 229ebbd, and create a 0.4 Ubuntu Focal package, besides adding Podman instructions.

Aside from that, I'd like to ask a quick question:

It doesn't support python3.10 (which we now need) unless we add the deadsnakes as a dependency

I believe this is no longer accurate, right? We had some minor Mypy issues in Python 3.9, but they are not important enough to switch to Python 3.10.

@apyrgio
Copy link
Contributor

apyrgio commented Oct 31, 2022

I can verify that we can install Dangerzone on Ubuntu Focal, if we install Podman first, with the instructions that we have in our CircleCI config. As for the .deb itself, I just downloaded it from Packagecloud, without adding the repo in the sources.

I haven't managed to test Dangerzone successfully though, because I encountered this issue:

/usr/lib/python3/dist-packages/click/core.py:940: Warning: Invoked legacy parameter callback "<function validate_input_filename at 0x7fc0e8cb61f0>".  The new signature for such callbacks starting with click 2.0 is (ctx, param, value).
  value, args = param.handle_parse_result(ctx, opts, args)
Traceback (most recent call last):
  File "/usr/bin/dangerzone", line 33, in <module>
    sys.exit(load_entry_point('dangerzone==0.3.2', 'console_scripts', 'dangerzone')())
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 716, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/usr/lib/python3/dist-packages/click/core.py", line 641, in make_context
    self.parse_args(ctx, args)
  File "/usr/lib/python3/dist-packages/click/core.py", line 940, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1476, in handle_parse_result
    value = invoke_param_callback(
  File "/usr/lib/python3/dist-packages/click/core.py", line 95, in invoke_param_callback
    return callback(ctx, value)
  File "/usr/lib/python3/dist-packages/dangerzone/errors.py", line 23, in wrapper
    return func(*args, **kwargs)
TypeError: validate_input_filename() missing 1 required positional argument: 'value'

Turns out that Click 7.x and below checked for the arguments that callbacks support, and if they were less than 3, it invoked the callback with less arguments (legacy mode):

https://github.com/pallets/click/blob/1784558ed7c75c65764d2a434bd9cbb206ca939d/src/click/core.py#L108-L112

In our case, our callback does support three arguments, but it's decorated with another function. This shouldn't be a problem because we use functools.wraps(func), but turns out that it doesn't suffice, and the reported arguments for the function are 0. Others have encountered a similar problem, so we need to solve it similarly.

apyrgio added a commit that referenced this issue Nov 1, 2022
Support Click version 7.x and below, which inspect the number of
arguments a callback handler supports.

Refs #206
apyrgio added a commit that referenced this issue Nov 1, 2022
Reinstate support for Ubuntu Focal, which was previously removed in
commit 229ebbd.

Refs #206
apyrgio added a commit that referenced this issue Nov 1, 2022
Add extra installations steps for installing Podman in Ubuntu Focal,
since it's not present in the official Ubuntu repos. This is the final
requirement to reinstate Ubuntu Focal support.

Closes #206
apyrgio added a commit that referenced this issue Nov 1, 2022
Support Click version 7.x and below, which inspect the number of
arguments a callback handler supports.

Refs #206
apyrgio added a commit that referenced this issue Nov 1, 2022
Reinstate support for Ubuntu Focal, which was previously removed in
commit 229ebbd.

Refs #206
apyrgio added a commit that referenced this issue Nov 1, 2022
Add extra installations steps for installing Podman in Ubuntu Focal,
since it's not present in the official Ubuntu repos. This is the final
requirement to reinstate Ubuntu Focal support.

Closes #206
apyrgio added a commit that referenced this issue Nov 7, 2022
Support Click version 7.x and below, which inspect the number of
arguments a callback handler supports.

Refs #206
apyrgio added a commit that referenced this issue Nov 7, 2022
Reinstate support for Ubuntu Focal, which was previously removed in
commit 229ebbd.

Refs #206
apyrgio added a commit that referenced this issue Nov 7, 2022
Add extra installations steps for installing Podman in Ubuntu Focal,
since it's not present in the official Ubuntu repos. This is the final
requirement to reinstate Ubuntu Focal support.

Closes #206
apyrgio added a commit that referenced this issue Nov 10, 2022
Support Click version 7.x and below, which inspect the number of
arguments a callback handler supports.

Refs #206
apyrgio added a commit that referenced this issue Nov 10, 2022
Reinstate support for Ubuntu Focal, which was previously removed in
commit 229ebbd.

Refs #206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants