2022-05-10 20:38:56 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pythonOlder
|
|
|
|
, pythonAtLeast
|
|
|
|
, pythonRelaxDepsHook
|
|
|
|
, writeText
|
|
|
|
, asttokens
|
|
|
|
, pycryptodome
|
|
|
|
, recommonmark
|
|
|
|
, semantic-version
|
|
|
|
, sphinx
|
|
|
|
, sphinx_rtd_theme
|
|
|
|
, pytest-runner
|
|
|
|
, setuptools-scm
|
|
|
|
}:
|
2021-01-11 01:01:47 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
sample-contract = writeText "example.vy" ''
|
|
|
|
count: int128
|
|
|
|
|
|
|
|
@external
|
|
|
|
def __init__(foo: address):
|
|
|
|
self.count = 1
|
|
|
|
'';
|
|
|
|
|
2022-05-10 20:38:56 +00:00
|
|
|
in
|
2021-01-11 01:01:47 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "vyper";
|
2022-01-11 05:57:11 +00:00
|
|
|
version = "0.3.1";
|
2022-05-10 20:38:56 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7" || pythonAtLeast "3.10";
|
2021-01-11 01:01:47 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-01-11 05:57:11 +00:00
|
|
|
sha256 = "sha256-fXug5v3zstz19uexMWokHBVsfcl2ZCdIOIXKeLVyh/Q=";
|
2021-01-11 01:01:47 +00:00
|
|
|
};
|
|
|
|
|
2022-05-10 20:38:56 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
pytest-runner
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [ "semantic-version" ];
|
2021-01-11 01:01:47 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
asttokens
|
|
|
|
pycryptodome
|
|
|
|
semantic-version
|
|
|
|
|
|
|
|
# docs
|
|
|
|
recommonmark
|
|
|
|
sphinx
|
|
|
|
sphinx_rtd_theme
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
$out/bin/vyper "${sample-contract}"
|
|
|
|
'';
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-01-11 01:01:47 +00:00
|
|
|
description = "Pythonic Smart Contract Language for the EVM";
|
|
|
|
homepage = "https://github.com/vyperlang/vyper";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ siraben ];
|
|
|
|
};
|
|
|
|
}
|