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: init at 0.10.6 (plus dependencies) #34296

Merged
merged 2 commits into from Apr 17, 2018
Merged

Isso: init at 0.10.6 (plus dependencies) #34296

merged 2 commits into from Apr 17, 2018

Conversation

fgaz
Copy link
Member

@fgaz fgaz commented Jan 26, 2018

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Closes #13587

@fgaz fgaz requested a review from FRidh as a code owner January 26, 2018 15:25
@fgaz
Copy link
Member Author

fgaz commented Jan 26, 2018

I'll probably also write a nixos service once this is merged

@dotlambda
Copy link
Member

Is this really a Python library? Otherwise it doesn't belong into python-packages.nix.

@fpletz
Copy link
Member

fpletz commented Jan 27, 2018

Note that there is also #13587. Maybe some code can be reused. cc @Profpatsch

@Profpatsch
Copy link
Member

Please, feel free to.

@fgaz
Copy link
Member Author

fgaz commented Jan 27, 2018

@dotlambda I see several examples of non-libraries there, eg. mps-youtube. But you are right, it is even mentioned in the comment at the beginning of that file. I'll move it.

@fgaz
Copy link
Member Author

fgaz commented Jan 27, 2018

@fpletz @Profpatsch Thanks! I should really search before opening prs and duplicating work...

The service part is definitely reusable!

@fgaz
Copy link
Member Author

fgaz commented Jan 27, 2018

@Profpatsch Why did you choose to separate the js output? You don't seem to use that separation anywhere

@Profpatsch
Copy link
Member

Good question. I’m not sure why I did that back then, isso itself seems to depend on the js folder, so it doesn’t make much sense.

Maybe I wanted to use only the js for my project.

@@ -5295,6 +5295,25 @@ in {
};
};

isso = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

This is an application and should therefore be called directly from all-packages.nix, and not via python-packages.nix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Or should I move the whole buildPythonPackage in its own file in pkgs/applications (or pkgs/servers)?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, please create a default.nix in pkgs/servers/isso/, and remember to use buildPythonApplication.
However, misaka (latest version) needs to be put in pkgs/development/python-modules and called from python-packages.nix.
You can then use overridePytonAttrs in isso's default.nix to specify a custom misaka version.

@@ -5667,6 +5686,24 @@ in {
};
};

# needed for isso 0.10.6
misaka_1 = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

This one will need to be added locally to the application isso, and not here in python-packages.nix.

Copy link
Member Author

Choose a reason for hiding this comment

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

so something like

let misaka_1 = buildPythonPackage {...}; in
buildPythonPackage {name="isso-..."; propagatedBuildInputs = [misaka_1 ... ] ;...}

right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, and what about html5lib_0_9999999? Should I use the one in pythonModules? Should that be removed too?

Copy link
Member

Choose a reason for hiding this comment

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

You should better use overridePytonAttrs: https://github.com/NixOS/nixpkgs/search?q=overridePythonAttrs

@fgaz
Copy link
Member Author

fgaz commented Feb 22, 2018

Added latest misaka to python modules, moved isso to all-packages with an override for misaka-1

@fgaz
Copy link
Member Author

fgaz commented Feb 22, 2018

Wait, why is 940f182 there? I probably messed something up during a rebase

EDIT: fixed & rebased on master

{ lib, fetchPypi, buildPythonPackage, cffi }:
buildPythonPackage rec {
pname = "misaka";
name = "${pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

no name


propagatedBuildInputs = [ cffi ];

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

Why? Add a comment.

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 actually don't remember why I did this. It tests fine. Removing it 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.

well, that's why. re-disabling.

let
misaka_1 = misaka.overridePythonAttrs (old: rec {
version = "1.0.2";
name = "${old.pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

pname

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 don't understand this. Should I redefine pname like this and use pname instead of old.pname?

pname = old.pname;

Or should I omit redefining name entirely?

Copy link
Member

Choose a reason for hiding this comment

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

If you leave out name in the misaka expression, there is no need to override any of name or pname.

misaka_1 = misaka.overridePythonAttrs (old: rec {
version = "1.0.2";
name = "${old.pname}-${version}";
src = fetchurl {
Copy link
Member

Choose a reason for hiding this comment

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

src = old.src.override { ... }

});

in buildPythonApplication rec {
name = "isso-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

pname

name = "isso-${version}";
version = "0.10.6";

src = fetchurl {
Copy link
Member

Choose a reason for hiding this comment

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

fetchPypi

, misaka, werkzeug, ipaddr, configparser, html5lib_0_9999999 }:

let
misaka_1 = misaka.overridePythonAttrs (old: rec {
Copy link
Member

Choose a reason for hiding this comment

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

Better specify python as an argument and override as in https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/home-assistant/default.nix.
This will make sure that all dependencies use the old version of misaka as well (which is of course not necessary right now but might be in the future).

@fgaz fgaz force-pushed the isso branch 2 times, most recently from dbf8c0b to f2115f8 Compare March 28, 2018 13:55
@@ -9444,6 +9444,11 @@ with pkgs;
stdenv = llvmPackages_4.stdenv;
};

isso = callPackage ../servers/isso {
inherit (python2Packages)
buildPythonApplication fetchPypi misaka werkzeug ipaddr configparser html5lib_0_9999999;
Copy link
Member

Choose a reason for hiding this comment

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

Did you read #34296 (comment)?

@dotlambda
Copy link
Member

@GrahamcOfBorg build python2.pkgs.misaka python3.pkgs.misaka

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: python2.pkgs.misaka, python3.pkgs.misaka

Partial log (click to expand)


For information on other options, you may wish to consult the
documentation at:

  https://setuptools.readthedocs.io/en/latest/easy_install.html

Please make the appropriate changes for your system and try again.

builder for '/nix/store/g6ici055vv4r47zc19phd47vnl9r2ifp-python3.6-misaka-2.1.0.drv' failed with exit code 1
�[31;1merror:�[0m build of '/nix/store/515z752rpa98xrwk3397if6jy15ybd2k-python2.7-misaka-2.1.0.drv', '/nix/store/g6ici055vv4r47zc19phd47vnl9r2ifp-python3.6-misaka-2.1.0.drv' failed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: python2.pkgs.misaka, python3.pkgs.misaka

Partial log (click to expand)


For information on other options, you may wish to consult the
documentation at:

  https://setuptools.readthedocs.io/en/latest/easy_install.html

Please make the appropriate changes for your system and try again.

builder for '/nix/store/crvd0kj7zm83lmq7fqg5sbk4ah5rxkj7-python3.6-misaka-2.1.0.drv' failed with exit code 1
�[31;1merror:�[0m build of '/nix/store/57v21azxmmmgic88g8xv0bkgb6vn4q49-python2.7-misaka-2.1.0.drv', '/nix/store/crvd0kj7zm83lmq7fqg5sbk4ah5rxkj7-python3.6-misaka-2.1.0.drv' failed

@fgaz fgaz force-pushed the isso branch 4 times, most recently from 7300df4 to 53f7340 Compare April 14, 2018 18:01
@fgaz
Copy link
Member Author

fgaz commented Apr 14, 2018

@dotlambda all done now

@@ -1247,7 +1247,7 @@ in {

blaze = callPackage ../development/python-modules/blaze { };

# Needed for bleach 1.5.0
# Needed for bleach 1.5.0 and isso 0.10.6
Copy link
Member

@dotlambda dotlambda Apr 14, 2018

Choose a reason for hiding this comment

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

Could you override the html5lib version in the isso expression instead?

Copy link
Member

Choose a reason for hiding this comment

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

I will take care of getting rid of bleach 1.5.0

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@dotlambda
Copy link
Member

I added some small corrections, please have a look. Feel free to sqash the last two commits.

@fgaz
Copy link
Member Author

fgaz commented Apr 16, 2018

Thanks! Looks good!

@dotlambda
Copy link
Member

@GrahamcOfBorg build python2.pkgs.misaka python3.pkgs.misaka

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: python2.pkgs.misaka, python3.pkgs.misaka

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/jjpm9klw56pnc5vizdrjjn9biybq9w62-python3.6-misaka-2.1.0
shrinking /nix/store/jjpm9klw56pnc5vizdrjjn9biybq9w62-python3.6-misaka-2.1.0/lib/python3.6/site-packages/misaka/_hoedown.abi3.so
strip is /nix/store/j7d4mr0ikv974ig7yzhknpsq288js4bs-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/jjpm9klw56pnc5vizdrjjn9biybq9w62-python3.6-misaka-2.1.0/lib  /nix/store/jjpm9klw56pnc5vizdrjjn9biybq9w62-python3.6-misaka-2.1.0/bin
patching script interpreter paths in /nix/store/jjpm9klw56pnc5vizdrjjn9biybq9w62-python3.6-misaka-2.1.0
checking for references to /build in /nix/store/jjpm9klw56pnc5vizdrjjn9biybq9w62-python3.6-misaka-2.1.0...
wrapping `/nix/store/jjpm9klw56pnc5vizdrjjn9biybq9w62-python3.6-misaka-2.1.0/bin/misaka'...
/nix/store/060a1bwy9q3qrn7gy9jx6wpl01kk7v9d-python2.7-misaka-2.1.0
/nix/store/jjpm9klw56pnc5vizdrjjn9biybq9w62-python3.6-misaka-2.1.0

@dotlambda
Copy link
Member

@GrahamcOfBorg build isso

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: isso

Partial log (click to expand)

warning: no files found matching 'isso/js/embed.dev.js'
warning: no files found matching 'isso/js/count.min.js'
warning: no files found matching 'isso/js/count.dev.js'
writing manifest file 'isso.egg-info/SOURCES.txt'
......................................................S............
----------------------------------------------------------------------
Ran 67 tests in 28.290s

OK (SKIP=1)
/nix/store/vzbxy4m5g2bh9fjzjjzslabz72zgsnr1-isso-0.10.6

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: python2.pkgs.misaka, python3.pkgs.misaka

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/lpagqxkh49y835a1hi7ci7yhjdjl4sqj-python3.6-misaka-2.1.0
shrinking /nix/store/lpagqxkh49y835a1hi7ci7yhjdjl4sqj-python3.6-misaka-2.1.0/lib/python3.6/site-packages/misaka/_hoedown.abi3.so
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/lpagqxkh49y835a1hi7ci7yhjdjl4sqj-python3.6-misaka-2.1.0/lib  /nix/store/lpagqxkh49y835a1hi7ci7yhjdjl4sqj-python3.6-misaka-2.1.0/bin
patching script interpreter paths in /nix/store/lpagqxkh49y835a1hi7ci7yhjdjl4sqj-python3.6-misaka-2.1.0
checking for references to /build in /nix/store/lpagqxkh49y835a1hi7ci7yhjdjl4sqj-python3.6-misaka-2.1.0...
wrapping `/nix/store/lpagqxkh49y835a1hi7ci7yhjdjl4sqj-python3.6-misaka-2.1.0/bin/misaka'...
/nix/store/wgnda2v2v7jicg7sb29i4nj3q711p8qj-python2.7-misaka-2.1.0
/nix/store/lpagqxkh49y835a1hi7ci7yhjdjl4sqj-python3.6-misaka-2.1.0

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: isso

Partial log (click to expand)

warning: no files found matching 'isso/js/embed.dev.js'
warning: no files found matching 'isso/js/count.min.js'
warning: no files found matching 'isso/js/count.dev.js'
writing manifest file 'isso.egg-info/SOURCES.txt'
......................................................S............
----------------------------------------------------------------------
Ran 67 tests in 10.377s

OK (SKIP=1)
/nix/store/52w954yrmbbcip7xlmkjhnrnn2bhv5rp-isso-0.10.6

@dotlambda
Copy link
Member

Can you actually run isso? I'm getting

Traceback (most recent call last):
  File "/nix/store/52w954yrmbbcip7xlmkjhnrnn2bhv5rp-isso-0.10.6/bin/.isso-wrapped", line 8, in <module>
    from isso import main
  File "/nix/store/52w954yrmbbcip7xlmkjhnrnn2bhv5rp-isso-0.10.6/lib/python2.7/site-packages/isso/__init__.py", line 71, in <module>
    from isso.utils import http, JSONRequest, html, hash
  File "/nix/store/52w954yrmbbcip7xlmkjhnrnn2bhv5rp-isso-0.10.6/lib/python2.7/site-packages/isso/utils/html.py", line 19, in <module>
    import misaka
  File "/nix/store/lpagqxkh49y835a1hi7ci7yhjdjl4sqj-python3.6-misaka-2.1.0/lib/python3.6/site-packages/misaka/__init__.py", line 3, in <module>
    from .api import *
  File "/nix/store/lpagqxkh49y835a1hi7ci7yhjdjl4sqj-python3.6-misaka-2.1.0/lib/python3.6/site-packages/misaka/api.py", line 9, in <module>
    from ._hoedown import lib, ffi
ImportError: No module named _hoedown

@fgaz
Copy link
Member Author

fgaz commented Apr 17, 2018

It works for me (even posting and getting comments). What did you do to make it crash?

edit: I tried it on both nixos and debian+nix

@dotlambda
Copy link
Member

dotlambda commented Apr 17, 2018

Maybe fetching from GitHub instead of PyPI changed something. Did you try it with my changes?
I only ran isso -h.

@fgaz
Copy link
Member Author

fgaz commented Apr 17, 2018

Yup, I'm on 6d09fbf

@dotlambda
Copy link
Member

That's strange: When using nix-review, I get the error above. It works however when building from your branch.

@dotlambda dotlambda merged commit c6a8b90 into NixOS:master Apr 17, 2018
@dotlambda
Copy link
Member

@fgaz Do you plan on adding a module in another PR?

@fgaz fgaz deleted the isso branch April 17, 2018 10:57
@fgaz
Copy link
Member Author

fgaz commented Apr 18, 2018

Yes, I do. The module part of #13587 seems still pretty good so I'll probably base it on that

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.

None yet

6 participants