Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

326
Visualizações
How to globally override a pythonPackage in nix

I'm trying to override a python package (uvloop) globally, in nix, such that black sees the override.

uvloop (python package) tests fail for me because I'm working behind a firewall. I can build things that use uvloop by editing the nixpkgs derivation directly (ugh) to set doCheck = false.

I'm trying to encode this in an overlay, but without success - the overlay is read (e.g., syntax errors cause failure), but nothing I do in the overlay actually stop the tests from running.

I've tried following tips from https://nixos.wiki/wiki/Overlays, https://nixos.org/manual/nixpkgs/stable/#how-to-override-a-python-package-using-overlays and How to use custom python with existing packages - nix derivation? (overlaying python using packageOverrides; with pythonOverrides; and with and without using overridePythonAttrs); both for python3 and python39; but with no success.

E.g.,

self: super: {
  python3 = super.python3.override {
    packageOverrides = pyself: pysuper: {
      uvloop = pysuper.uvloop.overrideAttrs (_: {
        doCheck = false;
      });
    };
  };
}
    

For bonus points, I'd like to achieve this for all instances of python package uvloop - not just the one in 3.9 - but I'll take any help I can get.

Thanks,

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The following worked for me. It applies a patch to twitch-chat-downloader (Python app) and a patch to twitch-python (Python library used by twitch-chat-downloader). nix-env -iA nixpkgs.twitch-chat-downloader installed a patch copy of twitch-chat-downloader which uses a patched copy of twitch-python.

{
  packageOverrides = pkgs: {
    python3 = pkgs.python3.override {
      packageOverrides = python-self: python-super: {
        twitch-python = python-super.twitch-python.overrideAttrs (attrs: {
          patches = (attrs.patches or []) ++ [
            ./twitch-allow-no-token.patch
          ];
        });
      };
    };

    twitch-chat-downloader = pkgs.twitch-chat-downloader.overrideAttrs (attrs: {
      patches = (attrs.patches or []) ++ [
        ./twitch-chat-downloader-no-oauth.patch
      ];
    });
  };
}
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda