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.asyncpg: fix build and bump minimum Python version #294645

Merged
merged 1 commit into from Mar 20, 2024

Conversation

wackbyte
Copy link
Contributor

@wackbyte wackbyte commented Mar 10, 2024

Description of changes

I added the package's dependency on async-timeout. Because it was missing, attempting to build it with Python <=3.10 resulted in this error.

Running phase: pythonImportsCheckPhase
Executing pythonImportsCheckPhase
Check whether the following modules can be imported: asyncpg
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <lambda>
  File "/nix/store/9d1gknfymymdfm8fwry11vxvh80q7sj6-python3-3.10.13/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/nix/store/3x47wzy9rk0gdf9lc4ryy6kmr3xq5cl4-python3.10-asyncpg-0.29.0/lib/python3.10/site-packages/asyncpg/__init__.py", line 8, in <module>
    from .connection import connect, Connection  # NOQA
  File "/nix/store/3x47wzy9rk0gdf9lc4ryy6kmr3xq5cl4-python3.10-asyncpg-0.29.0/lib/python3.10/site-packages/asyncpg/connection.py", line 24, in <module>
    from . import compat
  File "/nix/store/3x47wzy9rk0gdf9lc4ryy6kmr3xq5cl4-python3.10-asyncpg-0.29.0/lib/python3.10/site-packages/asyncpg/compat.py", line 53, in <module>
    from ._asyncio_compat import wait_for as wait_for  # noqa: F401
  File "/nix/store/3x47wzy9rk0gdf9lc4ryy6kmr3xq5cl4-python3.10-asyncpg-0.29.0/lib/python3.10/site-packages/asyncpg/_asyncio_compat.py", line 13, in <module>
    from async_timeout import timeout as timeout_ctx
ModuleNotFoundError: No module named 'async_timeout'

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.05 Release Notes (or backporting 23.05 and 23.11 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.

@wackbyte
Copy link
Contributor Author

wackbyte commented Mar 10, 2024

Result of nixpkgs-review run on x86_64-linux 1

6 packages failed to build:
  • khoj
  • khoj.dist
  • python311Packages.ormar
  • python311Packages.ormar.dist
  • python312Packages.ormar
  • python312Packages.ormar.dist
28 packages built:
  • heisenbridge
  • heisenbridge.dist
  • maubot (python311Packages.maubot)
  • maubot.dist (python311Packages.maubot.dist)
  • mautrix-facebook
  • mautrix-facebook.dist
  • mautrix-googlechat
  • mautrix-googlechat.dist
  • mautrix-telegram
  • mautrix-telegram.dist
  • python311Packages.asyncpg
  • python311Packages.asyncpg.dist
  • python311Packages.mautrix (python311Packages.mautrix-appservice)
  • python311Packages.mautrix.dist (python311Packages.mautrix-appservice.dist)
  • python311Packages.orm
  • python311Packages.orm.dist
  • python311Packages.pgvector
  • python311Packages.pgvector.dist
  • python312Packages.asyncpg
  • python312Packages.asyncpg.dist
  • python312Packages.mautrix (python312Packages.mautrix-appservice)
  • python312Packages.mautrix.dist (python312Packages.mautrix-appservice.dist)
  • python312Packages.orm
  • python312Packages.orm.dist
  • python312Packages.pgvector
  • python312Packages.pgvector.dist
  • sourcehut.listssrht
  • sourcehut.listssrht.dist

The build failures are unrelated to this PR (they fail to build on master as well), so I think those packages are broken.

@sikmir
Copy link
Member

sikmir commented Mar 10, 2024

But latest build https://hydra.nixos.org/build/252816345 is OK. What is broken?

@wackbyte
Copy link
Contributor Author

wackbyte commented Mar 10, 2024

It seems like it doesn't fail in python312 and python311, but it does fail in python310 and python39 (and possibly more). I couldn't find a python310 build of the package in Hydra.

@wackbyte
Copy link
Contributor Author

wackbyte commented Mar 11, 2024

It's failing in versions prior to 3.11 specifically because of this compatibility code that imports async-timeout for older versions of Python.

@wackbyte
Copy link
Contributor Author

Ah, looks like the minimum Python version was also bumped from 3.7 to 3.8. I'll add that later.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3621

@wackbyte wackbyte changed the title pythonPackages.asyncpg: fix build pythonPackages.asyncpg: fix build and bump minimum Python version Mar 12, 2024
…n version

add the required dependency async-timeout for Python older than 3.11
@SuperSandro2000 SuperSandro2000 changed the title pythonPackages.asyncpg: fix build and bump minimum Python version python3Packages.asyncpg: fix build and bump minimum Python version Mar 20, 2024
@SuperSandro2000
Copy link
Member

@ofborg build python3Packages.asyncpg

@SuperSandro2000 SuperSandro2000 merged commit 5cffd60 into NixOS:master Mar 20, 2024
24 of 26 checks passed
@wackbyte wackbyte deleted the fix-asyncpg branch March 20, 2024 13:51
abathur pushed a commit to abathur/nixpkgs that referenced this pull request Mar 22, 2024
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

4 participants