Overriding dependency packages on existing buildPythonApplication

I’m looking to take the copier package, and override the dependencies section in order to rebuild the Python Application to include an additional package, specifically jinja2-git so I can use it as an extension.

I can’t quite seem to get the right incantation of overrideAttrs or overridePythonAttrs. Does anyone have suggestions?

I’ve tried this so far

pkgs.copier.overrideAttrs (old: {
    dependencies = old.dependencies ++ [pkgs.python3.withPackages (ps: [ps.jinja2-git])];
}

But all I get is attribute 'dependencies' missing.

You meant to use overridePythonAttrs instead, and withPackages is only relevant when you’re trying to build a full environment (python3 wrapped with a set of packages), not just pull an individual module. Just refer to the package directly.

(pkgs.copier.overridePythonAttrs (old: {
    dependencies = old.dependencies ++ [pkgs.python3.pkgs.jinja2-git];
}))