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

feeds: init at 0.16.1 #92339

Merged
merged 1 commit into from Dec 18, 2020
Merged

feeds: init at 0.16.1 #92339

merged 1 commit into from Dec 18, 2020

Conversation

pbogdan
Copy link
Member

@pbogdan pbogdan commented Jul 5, 2020

Motivation for this change

Add (g)feeds - an RSS/Atom feed reader for GNOME. Closes #91370.

Things done

I'm not familiar with Python / meson packaging so any feedback would be appreciated. The expression is largely based on the lollypop package.

Also one thing to note - I'm not sure what the package should be called gfeeds or just feeds. The executable is named gfeeds so is the upstream repo while the included desktop file names it as feeds and the package seems to be in a transition period.

I also picked a commit that was most recent version of master at the time I wrote the expression. The most recent tagged release had trouble parsing some of my feeds which was fixed on master so I used that instead try to hunt down the relevant patches to apply on top of a tagged release.

/cc @MetaDark who expressed interest in the package
/cc @jtojnar @worldofpeace as resident GNOME experts

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

, python3
}:
let
listparser = python3.pkgs.buildPythonPackage rec {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not add this to python-packages?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nothing else depends on it, and the package also hasn't been updated in a good while (last commit on the upstream repo is from September 2017). I was under (perhaps wrong) impression Python maintainers are reluctant to accept a new package like this and making it a private / vendored package was preferred.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense. I think that's a pretty good reason for keeping it private.

six
];

doCheck = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment why this is disabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

Default checkPhase doesn't seem to do anything (Ran 0 tests..). I'm not familiar with Python ecosystem at all, perhaps I'm just missing a checkInputs dependency but I simply don't know how to properly invoke the check phase so that tests are ran (the tests folder and its contents are present in the PyPI archive).

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, you might need to explicitly specify checkPhase.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is in context of listparser. I just added a commit that runs the tests based on what I found in tox.ini. The test suite however fails :-(. Maybe I'm missing something obvious but based on the output I really don't understand why.. Any ideas what's happening?

Copy link
Member Author

Choose a reason for hiding this comment

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

NVM, I was looking at the development branch of the package instead of the tagged release, test should now run and pass with the commit I just pushed.

pkgs/applications/networking/feedreaders/feeds/default.nix Outdated Show resolved Hide resolved
in
python3.pkgs.buildPythonApplication rec {
pname = "feeds-unstable";
version = "22-06-2020";
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Except for the version format, this looks good to me. Thanks @pbogdan!

pkgs/applications/networking/feedreaders/feeds/default.nix Outdated Show resolved Hide resolved
Copy link
Contributor

@kira-bruneau kira-bruneau 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 packaging this!

@@ -3442,6 +3442,8 @@ in

feedreader = callPackage ../applications/networking/feedreaders/feedreader {};

feeds = callPackage ../applications/networking/feedreaders/feeds {};
Copy link
Contributor

Choose a reason for hiding this comment

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

I've seen other packages use python3Packages.callPackage so python packages are passed as arguments to the expression. I prefer it over accessing them through python3.pkgs / python3Packages, but I'm not sure if it's the generally accepted approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

The opinions are somewhat mixed, slightly leaning to avoiding it. The main disadvantage is that it just shifts the qualified accessor to normal packages, that is, we would need to use pkgs.meson

Copy link
Contributor

Choose a reason for hiding this comment

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

I've used it before without needing to qualify normal packages:

Copy link
Contributor

@jtojnar jtojnar Jul 5, 2020

Choose a reason for hiding this comment

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

There are sometimes conflicts between normal packages and python packages. You would want to use pkgconfig or meson from all-package.nix but you would get the python package with the same name. (pkg-config now has a different name but the legacy alias still conflicts.) And when https://pypi.org/project/cmake/ is packaged, your package breaks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, good point 😄. I will fix that next update.

Comment on lines 19 to 21
listparser = python3.pkgs.buildPythonPackage rec {
pname = "listparser";
version = "0.18";

src = python3.pkgs.fetchPypi {
inherit pname version;
sha256 = "0hdqs1mmayw1r8yla43hgb4d9y3zqs5483vgf8j9ygczkd2wrq2b";
};

propagatedBuildInputs = with python3.pkgs; [
requests
six
];

doCheck = false;

meta = with lib; {
description = "A parser for subscription lists";
homepage = "https://github.com/kurtmckee/listparser";
license = licenses.lgpl3;
maintainers = [
maintainers.pbogdan
];
platforms = platforms.linux;
};
};
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to move this into pkgs/development/python-modules/listparser to separate this from Gnome Feeds, and so it can be used by other packages in the future.

I would also recommend directly pulling the sources from https://github.com/kurtmckee/listparser to run the tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Correction: It looks like the tests are included in the pypi package, so you might not need to pull the sources directly from the git repo.

@worldofpeace You asked me to do this before for #64705. What do you suggest here?

};
in
python3.pkgs.buildPythonApplication rec {
pname = "feeds-unstable";
Copy link
Contributor

Choose a reason for hiding this comment

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

That is the convention when obtaining a git commit instead of tag, see https://nixos.org/nixpkgs/manual/#sec-package-naming. It is also controversial: #88023 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

I just noticed that @pbogdan mentioned that the latest release version doesn't work, so I deleted my comments related to it.

};
in
python3.pkgs.buildPythonApplication rec {
pname = "feeds-unstable";
Copy link
Contributor

Choose a reason for hiding this comment

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

That is the convention when obtaining a git commit instead of tag, see https://nixos.org/nixpkgs/manual/#sec-package-naming. It is also controversial: #88023 (comment)

@pbogdan pbogdan force-pushed the add-feeds branch 4 times, most recently from b3d31c7 to 954e12d Compare July 5, 2020 17:36
@pbogdan pbogdan changed the title feeds-unstable: init at 22-06-2020 feeds-unstable: init at 2020-06-22 Jul 5, 2020
@pbogdan pbogdan changed the title feeds-unstable: init at 2020-06-22 feeds: init at 0.16.1 Dec 7, 2020
@doronbehar
Copy link
Contributor

error: --- Error --- nix-daemon
hash mismatch in fixed-output derivation '/nix/store/iw6fak8svqdsabkrd3dwma2x94x6mq47-source.drv':
  specified: sha256-GVXRic7cOtFiu7CXsPEykFd2JMLlrRDwJ91KwLMqBH8=
     got:    sha256-MxFV5kytpJR8irHfo+WuAw0zDesTk4FxG5XR060BGII=
error: --- Error --- nix-daemon
1 dependencies of derivation '/nix/store/5200wklds26rrpj0vqcgyfp1gk1ys8mk-feeds-0.16.1.drv' failed to build
error: --- Error ------------------------------------------------------------------------------------- nix
1 dependencies of derivation '/nix/store/aa0ksr66h69my33aa31681lk9acy8580-env.drv' failed to build

Link to currently reviewing PR:
https://github.com/NixOS/nixpkgs/pull/92339

1 package failed to build:
feeds

error: --- Error ------------------------------------------------------------------------------------- nix


src = python3.pkgs.fetchPypi {
inherit pname version;
sha256 = "0hdqs1mmayw1r8yla43hgb4d9y3zqs5483vgf8j9ygczkd2wrq2b";
Copy link
Contributor

Choose a reason for hiding this comment

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

One issue might be that r-ryantm might not update files with multiple hashes in them.

@pbogdan pbogdan force-pushed the add-feeds branch 2 times, most recently from 504e3c0 to 1b52c9d Compare December 16, 2020 20:57
, python3
}:
let
listparser = import ./listparser.nix {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think now it's impossible to override it in case it fails to build.. You should also be able to use callPackage instead which is a bit more versatile - you won't need inherit lib python3;. If we would like to not add it to python-packages.nix, we can put in the arguments list:

, listparser ? callPackage ./listparser.nix { }

And then inside the feeds expression, use passthru = { inherit listparser; }; - this will expose it and allow it to be overridden in case it fails to build.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you explain why it should go into passthru? I don't quite see how that's going to help with overriding.

Copy link
Contributor

Choose a reason for hiding this comment

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

With the passthru, one should be able to:

self: super: {
  feeds-with-different-listparser = super.feeds.override {
    # No need to use the `passthru` attribute, but it helps the usage be clear
    listparser = super.feeds.passthru.listparser.overrideAttrs(oldAttrs: {
      /* src = ...; */
    });
  };
}

@doronbehar
Copy link
Contributor

Result of nixpkgs-review pr 92339 run on x86_64-linux 1

1 package built:
  • feeds

@doronbehar doronbehar merged commit 5277b1d into NixOS:master Dec 18, 2020
@dotlambda
Copy link
Member

dotlambda commented Apr 10, 2021

Was there any discussion about the name? Arch and Guix call this package gfeeds (https://repology.org/project/gfeeds), everyone else calls it gnome-feeds (https://repology.org/project/gnome-feeds).
I think we should rename it to gfeeds.

@doronbehar doronbehar mentioned this pull request Apr 10, 2021
10 tasks
@doronbehar
Copy link
Contributor

Was there any discussion about the name? Arch and Guix call this package gfeeds (repology.org/project/gfeeds), everyone else calls it gnome-feeds (repology.org/project/gnome-feeds).
I think we should rename it to gfeeds.

Good point, I was thinking about this myself as well. Let's do it before it reaches stable. Renaming it's pname to gfeeds and attribute to gnome-feeds in: #119067

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

Successfully merging this pull request may close these issues.

packaging request: (g)feeds
5 participants