Skip to content

pyinotify: patch for python 3.12 support#325685

Merged
marcusramberg merged 2 commits into
NixOS:masterfrom
sarcasticadmin:rh/1720483816notify
Jul 15, 2024
Merged

pyinotify: patch for python 3.12 support#325685
marcusramberg merged 2 commits into
NixOS:masterfrom
sarcasticadmin:rh/1720483816notify

Conversation

@sarcasticadmin
Copy link
Copy Markdown
Member

@sarcasticadmin sarcasticadmin commented Jul 9, 2024

Description of changes

Fixes: #325514

asyncore was removed from the python-3.12 standard library: https://peps.python.org/pep-0594/

Adding backport to 24.05 since its broken there as well (see output below).

This patch was original sourced from: seb-m/pyinotify#205 Its seems like ipynotify is no longer maintained so I'm opting to include the patch here. This is similar to what Arch (https://gitlab.archlinux.org/archlinux/packaging/packages/python-pyinotify/-/commit/df875e727a19fb9e83d2af55cc5f368b94eec705) and Fedora (https://src.fedoraproject.org/rpms/python-inotify/pull-request/4) have done:

Testing pythonImportsCheck = [ pyinotify ] failing prior to patch on master:

$ nix build .#python3Packages.pyinotify
warning: Git tree '/home/rherna/workspace/nixpkgs' is dirty
error: builder for '/nix/store/c0ss5a6ypkaq8njck0ybjln7bfmpxih1-python3.12-pyinotify-0.9.6.drv' failed with exit code 1;
       last 10 log lines:
       >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
       >   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
       >   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
       >   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
       >   File "<frozen importlib._bootstrap_external>", line 995, in exec_module
       >   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
       >   File "/nix/store/wyynknrgd148f0g14faa4xxq9q3rbykn-python3.12-pyinotify-0.9.6/lib/python3.12/site-packages/pyinotify.py", line 71, in <module>
       >     import asyncore
       > ModuleNotFoundError: No module named 'asyncore'
       For full logs, run 'nix log /nix/store/c0ss5a6ypkaq8njck0ybjln7bfmpxih1-python3.12-pyinotify-0.9.6.drv'.

Testing the pythonImportsCheck = [ pyinotify ] against release-24.05 (acbecbb):

$ nix build .#python312Packages.pyinotify
error: builder for '/nix/store/q5m1hdazg071hhbqp8w6cj5s24m1582z-python3.12-pyinotify-0.9.6.drv' failed with exit code 1;
       last 10 log lines:
       >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
       >   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
       >   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
       >   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
       >   File "<frozen importlib._bootstrap_external>", line 995, in exec_module
       >   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
       >   File "/nix/store/4zrypdc8pz1dp4d9qjqfb19rn9qspb3j-python3.12-pyinotify-0.9.6/lib/python3.12/site-packages/pyinotify.py", line 71, in <module>
       >     import asyncore
       > ModuleNotFoundError: No module named 'asyncore'
       For full logs, run 'nix log /nix/store/q5m1hdazg071hhbqp8w6cj5s24m1582z-python3.12-pyinotify-0.9.6.drv'.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions Bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Jul 9, 2024
asyncore was removed from the python 3.12 standard library:
https://peps.python.org/pep-0594/

This patch was original sourced from:
seb-m/pyinotify#205
@ofborg ofborg Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Jul 9, 2024
@Luk45135
Copy link
Copy Markdown

Is this ready to merge?

Copy link
Copy Markdown
Contributor

@marcusramberg marcusramberg left a comment

Choose a reason for hiding this comment

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

I checked out this PR and tested that it fixes ulauncher which is currently broken in master due to pyinotify. lgtm

@marcusramberg marcusramberg merged commit 955abd6 into NixOS:master Jul 15, 2024
@github-actions
Copy link
Copy Markdown
Contributor

Successfully created backport PR for release-24.05:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: bug Something is broken 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auto-cpufreq has runtime error.

3 participants