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
Conversation
I'll probably also write a nixos service once this is merged |
Is this really a Python library? Otherwise it doesn't belong into |
Note that there is also #13587. Maybe some code can be reused. cc @Profpatsch |
Please, feel free to. |
@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. |
@fpletz @Profpatsch Thanks! I should really search before opening prs and duplicating work... The service part is definitely reusable! |
@Profpatsch Why did you choose to separate the js output? You don't seem to use that separation anywhere |
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. |
pkgs/top-level/python-packages.nix
Outdated
@@ -5295,6 +5295,25 @@ in { | |||
}; | |||
}; | |||
|
|||
isso = buildPythonPackage rec { |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it ok if I do it like this?
https://github.com/NixOS/nixpkgs/pull/13587/files#diff-036410e9211b4336186fc613f7200b12R9553
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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.
pkgs/top-level/python-packages.nix
Outdated
@@ -5667,6 +5686,24 @@ in { | |||
}; | |||
}; | |||
|
|||
# needed for isso 0.10.6 | |||
misaka_1 = buildPythonPackage rec { |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Added latest misaka to python modules, moved isso to all-packages with an override for misaka-1 |
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}"; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Add a comment.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
pkgs/servers/isso/default.nix
Outdated
let | ||
misaka_1 = misaka.overridePythonAttrs (old: rec { | ||
version = "1.0.2"; | ||
name = "${old.pname}-${version}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pname
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
pkgs/servers/isso/default.nix
Outdated
misaka_1 = misaka.overridePythonAttrs (old: rec { | ||
version = "1.0.2"; | ||
name = "${old.pname}-${version}"; | ||
src = fetchurl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src = old.src.override { ... }
pkgs/servers/isso/default.nix
Outdated
}); | ||
|
||
in buildPythonApplication rec { | ||
name = "isso-${version}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pname
pkgs/servers/isso/default.nix
Outdated
name = "isso-${version}"; | ||
version = "0.10.6"; | ||
|
||
src = fetchurl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetchPypi
pkgs/servers/isso/default.nix
Outdated
, misaka, werkzeug, ipaddr, configparser, html5lib_0_9999999 }: | ||
|
||
let | ||
misaka_1 = misaka.overridePythonAttrs (old: rec { |
There was a problem hiding this comment.
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).
dbf8c0b
to
f2115f8
Compare
pkgs/top-level/all-packages.nix
Outdated
@@ -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; |
There was a problem hiding this comment.
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)?
@GrahamcOfBorg build python2.pkgs.misaka python3.pkgs.misaka |
Failure on x86_64-linux (full log) Attempted: python2.pkgs.misaka, python3.pkgs.misaka Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: python2.pkgs.misaka, python3.pkgs.misaka Partial log (click to expand)
|
7300df4
to
53f7340
Compare
@dotlambda all done now |
pkgs/top-level/python-packages.nix
Outdated
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
I added some small corrections, please have a look. Feel free to sqash the last two commits. |
Thanks! Looks good! |
@GrahamcOfBorg build python2.pkgs.misaka python3.pkgs.misaka |
Success on aarch64-linux (full log) Attempted: python2.pkgs.misaka, python3.pkgs.misaka Partial log (click to expand)
|
@GrahamcOfBorg build isso |
Success on aarch64-linux (full log) Attempted: isso Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: python2.pkgs.misaka, python3.pkgs.misaka Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: isso Partial log (click to expand)
|
Can you actually run isso? I'm getting
|
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 |
Maybe fetching from GitHub instead of PyPI changed something. Did you try it with my changes? |
Yup, I'm on 6d09fbf |
That's strange: When using nix-review, I get the error above. It works however when building from your branch. |
@fgaz Do you plan on adding a module in another PR? |
Yes, I do. The module part of #13587 seems still pretty good so I'll probably base it on that |
Motivation for this change
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)Closes #13587