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

python3Packages.kivy: init at 2.0.0 #104694

Merged
merged 2 commits into from Feb 18, 2021
Merged

Conversation

rissson
Copy link
Member

@rissson rissson commented Nov 23, 2020

Motivation for this change

Building on top of #29305, and finally having Kivy in nixpkgs!

I actually don't know how to test this work so I'm asking @vanschelven and @ddorn to help me out.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@rissson
Copy link
Member Author

rissson commented Nov 23, 2020

I chose to directly package Kivy 2.0.0rc4 because it supports cython 0.29.21, which is the version in nixpkgs.

@lukegb
Copy link
Contributor

lukegb commented Nov 23, 2020

For Kivy itself I think you're likely to also need pkg-config:

WARNING: A problem occurred while running pkg-config --libs --cflags gstreamer-1.0 (code 127)

b'/nix/store/516z50fm1jbpcl32qnzy7kynrh0vl22w-bash-4.4-p23/bin/sh: pkg-config: command not found\n'

WARNING: A problem occurred while running pkg-config --libs --cflags sdl2 SDL2_ttf SDL2_image SDL2_mixer (code 127)

b'/nix/store/516z50fm1jbpcl32qnzy7kynrh0vl22w-bash-4.4-p23/bin/sh: pkg-config: command not found\n'

WARNING: A problem occurred while running pkg-config --libs --cflags pangoft2 (code 127)

b'/nix/store/516z50fm1jbpcl32qnzy7kynrh0vl22w-bash-4.4-p23/bin/sh: pkg-config: command not found\n'

ERROR: Dependency for context.pyx not resolved: config.pxi

(I think you want pkg-config, not pkgconfig in nativeBuildInputs?)

@rissson
Copy link
Member Author

rissson commented Nov 23, 2020

(I think you want pkg-config, not pkgconfig in nativeBuildInputs?)

Yes indeed, it's weird it was building on my machine with nix-build . -A python3Packages.kivy but not when used in a project :/

@SuperSandro2000
Copy link
Member

I think you want pkg-config, not pkgconfig in nativeBuildInputs?)

pkgconfig is an alias of pkg-config and the later is preferred.

@lukegb
Copy link
Contributor

lukegb commented Nov 23, 2020

I think you want pkg-config, not pkgconfig in nativeBuildInputs?)

pkgconfig is an alias of pkg-config and the later is preferred.

I think one of the reasons for that is there's a separate Python module called "pkgconfig" which, err, does something different (so in the python-modules directory you end up with that instead, which doesn't work)

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 104694 run on x86_64-darwin 1

3 packages built:
  • python27Packages.kivy-garden
  • python37Packages.kivy-garden
  • python38Packages.kivy-garden

@vanschelven
Copy link
Contributor

vanschelven commented Nov 23, 2020 via email

@rissson
Copy link
Member Author

rissson commented Nov 23, 2020

It's now been tested with an application that actually uses it:
image
🎉

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

you may have to do some heavy patching for kivy to work well with nix (as in, patch all the locations, and potentially have to regenerate that patch every package update) as normal dll calls will not work.

pkgs/development/python-modules/kivy/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
@rissson rissson changed the title python3Packages.kivy-garden: init at 0.1.4 python3Packages.kivy: init at 2.0.0rc4 Nov 23, 2020
@rissson rissson force-pushed the kivy-2.0 branch 2 times, most recently from 950ae74 to d1e9a99 Compare November 23, 2020 20:34
@rissson
Copy link
Member Author

rissson commented Nov 23, 2020

you may have to do some heavy patching for kivy to work well with nix (as in, patch all the locations, and potentially have to regenerate that patch every package update) as normal dll calls will not work.

As far as I tested with a friend's project using this, it seems to work. It probably doesn't use all of Kivy's features though, so some stuff might be broken, but we can always open fixup PRs later on as we discover features that do not work.

@rissson rissson force-pushed the kivy-2.0 branch 2 times, most recently from b8948e8 to a537cf0 Compare November 23, 2020 21:30
@rissson
Copy link
Member Author

rissson commented Nov 23, 2020

I think this is now ready.

@rissson rissson requested review from jonringer and removed request for vanschelven November 23, 2020 21:34
@rissson rissson changed the title python3Packages.kivy: init at 2.0.0rc4 python3Packages.kivy: init at 2.0.0 Dec 17, 2020
@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 104694 run on x86_64-linux 1

6 packages built:
  • python37Packages.kivy
  • python37Packages.kivy-garden
  • python38Packages.kivy
  • python38Packages.kivy-garden
  • python39Packages.kivy
  • python39Packages.kivy-garden

kivy-garden

Ran 0 tests in 0.000s

Please fix that no tests are run or disable them and add a pythonImportCheck.

@rissson
Copy link
Member Author

rissson commented Dec 27, 2020

Please fix that no tests are run or disable them and add a pythonImportCheck.

Done!

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 104694 run on x86_64-linux 1

6 packages built:
  • python37Packages.kivy
  • python37Packages.kivy-garden
  • python38Packages.kivy
  • python38Packages.kivy-garden
  • python39Packages.kivy
  • python39Packages.kivy-garden

@OmnipotentEntity
Copy link
Contributor

What is remaining on this PR prior to merging?

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

@ofborg eval

pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 104694 run on x86_64-linux 1

6 packages built:
  • python37Packages.kivy
  • python37Packages.kivy-garden
  • python38Packages.kivy
  • python38Packages.kivy-garden
  • python39Packages.kivy
  • python39Packages.kivy-garden

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:

python37Packages.kivy-garden:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

  • Tell pytest(CheckHook) where to find the tests included in the package
  • Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
  • If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.
python37Packages.kivy:

A typo in pythonImportsCheck got detected.

python38Packages.kivy-garden:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

  • Tell pytest(CheckHook) where to find the tests included in the package
  • Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
  • If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.
python38Packages.kivy:

A typo in pythonImportsCheck got detected.

python39Packages.kivy-garden:

Zero tests run by pytest got detected: 'Ran 0 tests in 0.000s'
You have the following options to fix this:

  • Tell pytest(CheckHook) where to find the tests included in the package
  • Check if the GitHub Repo contains tests but they are not shipped with Pypi. If so please switch to fetchFromGitHub.
  • If the Packages does not contain any tests add 'doCheck = false;' and a pythonImportsCheck.
python39Packages.kivy:

A typo in pythonImportsCheck got detected.

@rissson rissson force-pushed the kivy-2.0 branch 3 times, most recently from 91dc52b to e6de987 Compare February 12, 2021 01:08
@rissson
Copy link
Member Author

rissson commented Feb 12, 2021

I fixed the typo in pythonImportsCheck for kivy.

@rissson
Copy link
Member Author

rissson commented Feb 12, 2021

Result of nixpkgs-review pr 104694 run on x86_64-linux 1

6 packages built:
  • python37Packages.kivy
  • python37Packages.kivy-garden
  • python38Packages.kivy
  • python38Packages.kivy-garden
  • python39Packages.kivy
  • python39Packages.kivy-garden

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

There is still the zero tests run by kiva-garden. After that this should be good to go.

@rissson
Copy link
Member Author

rissson commented Feb 13, 2021

The pythonImportsCheckPhase is indeed ran, however there are no tests in the archive from Pypi. I very much don't want to fetch this package from github as it is split in multiple repos and don't want to have the burden of checking them all to update this package. Plus, it uses the buildozer tool which I know nothing about.

@SuperSandro2000
Copy link
Member

The pythonImportsCheckPhase is indeed ran, however there are no tests in the archive from Pypi. I very much don't want to fetch this package from github as it is split in multiple repos and don't want to have the burden of checking them all to update this package. Plus, it uses the buildozer tool which I know nothing about.

fine for me. Then just add doCheck = false; and a comment that building from source was not feasible because of buildozer and multiple repos.

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
@rissson
Copy link
Member Author

rissson commented Feb 15, 2021

fine for me. Then just add doCheck = false; and a comment that building from source was not feasible because of buildozer and multiple repos.

Done!

@OmnipotentEntity
Copy link
Contributor

Thank you for taking the time to package this! I'll be using it later.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 104694 run on x86_64-linux 1

6 packages built:
  • python37Packages.kivy
  • python37Packages.kivy-garden
  • python38Packages.kivy
  • python38Packages.kivy-garden
  • python39Packages.kivy
  • python39Packages.kivy-garden

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:

python37Packages.kivy:

Unused argument: fetchpatch.
Near pkgs/development/python-modules/kivy/default.nix:2:34:

  |
2 | , buildPythonPackage, fetchPypi, fetchpatch
  |                                  ^

Unused argument: pytestCheckHook.
Near pkgs/development/python-modules/kivy/default.nix:7:3:

  |
7 | , pytestCheckHook
  |   ^
python38Packages.kivy:

Unused argument: fetchpatch.
Near pkgs/development/python-modules/kivy/default.nix:2:34:

  |
2 | , buildPythonPackage, fetchPypi, fetchpatch
  |                                  ^

Unused argument: pytestCheckHook.
Near pkgs/development/python-modules/kivy/default.nix:7:3:

  |
7 | , pytestCheckHook
  |   ^
python39Packages.kivy:

Unused argument: fetchpatch.
Near pkgs/development/python-modules/kivy/default.nix:2:34:

  |
2 | , buildPythonPackage, fetchPypi, fetchpatch
  |                                  ^

Unused argument: pytestCheckHook.
Near pkgs/development/python-modules/kivy/default.nix:7:3:

  |
7 | , pytestCheckHook
  |   ^

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 104694 run on x86_64-darwin 1

3 packages marked as broken and skipped:
  • python37Packages.kivy
  • python38Packages.kivy
  • python39Packages.kivy
3 packages built:
  • python37Packages.kivy-garden
  • python38Packages.kivy-garden
  • python39Packages.kivy-garden

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 104694 run on x86_64-linux 1

6 packages built:
  • python37Packages.kivy
  • python37Packages.kivy-garden
  • python38Packages.kivy
  • python38Packages.kivy-garden
  • python39Packages.kivy
  • python39Packages.kivy-garden

@SuperSandro2000 SuperSandro2000 merged commit 87abd5c into NixOS:master Feb 18, 2021
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