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

isso: fix build, switch to python 3, add a test #97435

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 54 additions & 4 deletions pkgs/servers/isso/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{ stdenv, python2, fetchFromGitHub }:
{ lib
, fetchFromGitHub
, fetchpatch
, python3
}:

with python2.pkgs; buildPythonApplication rec {
with python3.pkgs; buildPythonApplication rec {
pname = "isso";
version = "0.12.2";

Expand All @@ -12,15 +16,56 @@ with python2.pkgs; buildPythonApplication rec {
sha256 = "18v8lzwgl5hcbnawy50lfp3wnlc0rjhrnw9ja9260awkx7jra9ba";
};

# Some backports from master to fix the build with python 3 and newer libraries
patches = [
# https://github.com/jelmer/isso/commit/e2cfd6c08c0fbe64aedac22b17d30e7a8834cd5b
(fetchpatch {
name = "python-3.7-support";
url = "https://github.com/jelmer/isso/commit/e2cfd6c08c0fbe64aedac22b17d30e7a8834cd5b.patch";
sha256 = "0rgwv6d9q2zdrdkswzdz637xsfbz9405g9shydk7zjcz1km53s4q";
})

# https://github.com/posativ/isso/issues/611
# https://github.com/posativ/isso/pull/614
(fetchpatch {
name = "werkzeug-1-compatibility";
url = "https://github.com/posativ/isso/pull/614.patch";
sha256 = "082wcsqbn1kc0p2mqb1svz4pj5yxqj0ymq6aqxs57g9ryigwr6sz";
})

# https://github.com/posativ/isso/pull/615
(fetchpatch {
name = "python-3.8-support";
url = "https://github.com/posativ/isso/pull/615.patch";
sha256 = "0pwws93ginlf8scnaawqarhbf8dklx1rjsa4kna68bq3lp84bh70";
})

# https://github.com/posativ/isso/issues/659
# https://github.com/posativ/isso/pull/660
(fetchpatch {
name = "flask-caching-fix";
url = "https://github.com/posativ/isso/pull/660.patch";
sha256 = "09jgd28ldf2zhmg83fjwrimfn97pvcd5fnssi4241gd7z8dafi58";
})
Comment on lines +20 to +49
Copy link
Contributor

Choose a reason for hiding this comment

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

at this point, should we just bump to unstable?

Copy link
Member Author

@fgaz fgaz Sep 11, 2020

Choose a reason for hiding this comment

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

Well, the patches I applied are internal and quite small, and there's a lot more than that between 0.12.2 and master. Yes, it's minor stuff, but still I'd rather keep it stable and wait for a release for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course if you prefer we can bump to unstable


# https://github.com/posativ/isso/issues/599
# https://github.com/posativ/isso/pull/600
(fetchpatch {
name = "cgi.parse-fix";
url = "https://github.com/posativ/isso/pull/600.patch";
sha256 = "1x0fhgc5326a25zsyn31l6n1wh877y5j72na6f8ff5x0k4p5qfr3";
})
];

propagatedBuildInputs = [
bleach
cffi
configparser
html5lib
ipaddr
jinja2
misaka
werkzeug
flask-caching
];

checkInputs = [ nose ];
Expand All @@ -29,11 +74,16 @@ with python2.pkgs; buildPythonApplication rec {
${python.interpreter} setup.py nosetests
'';

meta = with stdenv.lib; {
passthru.tests = {
show-version = callPackage ./test-show-version.nix {};
};

meta = with lib; {
description = "A commenting server similar to Disqus";
homepage = "https://posativ.org/isso/";
license = licenses.mit;
maintainers = with maintainers; [ fgaz ];
platforms = platforms.all;
};
}

11 changes: 11 additions & 0 deletions pkgs/servers/isso/test-show-version.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ stdenv, isso }:

stdenv.mkDerivation {
name = "isso-test-show-version";
meta.timeout = 10;
buildCommand = ''
${isso}/bin/isso --version | grep "${isso.version}"
touch $out
'';
}