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

pyinotify: patch for python 3.12 support #325685

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

sarcasticadmin
Copy link
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.

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
@Luk45135
Copy link

Is this ready to merge?

Copy link
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
44 checks passed
Copy link
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto-cpufreq has runtime error.
3 participants