Skip to content

nikola: init at 7.8.4 #25849

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

Merged
merged 2 commits into from
May 27, 2017
Merged

nikola: init at 7.8.4 #25849

merged 2 commits into from
May 27, 2017

Conversation

jluttine
Copy link
Member

Motivation for this change

Nikola is a static site generator written in Python. I added it as a Python application, not Python module, because it's used as an application, not as a library.

Nikola has a bunch of extra dependencies that enable some additional features. Is there some nice way to support installing Nikola with optionally all the extra dependencies? With pip, this would be done as pip install nikola[extras], is there any similar support in nix or would it even be desirable?

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
    • Linux
  • 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.

Sorry, something went wrong.

@nixy
Copy link
Contributor

nixy commented May 17, 2017

In Nix extra dependencies or modes are usually specified by taking additional arguments such as fullDependencies or interactive.

You can then use this in the .nix file to tell it how it should be built differently if these are set. Users would have to specify an override for these options in their nixpkgs configuration, which isn't ideal but is possible.

@jluttine
Copy link
Member Author

Ok, thanks. I'll leave that for later because I'm not sure if all the optional dependencies even exist in nixpkgs yet and it's a bit of work to add the missing ones.

@FRidh
Copy link
Member

FRidh commented May 17, 2017

@jluttine while Nikola is indeed used as an application, I could very well imagine that users want to use it in conjunction with libraries that may be available only on certain Python python versions. This is also why pelican e.g. is inside python-packages.nix. Therefore, I recommend using buildPythonPackage and putting it in python-modules and calling it from python-packages.nix.

Regarding the extra dependencies. These are only Python libraries, right? In that case they can just use nix-shell or python.withPackages or python.buildEnv.

@FRidh FRidh added 6.topic: python 8.has: package (new) This PR adds a new package labels May 17, 2017
@jluttine
Copy link
Member Author

Ok, I'll make that fix (application -> module) today perhaps. Anyway, I couldn't get it working with Python 2 because Nix contains only Python 3 supported version of doit, which is a dependency of Nikola. Python 2 support would require older doit 0.29.0 (which on the other hand doesn't support Python 3.3). Is there any sensible way to support Python 2 then?

@FRidh
Copy link
Member

FRidh commented May 17, 2017

@jluttine doesn't seem like there is. You can disable it on Python 2.

@jluttine
Copy link
Member Author

I now made it a Python module instead of an application.

@jluttine
Copy link
Member Author

I also added an upgrade of a dependency ws4py because Nikola needed that in order to work properly. Ping @rickynils, the maintainer of ws4py.

@jluttine
Copy link
Member Author

Regarding doit Python 2 support, perhaps that nix definition should be written in such a way that if using Python 2, it would install a different version of itself. Or is that bad practice?

@jluttine
Copy link
Member Author

Oh, actually doit is a Python application, not a module..

@FRidh
Copy link
Member

FRidh commented May 17, 2017

@jluttine its an applicationt/tool, but in order to use it you need to write Python code, for which you need an environment where all libraries are compatible with eachother. Therefore, at least within Nixpkgs, its location is in python-packages.nix.

@jluttine
Copy link
Member Author

It seems that Nikola uses doit as a Python library, that is, it imports lots of stuff from it. So perhaps doit should be moved to Python modules? And then, Python 2 support could perhaps be gained by using different versions of doit for different Python versions within the doit nix definition.

@jluttine
Copy link
Member Author

I just rebased my commits on latest upstream/master. Is there something to fix or is this good to merge?

@FRidh FRidh merged commit 7d95431 into NixOS:master May 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 8.has: package (new) This PR adds a new package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants