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

calibre 4.23.0 -> 5.10.1 #106550

Merged
merged 2 commits into from Jan 30, 2021
Merged

calibre 4.23.0 -> 5.10.1 #106550

merged 2 commits into from Jan 30, 2021

Conversation

eduardosm
Copy link
Contributor

@eduardosm eduardosm commented Dec 10, 2020

Motivation for this change
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.

@ento
Copy link
Contributor

ento commented Dec 30, 2020

-c: Q_PID is undefined

I was able to get past this error by specifying the appropriate platform tag: ento@e9969b9 (only tested the WS_X11 case locally)

Q_PID is typedef'd based on the active platform tag (note: the linked repo is a mirror):
https://github.com/baoboa/pyqt5/blob/25bdb92c38d9c0a915c6366769cc00a63a1f04b2/sip/QtCore/qprocess.sip#L23-L32

I'm not sure how Calibre's build system is bypassing/specifying this. (Nor am I entirely sure if this is the right approach. Specifying the platform tag was the suggested fix 15 years ago.)


Another fix before nix-build succeeded: add zeroconf to dependencies: ento@783b0ff

This was to address "No module named 'zeroconf'"
Installing binary: /nix/store/v4y8lz7k9qx8swqwk84d3ga0xn4cxcgr-calibre-5.6.0/bin/ebook-edit
Installing calibre environment module: /nix/store/v4y8lz7k9qx8swqwk84d3ga0xn4cxcgr-calibre-5.6.0/lib/python3.8/site-packages/init_calibre.py
Traceback (most recent call last):
  File "setup.py", line 119, in <module>
    sys.exit(main())
  File "setup.py", line 104, in main
    command.run_all(opts)
  File "/tmp/nix-build-calibre-5.6.0.drv-0/calibre-5.6.0/setup/__init__.py", line 203, in run_all
    self.run_cmd(self, opts)
  File "/tmp/nix-build-calibre-5.6.0.drv-0/calibre-5.6.0/setup/__init__.py", line 199, in run_cmd
    cmd.run(opts)
  File "/tmp/nix-build-calibre-5.6.0.drv-0/calibre-5.6.0/setup/install.py", line 150, in run
    self.run_postinstall()
  File "/tmp/nix-build-calibre-5.6.0.drv-0/calibre-5.6.0/setup/install.py", line 173, in run_postinstall
    from calibre.linux import PostInstall
  File "/tmp/nix-build-calibre-5.6.0.drv-0/calibre-5.6.0/src/calibre/linux.py", line 13, in <module>
    from calibre.customize.ui import all_input_formats
  File "/tmp/nix-build-calibre-5.6.0.drv-0/calibre-5.6.0/src/calibre/customize/ui.py", line 18, in <module>
    from calibre.customize.builtins import plugins as builtin_plugins
  File "/tmp/nix-build-calibre-5.6.0.drv-0/calibre-5.6.0/src/calibre/customize/builtins.py", line 748, in <module>
    from calibre.devices.smart_device_app.driver import SMART_DEVICE_APP
  File "/tmp/nix-build-calibre-5.6.0.drv-0/calibre-5.6.0/src/calibre/devices/smart_device_app/driver.py", line 2044, in <module>
    from zeroconf import (BadTypeInNameException, _HAS_A_TO_Z,
ModuleNotFoundError: No module named 'zeroconf'
builder for '/nix/store/1j58awdflb3nkdjs91fp9x11n0s02b0s-calibre-5.6.0.drv' failed with exit code 1

Another fix before I was able to launch calibre: update PyQt5 to use sip5: ento@5d60a5c

This was to address "RuntimeError: the sip module implements API v12.0 to v12.7 but the progress_indicator module requires API v12.8"
$ result/bin/calibre
Traceback (most recent call last):
  File "/nix/store/xdqpn3wbz9c01fbpz70q1gr8khww7hhd-calibre-5.6.0/bin/.calibre-wrapped", line 21, in <module>
    sys.exit(calibre())
  File "/nix/store/xdqpn3wbz9c01fbpz70q1gr8khww7hhd-calibre-5.6.0/lib/calibre/calibre/gui_launch.py", line 73, in calibre
    main(args)
  File "/nix/store/xdqpn3wbz9c01fbpz70q1gr8khww7hhd-calibre-5.6.0/lib/calibre/calibre/gui2/main.py", line 510, in main
    app, opts, args = init_qt(args)
  File "/nix/store/xdqpn3wbz9c01fbpz70q1gr8khww7hhd-calibre-5.6.0/lib/calibre/calibre/gui2/main.py", line 123, in init_qt
    app = Application(args, override_program_name=override, windows_app_uid=MAIN_APP_UID)
  File "/nix/store/xdqpn3wbz9c01fbpz70q1gr8khww7hhd-calibre-5.6.0/lib/calibre/calibre/gui2/__init__.py", line 886, in __init__
    from calibre_extensions import progress_indicator
RuntimeError: the sip module implements API v12.0 to v12.7 but the progress_indicator module requires API v12.8

^That commit shouldn't be used as-is - there's already a draft PR that updates sip to 5.x and I think we should coordinate with @FRidh on how to do it (whether to add a new pythonPackages.sip5 package etc).

@hpfr
Copy link

hpfr commented Dec 30, 2020

However, I've managed to side-track myself with trying to get Calibre 5 working in Nix (whoops).

@mexisme Just saw your comment in the linux-surface PR. Coincidentally I just searched for Calibre updates in nixpkgs a couple days ago. The people here might have work you can use, in case you didn't see this? :)

@eduardosm
Copy link
Contributor Author

@ento Thanks for looking into this. I was able to build and run calibre 5.6 from your calibre5-pyqt5-sip5 branch, so I guess the next step is to decide what to do with sip5.

@mexisme
Copy link

mexisme commented Dec 30, 2020

However, I've managed to side-track myself with trying to get Calibre 5 working in Nix (whoops).

@mexisme Just saw your comment in the linux-surface PR. Coincidentally I just searched for Calibre updates in nixpkgs a couple days ago. The people here might have work you can use, in case you didn't see this? :)

Thanks,@hpfr.
I think I've mostly worked out that a bunch of PyQt packages need updating.

@mexisme
Copy link

mexisme commented Dec 30, 2020

Just an FYI: I've been working on building Calibre 5.81 in a personal overlay with personal packages, and have gotten sip5, pyqt-builder and pyqt5-sip building easily with fetchPypi.
It looks like my last hurdle is getting PyQt5 package to use the newer sip5 — seems like PyQt might be sensitive to packages it depends on being the exact same versions, even if they look independent, and you get some misdirecting errors from the Python imports.

I was going to move from my personal packages into a nixpkgs fork to solve this, as it was just getting too messy.

@hpfr kindly pointed this PR to me, and wondered if anyone's interested in help?

@eduardosm eduardosm changed the title [WIP, need help] calibre 4.23.0 -> 5.6.0 [WIP] calibre 4.23.0 -> 5.8.1 Dec 30, 2020
@eduardosm
Copy link
Contributor Author

Just an FYI: I've been working on building Calibre 5.81 in a personal overlay with personal packages, and have gotten sip5, pyqt-builder and pyqt5-sip building easily with fetchPypi.
It looks like my last hurdle is getting PyQt5 package to use the newer sip5 — seems like PyQt might be sensitive to packages it depends on being the exact same versions, even if they look independent, and you get some misdirecting errors from the Python imports.

I was going to move from my personal packages into a nixpkgs fork to solve this, as it was just getting too messy.

@hpfr kindly pointed this PR to me, and wondered if anyone's interested in help?

This PR now builds thanks to @ento's commits. The next step is to decide what to do with sip. This PR keeps sip version 4 and adds sip5 as a new package, but there is also a PR that just replaces sip 4 with sip 5.

@mexisme
Copy link

mexisme commented Dec 30, 2020

This PR now builds thanks to @ento's commits.

Brilliant, and thanks for your efforts!
And good timing for me — I can skip some work!

The next step is to decide what to do with sip. This PR keeps sip version 4 and adds sip5 as a new package, but there is also a PR that just replaces sip 4 with sip 5.

That's good to see; sip4 doesn't seem to be supported upstream, any more.

@eduardosm eduardosm changed the title [WIP] calibre 4.23.0 -> 5.8.1 [WIP] calibre 4.23.0 -> 5.9.0 Jan 13, 2021
@eduardosm eduardosm mentioned this pull request Jan 13, 2021
10 tasks
@AndersonTorres
Copy link
Member

Can we close this?

@eduardosm
Copy link
Contributor Author

Can we close this?

This is waiting for #108041, I will un-draft this PR when it gets merged.

@cole-h
Copy link
Member

cole-h commented Jan 24, 2021

FYI: #108041 was just merged.

@eduardosm eduardosm changed the title [WIP] calibre 4.23.0 -> 5.9.0 [WIP] calibre 4.23.0 -> 5.10.1 Jan 24, 2021
@eduardosm eduardosm changed the title [WIP] calibre 4.23.0 -> 5.10.1 calibre 4.23.0 -> 5.10.1 Jan 24, 2021
@eduardosm eduardosm marked this pull request as ready for review January 24, 2021 23:23
@eduardosm
Copy link
Contributor Author

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

4 packages built:
  • calibre
  • python37Packages.pyqt-builder
  • python38Packages.pyqt-builder
  • python39Packages.pyqt-builder

@eduardosm
Copy link
Contributor Author

What's going on with grahamcofborg-eval? It's been pending for 12 hours.

@SuperSandro2000
Copy link
Member

@ofborg eval

@SuperSandro2000
Copy link
Member

I think it would be a good idea if someone who has experience with calibre could look at this and confirm that everything is looking good.

Copy link
Member

@hugolgst hugolgst left a comment

Choose a reason for hiding this comment

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

Overall it looks good to me.


meta = with lib; {
description = "PEP 517 compliant build system for PyQt";
homepage = "https://pypi.org/project/PyQt-builder/";
Copy link
Member

Choose a reason for hiding this comment

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

I would not indent like that but it is a detail.

Copy link
Member

Choose a reason for hiding this comment

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

Unindent this. We don't need pretty-prinmting, seriously.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean with "indent"?

Copy link
Member

Choose a reason for hiding this comment

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

I'd assume they're talking about the alignment (where the equal signs are all lined up).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove it, but I've seen many packages that way.

description = "PEP 517 compliant build system for PyQt";
homepage = "https://pypi.org/project/PyQt-builder/";
license = licenses.gpl3Only;
platforms = platforms.all;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
platforms = platforms.all;

Set by buildPythonPackage to the correct platforms.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@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 106550 run on x86_64-darwin 1

3 packages built:
  • python37Packages.pyqt-builder
  • python38Packages.pyqt-builder
  • python39Packages.pyqt-builder

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

python37Packages.pyqt-builder:

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.pyqt-builder:

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.pyqt-builder:

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.

@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 106550 run on x86_64-linux 1

4 packages built:
  • calibre
  • python37Packages.pyqt-builder
  • python38Packages.pyqt-builder
  • python39Packages.pyqt-builder

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

python37Packages.pyqt-builder:

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.pyqt-builder:

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.pyqt-builder:

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.

eduardosm and others added 2 commits January 29, 2021 11:23
Co-authored-by: ento <ento+github@i.pearlwaffles.xyz>
Co-authored-by: Eduardo Sánchez Muñoz <esm@eduardosm.net>
@eduardosm
Copy link
Contributor Author

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`.

Fixed

@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 106550 run on x86_64-linux 1

4 packages built:
  • calibre
  • python37Packages.pyqt-builder
  • python38Packages.pyqt-builder
  • python39Packages.pyqt-builder

@SuperSandro2000 SuperSandro2000 merged commit 3d7c3d1 into NixOS:master Jan 30, 2021
@eduardosm eduardosm deleted the calibre branch February 5, 2021 14:45
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

9 participants