-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Python-kivy: init at 1.10.0 #29305
Python-kivy: init at 1.10.0 #29305
Conversation
buildPythonPackage rec { | ||
name = "Kivy-1.10.0"; | ||
|
||
src = pkgs.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
|
||
propagatedBuildInputs = with self; [ | ||
pillow | ||
pkgs.mtdev |
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 is this library propagated?
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 a mistake; I thought that would be helpful, but the actual fix was found later (https://groups.google.com/forum/#!topic/nix-devel/CPQKpM3u1EY), and I never downgraded to non-propagated. Will fix.
pkgs/top-level/python-packages.nix
Outdated
@@ -11176,6 +11176,29 @@ in { | |||
|
|||
keyring = callPackage ../development/python-modules/keyring { }; | |||
|
|||
kivy = callPackage ../development/python-modules/kivy { inherit stdenv buildPythonPackage maintainers platforms licenses pkgs self ; }; | |||
|
|||
kivygarden = 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.
in separate file
# assert stdenv.lib.versionOlder self.cython.version "0.25.3"; | ||
|
||
buildPythonPackage rec { | ||
name = "Kivy-1.10.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.
can you include pname
, version
, and ${pname}-${version}
as is now more commonly done.
pkgs/top-level/python-packages.nix
Outdated
# The sole reason for this package is that it is a (questionable) dependency of Kivy | ||
name = "kivy-garden-0.1.4"; | ||
|
||
src = pkgs.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/top-level/python-packages.nix
Outdated
|
||
kivygarden = buildPythonPackage rec { | ||
# The sole reason for this package is that it is a (questionable) dependency of Kivy | ||
name = "kivy-garden-0.1.4"; |
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.
same with pname and version
pkgs/top-level/python-packages.nix
Outdated
sha256 = "0wkcpr2zc1q5jb0bi7v2dgc0vs5h1y7j42mviyh764j2i0kz8mn2"; | ||
}; | ||
|
||
buildInputs = with self; [ requests ]; |
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 this not needed during runtime? Or is it needed for the tests? In case of the latter, use checkInputs
.
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.
It's needed during runtime.
kivy-garden is a "not invented here" package manager for kivy components, and as such uses requests
to fetch those components.
The real problem is that such a thing exists in the first place, and that it is an explicit dependency of Kivy. I'll talk with the kivy people about both of those issues.
In the meantime, given the fact that the present PR makes kivy-garden available, it should do so in a non-broken way, so I'll promote this to a propagatedBuildInput
As per the comments by @FRidh (once no more questions/remarks remain, I'll squash the commits into a single one)
@@ -0,0 +1,101 @@ | |||
{ stdenv, buildPythonPackage, fetchPypi, maintainers, platforms, licenses, pkgs, self }: |
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.
parameters are supposed to be individual functions or derivations, and not sets. Exceptions are stdenv
or lib
.
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'm having some trouble implementing this advice, and associated advice on given repeatedly below on how to remove the associated explicit parameter-setting on the calling side. Could you show me how it's done?
|
||
buildInputs = with self; [ | ||
pkgconfig | ||
cython |
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.
these two can be nativeBuildInputs
if I am correct.
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 am not confident that I understand the difference (see https://groups.google.com/forum/#!topic/nix-devel/Ad1b0RShe6k) and all other Python packages that I could find do in fact use buildInputs
here, so I'm a bit wary to proceed with this tip. Feel free to correct me if you're sure about this behavior though.
kivygarden # See https://github.com/kivy/kivy/issues/5367 suggestion I-2 | ||
requests # See https://github.com/kivy/kivy/issues/5367 suggestion I-3 | ||
docutils # See https://github.com/kivy/kivy/issues/5367 question Q-5 | ||
pygments # See https://github.com/kivy/kivy/issues/5367 question Q-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.
Are these 4 only needed during build time? Or during runtime? If the latter -> propagatedBuildInputs
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.
Regarding docutils: purely build time.
Regarding the rest: setup.py
refuses to install without these packages present, but they are fundamentally optional and (in the case of kivygarden especially) it's undesirable to pollute the runtime environment too much with their presence. If someone e.g. want the pygments
functionality at runtime, it's better to have them install this explicitly than to "pull in the world"
In short, I stand with the decision to have them be build time dependencies, but it's a bit of a judgement call.
# https://kivy.org/docs/installation/installation.html | ||
# https://kivy.org/docs/installation/installation-linux.html | ||
|
||
pkgs.mesa |
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.
get rid of pkgs
@@ -0,0 +1,25 @@ | |||
# The sole reason for this package is that it is a (questionable) dependency of Kivy | |||
{ buildPythonPackage, fetchPypi, maintainers, platforms, licenses, pkgs, self }: |
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.
same as the other
homepage = "https://pypi.python.org/pypi/kivy-garden"; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ vanschelven ]; | ||
platforms = platforms.unix; # Can only test linux; in principle other platforms are supported |
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.
buildPythonPackage
already sets platforms
homepage = "https://pypi.python.org/pypi/kivy"; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ vanschelven ]; | ||
platforms = platforms.unix; # I can only test linux; in principle other platforms are supported |
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.
buildPythonPackage
already sets platforms
@@ -11176,6 +11176,10 @@ in { | |||
|
|||
keyring = callPackage ../development/python-modules/keyring { }; | |||
|
|||
kivy = callPackage ../development/python-modules/kivy { inherit stdenv buildPythonPackage fetchPypi maintainers platforms licenses pkgs self ; }; |
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.
callPackage will populate the arguments automatically
@FRidh I've responded in the above remarking that I'm not confident enough in my knowledge of Nix packaging to push forwards from here. Any chance you could implement your own remarks/requests so that we can push this PR forward and get it accepted? |
I'm closing this pull request; it no longer works against the current version of master, and updating is non-trivial at the moment. I might reopen a similar request at a later point in time. |
Motivation for this change
Kivy is an Open source Python library for rapid development of applications
that make use of innovative user interfaces, such as multi-touch apps.
Most of Kivy's dependencies are optional, so defining a good "default" set of useful dependencies was a bit of a challenge. The present set of dependencies works well for me, but more dependencies, or even options for configuring the package, may be required in the future.
There is also some discussion at kivy/kivy#5367
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)