NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.32k stars 14.3k forks source link

urlwatch missing beautifulsoup dependency #335187

Open dalz opened 3 months ago

dalz commented 3 months ago

Describe the bug

urlwatch has the built-in filter beautify that requires beautifulsoup4, which is not included in the package dependencies. Trying to use beautify leads to an exception being raised (ImportError: Please install BeautifulSoup).

Steps To Reproduce

Steps to reproduce the behavior:

  1. add a job to urls.yaml like the following:
    kind: url
    name: example
    url: https://wikipedia.org
    filter:
    - beautify
  2. observe the exception being thrown.

Expected behavior

urlwatch finds the beautifulsoup library and doesn't throw any exception.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

The following overlay fixes the issue:

  nixpkgs.overlays = [(final: prev: {
    urlwatch = prev.urlwatch.overrideAttrs (old: {
      propagatedBuildInputs = old.propagatedBuildInputs
                              ++ [ prev.python3Packages.beautifulsoup4 ];
    });
  })];

Notify maintainers

@kmein @tv

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-linux"`
 - host os: `Linux 6.6.31, NixOS, 24.11 (Vicuna), 24.11pre664135.5e0ca22929f3`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"nixos, nixos-hardware"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

dotlambda commented 3 months ago

Should we really install all optional dependencies by default? You can easily add them using overridePythonAttrs.

dalz commented 3 months ago

It is easy only if you already know about it! Could there be an option, like programs.urlwatch.optionalDependencies? Or at least tell the user (in the package description maybe) that optional dependencies have to be installed through overlays?