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

Update flake for new mailcap dependency #1685

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
# get a list of python packages by name, used to get the nix packages
# for the dependency names from the pyproject file
getPkgs = names: builtins.attrValues (pkgs.lib.attrsets.getAttrs names pkgs.python3Packages);
# extract the python dependencies from the pyprojec file, cut the version constraint
dependencies' = pkgs.lib.lists.concatMap (builtins.match "([^>=<]*).*") pyproject.project.dependencies;
# extract the python dependencies from the pyprojec file, cut the version constraints
dependencies' = pkgs.lib.lists.concatMap (builtins.match "([^>=<;]*).*") pyproject.project.dependencies;
# the package is called gpg on PyPI but gpgme in nixpkgs
dependencies = map (x: if x == "gpg" then "gpgme" else x) dependencies';
renameGPG = x: if x == "gpg" then "gpgme" else x;
# mailcap has been removed from the stdlib in py3.13 and needs to be
# fetched from pypi
withMailcap = x: (pkgs.lib.strings.versionOlder "3.12" pkgs.python3.version) || (x != "standard-mailcap");
dependencies = map renameGPG (builtins.filter withMailcap dependencies');
in
{
packages = {
Expand Down
Loading