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.aiomysql: fix dependency on PyMySQL #122126

Merged
merged 1 commit into from
May 8, 2021

Conversation

kalekseev
Copy link
Contributor

Motivation for this change

pythonPackages.databases tests break on import error https://hydra.nixos.org/build/142623477
ZHF: #122042

Applied patch from aio-libs/aiomysql@919b997 that just copy paste from:

  1. https://github.com/PyMySQL/PyMySQL/blob/37fd1e1b0126d75d80eef59c053f80634b09bd75/pymysql/connections.py#L96-L113
  2. https://github.com/PyMySQL/PyMySQL/blob/v0.10.1/pymysql/util.py
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.

@@ -18,6 +19,13 @@ buildPythonPackage rec {
sha256 = "1qvy3phbsxp55161dnppjfx2m1kn82v0irc3xzqw0adfd81vaiad";
};

patches = [
(fetchpatch {
url = "https://github.com/aio-libs/aiomysql/commit/919b997a9de7f53d721af76762fba425e306531e.patch";
Copy link
Member

@mweinelt mweinelt May 7, 2021

Choose a reason for hiding this comment

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

Please add a comment what the patch accomplishes.

Suggested change
url = "https://github.com/aio-libs/aiomysql/commit/919b997a9de7f53d721af76762fba425e306531e.patch";
# vendor functions previously provided by pymysql.util
# https://github.com/aio-libs/aiomysql/pull/554
url = "https://github.com/aio-libs/aiomysql/commit/919b997a9de7f53d721af76762fba425e306531e.patch";

Copy link
Contributor

Choose a reason for hiding this comment

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

would it be better to link to the patch such that it shows which fork the patch is from?

otherwise
image

Copy link
Member

Choose a reason for hiding this comment

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

Which is why I suggested adding the link to the pull request.

Copy link
Contributor

@rmcgibbo rmcgibbo May 7, 2021

Choose a reason for hiding this comment

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

My impression is that there's some concern from a security perspective about patches that appear as if they're from one repository, but are actually from a fork: #20836 (comment). In this case, there's no security issue, but in the future, nixpkgs-hammering might flag this as a possible issue: jtojnar/nixpkgs-hammering#96

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 if fork removed, are patch links immutable? Otherwise I would prefer to keep link to original repo

Copy link
Contributor

@rmcgibbo rmcgibbo May 7, 2021

Choose a reason for hiding this comment

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

Is there a pull request that this commit is part of?

Yes, changing it to https://github.com/aio-libs/aiomysql/pull/554/commits/919b997a9de7f53d721af76762fba425e306531e.patch would also be more clear.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

LGTM

failures are broken on target branch

https://github.com/NixOS/nixpkgs/pull/122126

2 packages failed to build:
python38Packages.fastapi python39Packages.fastapi

10 packages built:
python38Packages.aiomysql python38Packages.databases python38Packages.orm python38Packages.slack-sdk python38Packages.starlette python39Packages.aiomysql python39Packages.databases python39Packages.orm python39Packages.slack-sdk python39Packages.starlette

@jonringer jonringer merged commit b76bf3c into NixOS:master May 8, 2021
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.

4 participants