Skip to content

pgadmin4: 7.5 -> 7.6#251936

Closed
gador wants to merge 1 commit intoNixOS:masterfrom
gador:pgadmin-7.6
Closed

pgadmin4: 7.5 -> 7.6#251936
gador wants to merge 1 commit intoNixOS:masterfrom
gador:pgadmin-7.6

Conversation

@gador
Copy link
Member

@gador gador commented Aug 28, 2023

Description of changes

Release notes

Due to this commit pgadmin-org/pgadmin4@34f160c, pgadmin4 module now fails to start with a circular import:

pgadmin-pre-start[835]: Traceback (most recent call last):
pgadmin-pre-start[835]:   File "/nix/store/l9swdlqfywcbi03yp0drxadxpbrk2jqv-pgadmin-7.6/bin/.pgadmin4-setup-wrapped", line 6, in <module>
pgadmin-pre-start[835]:     from pgadmin4.setup import main
pgadmin-pre-start[835]:   File "/nix/store/l9swdlqfywcbi03yp0drxadxpbrk2jqv-pgadmin-7.6/lib/python3.10/site-packages/pgadmin4/setup.py", line 31, in <module>
pgadmin-pre-start[835]:     from pgadmin.model import db, Version, SCHEMA_VERSION as CURRENT_SCHEMA_VERSION
pgadmin-pre-start[835]:   File "/nix/store/l9swdlqfywcbi03yp0drxadxpbrk2jqv-pgadmin-7.6/lib/python3.10/site-packages/pgadmin4/pgadmin/__init__.py", line 39, in <module>
pgadmin-pre-start[835]:     from pgadmin.model import db, Role, Server, SharedServer, ServerGroup, 
pgadmin-pre-start[835]:   File "/nix/store/l9swdlqfywcbi03yp0drxadxpbrk2jqv-pgadmin-7.6/lib/python3.10/site-packages/pgadmin4/pgadmin/model/__init__.py", line 26, in <module>
pgadmin-pre-start[835]:     import config
pgadmin-pre-start[835]:   File "/nix/store/l9swdlqfywcbi03yp0drxadxpbrk2jqv-pgadmin-7.6/lib/python3.10/site-packages/pgadmin4/config.py", line 32, in <module>
pgadmin-pre-start[835]:     from pgadmin.utils import env, IS_WIN, fs_short_path
pgadmin-pre-start[835]:   File "/nix/store/l9swdlqfywcbi03yp0drxadxpbrk2jqv-pgadmin-7.6/lib/python3.10/site-packages/pgadmin4/pgadmin/utils/__init__.py", line 23, in <module>
pgadmin-pre-start[835]:     from .paths import get_storage_directory
pgadmin-pre-start[835]:   File "/nix/store/l9swdlqfywcbi03yp0drxadxpbrk2jqv-pgadmin-7.6/lib/python3.10/site-packages/pgadmin4/pgadmin/utils/paths.py", line 18, in <module>
pgadmin-pre-start[835]:     from pgadmin.model import User
pgadmin-pre-start[835]: ImportError: cannot import name 'User' from partially initialized module 'pgadmin.model' (most likely due to a circular import) (/nix/store/l9swdlqfywcbi03yp0drxadxpbrk2jqv-pgadmin-7.6/lib/python3.10/site-packages/pgadmin4/pgadmin/model/__init__.py)
systemd[1]: pgadmin.service: Control process exited, code=exited, status=1/FAILURE

We change upstreams code to better work with our systemd service and expose the main function (in #161521). This somehow caused the above error to happen.

I have tinkered with it quite a bit, but I haven't found a solution to not have a circular import without having to re-write upstreams layout. IMHO config.py should only serve constants and not also import functions. Especially when those functions (as in this case model) tries to import its upstream module.

In any case, I altered umpstreams changes to pass the default values to pool_size and max_overflow.
The cause of the upstream change is outlined here (pgadmin-org/pgadmin4#6208). If you face the same problems, please comment here.

I am open to suggestions to add a different workaround. If no other viable solution can be found, I don't think using the defaults will cause much trouble either.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.11 Release Notes (or backporting 23.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.

@ofborg ofborg bot added 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Aug 28, 2023
@gador
Copy link
Member Author

gador commented Aug 28, 2023

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

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

4 packages built:
  • pgadmin4
  • pgadmin4-desktopmode
  • pgadmin4-desktopmode.dist
  • pgadmin4.dist

@matthiasbeyer
Copy link
Contributor

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

4 packages built:
  • pgadmin4
  • pgadmin4-desktopmode
  • pgadmin4-desktopmode.dist
  • pgadmin4.dist

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
@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/2668

@gador gador mentioned this pull request Sep 24, 2023
12 tasks
@gador
Copy link
Member Author

gador commented Sep 24, 2023

superseeded by #257119

@gador gador closed this Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants