Add Pypy support (#40)

This commit is contained in:
adisbladis 2020-01-18 20:29:07 +00:00 committed by GitHub
parent 769dc25d77
commit 7170aad633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 14 deletions

View file

@ -195,7 +195,7 @@ let
postPatch = (passedAttrs.postPatch or "") + ''
# Tell poetry not to resolve the path dependencies. Any version is
# fine !
yj -tj < pyproject.toml | python ${./pyproject-without-path.py} > pyproject.json
yj -tj < pyproject.toml | ${python.interpreter} ${./pyproject-without-path.py} > pyproject.json
yj -jt < pyproject.json > pyproject.toml
rm pyproject.json
'';

View file

@ -112,7 +112,7 @@ pythonPackages.callPackage (
builtins.map (n: pythonPackages.${lib.toLower n}) (builtins.attrNames dependencies);
meta = {
broken = ! isCompatible python.version python-versions;
broken = ! isCompatible python.pythonVersion python-versions;
license = [];
};

View file

@ -21,11 +21,15 @@ self: super:
}
);
cffi = super.cffi.overrideAttrs (
old: {
buildInputs = old.buildInputs ++ [ pkgs.libffi ];
}
);
cffi =
# cffi is bundled with pypy
if self.python.implementation == "pypy" then null else (
super.cffi.overrideAttrs (
old: {
buildInputs = old.buildInputs ++ [ pkgs.libffi ];
}
)
);
cftime = super.cftime.overrideAttrs (
old: {

View file

@ -83,7 +83,10 @@ let
# This function also performs variable substitution, replacing environment markers with their explicit values
transformExpressions = exprs: let
variables = {
os_name = "posix"; # TODO: Check other platforms
os_name = (
if python.pname == "jython" then "java"
else "posix"
);
sys_platform = (
if stdenv.isLinux then "linux"
else if stdenv.isDarwin then "darwin"
@ -100,7 +103,7 @@ let
platform_version = ""; # Field not reproducible
python_version = python.passthru.pythonVersion;
python_full_version = python.version;
implementation_name = "cpython"; # Only cpython supported for now
implementation_name = python.implementation;
implementation_version = python.version;
extra = "";
};

View file

@ -29,15 +29,16 @@ builtins.removeAttrs
inherit poetry2nix poetry;
inherit (pkgs) postgresql;
};
pyqt5 = pkgs.callPackage ./pyqt5 { inherit poetry2nix; };
eggs = pkgs.callPackage ./eggs { inherit poetry2nix; };
# Test building poetry
inherit poetry;
poetry-python2 = poetry.override { python = pkgs.python2; };
# Pyqt5 test is waiting for nixpkgs sip bump to reach channel
pyqt5 = pkgs.callPackage ./pyqt5 { inherit poetry2nix; };
# Egg support not yet in channel, uncomment when channel progressed
eggs = pkgs.callPackage ./eggs { inherit poetry2nix; };
# And also test with pypy
poetry-pypy = poetry.override { python = pkgs.pypy; };
poetry-pypy3 = poetry.override { python = pkgs.pypy3; };
inherit (poetry2nix) doc;