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 "") + '' postPatch = (passedAttrs.postPatch or "") + ''
# Tell poetry not to resolve the path dependencies. Any version is # Tell poetry not to resolve the path dependencies. Any version is
# fine ! # 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 yj -jt < pyproject.json > pyproject.toml
rm pyproject.json rm pyproject.json
''; '';

View file

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

View file

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

View file

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

View file

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