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

python312Packages.google-cloud-documentai: init at 3.1.0 #376392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AdrienLemaire
Copy link

@AdrienLemaire AdrienLemaire commented Jan 24, 2025

Newbie learning NixOS and how to submit a new package.
I'm not sure how to test it in local given there's a generator to build this package for different python versions.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jan 24, 2025
@AdrienLemaire AdrienLemaire force-pushed the google-cloud-documentai branch from d915c7c to 6fdad28 Compare January 24, 2025 14:10
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 24, 2025
@AdrienLemaire AdrienLemaire force-pushed the google-cloud-documentai branch from 6fdad28 to a6a48e9 Compare January 24, 2025 14:22
@nix-owners nix-owners bot requested a review from natsukium January 24, 2025 14:24
pname = "google_cloud_documentai";
inherit version;
# https://pypi.org/project/google-cloud-documentai/3.1.0/#google_cloud_documentai-3.1.0.tar.gz
hash = "sha256-7b156175efe99cc4faafc81beefe4a7867fd54b827ba5ca40c7e8f7d9cd4b525";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
hash = "sha256-7b156175efe99cc4faafc81beefe4a7867fd54b827ba5ca40c7e8f7d9cd4b525";
hash = "";

It's better to use the sri hash, you can find it from the error message of the build

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review @aucub, I tried to fix most of them.

Still unsure about this one though, here's what I tried:

nixpkgs on  google-cloud-documentai [!+⇣]  nix-prefetch-url --unpack https://files.pythonhosted.org/packages/f5/88/cad7f02dfb00eea0b9e58c94a7778db466511dea06d7f4ca6ce3ef68da1c/google_cloud_documentai-3.1.0.tar.gz --type sha256
path is '/nix/store/01zh3r1h7ng355f44q8qy9db2qw021sa-google_cloud_documentai-3.1.0.tar.gz'
0q4zallgs8l0yc0ipw5zfha1czw682yxw1azlkirdnj3afw59f3r

nixpkgs on  google-cloud-documentai  nix-build -A python312Packages.google-cloud-documentai

error:
        while evaluating the attribute 'drvPath'
         at /home/dori/Projects/3rdPart/nix/nixpkgs/lib/customisation.nix:418:7:
          417|     // {
          418|       drvPath =
             |       ^
          419|         assert condition;

        while evaluating the attribute 'drvPath'
         at /home/dori/Projects/3rdPart/nix/nixpkgs/lib/customisation.nix:418:7:
          417|     // {
          418|       drvPath =
             |       ^
          419|         assert condition;

        while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: invalid SRI hash '0q4zallgs8l0yc0ipw5zfha1czw682yxw1azlkirdnj3afw59f3r'

Not sure if I got the wrong hash or the wrong way to build the package.

Copy link
Contributor

Choose a reason for hiding this comment

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

hash = "sha256-exVhde/pnMT6r8gb7v5KeGf9VLgnulykDH6PfZzUtSU=";

Copy link
Author

Choose a reason for hiding this comment

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

Indeed. Thank you.
What command did you run ?

Copy link
Contributor

Choose a reason for hiding this comment

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

When using nix build, you can typically leave hash = ""; empty. The actual hash will be provided in the error message. You can then convert the SHA256 hash to an SRI hash using the command: nix hash convert --hash-algo sha256 --to sri.

pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
@aucub
Copy link
Contributor

aucub commented Jan 24, 2025

pr title and commit message shoudle be python312Packages.google-cloud-documentai: init at 3.1.0

@AdrienLemaire AdrienLemaire changed the title google-cloud-documentai: init python312Packages.google-cloud-documentai: init at 3.1.0 Jan 24, 2025
@AdrienLemaire AdrienLemaire force-pushed the google-cloud-documentai branch from a6a48e9 to 7365519 Compare January 24, 2025 20:13
@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Jan 24, 2025
@AdrienLemaire AdrienLemaire force-pushed the google-cloud-documentai branch from 7365519 to fcf82f7 Compare January 24, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants