Merge branch 'master' into staging-next

This commit is contained in:
Jan Tojnar
2019-09-18 21:15:35 +02:00
167 changed files with 11105 additions and 6483 deletions

View File

@@ -1,30 +1,30 @@
{ cargo, fetchFromGitHub, makeWrapper, pkgconfig, rustPlatform, stdenv, gcc, Security, zeromq }:
{ cargo, fetchFromGitHub, makeWrapper, pkgconfig, rustPlatform, stdenv, gcc, Security, cmake }:
rustPlatform.buildRustPackage rec {
pname = "evcxr";
version = "0.4.4";
version = "0.4.5";
src = fetchFromGitHub {
owner = "google";
repo = "evcxr";
rev = "v${version}";
sha256 = "1j2vsqgljqw7415rgjlnc1w3nmr9ghizx2mncbm1yipwj8xbrmf6";
sha256 = "13fs9fgvdf8bh6vc8xs8qhil0a1qhm4gvv0ici37xh8a94ngsn7h";
};
cargoSha256 = "0ckxpmi547y7q4w287znimpxgaj3mjkgmkcs2n9cp4m8cw143hly";
cargoSha256 = "0g17g12isah4nkqp9i299qr1sz19k4czcc43rm1wbs0y9szaqvwc";
nativeBuildInputs = [ pkgconfig makeWrapper ];
buildInputs = [ zeromq ] ++ stdenv.lib.optional stdenv.isDarwin Security;
nativeBuildInputs = [ pkgconfig makeWrapper cmake ];
buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
postInstall = ''
wrapProgram $out/bin/evcxr --prefix PATH : ${stdenv.lib.makeBinPath [ cargo gcc ]}
rm $out/bin/testing_runtime
'';
meta = {
meta = with stdenv.lib; {
description = "An evaluation context for Rust";
homepage = "https://github.com/google/evcxr";
license = stdenv.lib.licenses.asl20;
maintainers = [ stdenv.lib.maintainers.protoben ];
platforms = stdenv.lib.platforms.all;
license = licenses.asl20;
maintainers = with maintainers; [ protoben ma27 ];
platforms = platforms.all;
};
}

View File

@@ -116,45 +116,11 @@ SEMVER = {
}
def _determine_latest_version(current_version, target, versions):
"""Determine latest version, given `target`.
"""
current_version = Version(current_version)
def _parse_versions(versions):
for v in versions:
try:
yield Version(v)
except InvalidVersion:
pass
versions = _parse_versions(versions)
index = SEMVER[target]
ceiling = list(current_version[0:index])
if len(ceiling) == 0:
ceiling = None
else:
ceiling[-1]+=1
ceiling = Version(".".join(map(str, ceiling)))
# We do not want prereleases
versions = SpecifierSet(prereleases=PRERELEASES).filter(versions)
if ceiling is not None:
versions = SpecifierSet(f"<{ceiling}").filter(versions)
return (max(sorted(versions))).raw_version
def _get_latest_version_pypi(package, extension, current_version, target):
"""Get latest version and hash from PyPI."""
url = "{}/{}/json".format(INDEX, package)
json = _fetch_page(url)
versions = json['releases'].keys()
version = _determine_latest_version(current_version, target, versions)
version = json['info']['version']
try:
releases = json['releases'][version]
@@ -166,6 +132,7 @@ def _get_latest_version_pypi(package, extension, current_version, target):
sha256 = release['digests']['sha256']
break
else:
logging.error("Release not found for extension: {}".format(extension))
sha256 = None
return version, sha256