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

noto-fonts: use poetry2nix for python build dependencies #96706

Closed
wants to merge 1 commit into from

Conversation

Profpatsch
Copy link
Member

The python dependencies are only used during the build of the font
artifacts, so instead of having to manually package the transitive
dependency graph for every single update, let’s just use a poetry lock
file that can be bumped semi-automatically.

Motivation for this change
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.

The python dependencies are only used during the build of the font
artifacts, so instead of having to manually package the transitive
dependency graph for every single update, let’s just use a poetry lock
file that can be bumped semi-automatically.
@FRidh
Copy link
Member

FRidh commented Aug 31, 2020

Where does this dependency specification come from? Not from https://github.com/googlefonts/noto-fonts.

I find it absurd to use poetry2nix for such a trivial package in Nixpkgs.

@Profpatsch
Copy link
Member Author

Where does this dependency specification come from? Not from https://github.com/googlefonts/noto-fonts.

It is just the requirements.txt converted to a trivial poetry package toml file. (I used cat requirements.txt | poetry add which worked just as expected.)

I find it absurd to use poetry2nix for such a trivial package in Nixpkgs.

I find it absurd that @sternenseemann had to spend hours bumping python dependencies for #96315 (review)

This PR took me literally 10 minutes to write, everything is automated by poetry2nix.

@sternenseemann
Copy link
Member

Well, the deed is done already, so not much point in reverting all the work. Bumping these mostly trivial packages won't be too much effort presumably.

Also with poetry2nix we lose the test suites of the dependencies which are pretty extensive and thus a blessing when packaging python packages for nix.

@Profpatsch
Copy link
Member Author

Also with poetry2nix we lose the test suites of the dependencies which are pretty extensive and thus a blessing when packaging python packages for nix.

I wonder what the story with test-suites in poetry2nix is @adisbladis. They are probably disabled by default because python packages like to do network I/O in their tests?

@adisbladis
Copy link
Member

I wonder what the story with test-suites in poetry2nix is

Poetry only puts run-time dependencies in poetry.lock, that's why we're defaulting to disabled tests.

@Profpatsch
Copy link
Member Author

I don’t think tests for library dependencies are particularly relevant to the build tool. We should move towards a poetry-based approach for python-built binaries somewhat soon imho, since the maintenance effort for pythonPackages is immense. But I don’t have a big horse in the game.

@Profpatsch Profpatsch closed this Sep 17, 2020
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