diff --git a/flake.nix b/flake.nix index 538fc449..af5fd754 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,7 @@ }; nativeBuildInputs = - [ python.pkgs.pdm-pep517 python.pkgs.pdm-backend ]; + [ prev.pdm-pep517 prev.pdm-backend ]; doCheck = false; @@ -48,8 +48,46 @@ maintainers = [ ]; }; }; + # We need PyYAML with C support, but poetry2nix does not do that apparently... + # Taken from nixpkgs. + pyyaml = prev.buildPythonPackage rec { + pname = "pyyaml"; + version = "6.0.1"; + + format = "pyproject"; + + src = pkgs.fetchFromGitHub { + owner = "yaml"; + repo = "pyyaml"; + rev = version; + hash = "sha256-YjWMyMVDByLsN5vEecaYjHpR1sbBey1L/khn4oH9SPA="; + }; + + nativeBuildInputs = [ + prev.cython_0 + prev.setuptools + ]; + + buildInputs = [ pkgs.libyaml ]; + + checkPhase = '' + runHook preCheck + PYTHONPATH="tests/lib:$PYTHONPATH" ${python.interpreter} -m test_all + runHook postCheck + ''; + + pythonImportsCheck = [ "yaml" ]; + + meta = with pkgs.lib; { + description = "The next generation YAML parser and emitter for Python"; + homepage = "https://github.com/yaml/pyyaml"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + }; + }; }; + # This one isn't in Nix, so do it manually. ast = pkgs.buildNpmPackage rec { pname = "abstract-syntax-tree";