2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pythonOlder
|
|
|
|
, pythonRelaxDepsHook
|
|
|
|
, writeText
|
|
|
|
, asttokens
|
|
|
|
, pycryptodome
|
2023-05-24 13:37:59 +00:00
|
|
|
, importlib-metadata
|
2022-05-18 14:49:53 +00:00
|
|
|
, recommonmark
|
|
|
|
, semantic-version
|
|
|
|
, sphinx
|
2022-08-12 12:06:08 +00:00
|
|
|
, sphinx-rtd-theme
|
2022-05-18 14:49:53 +00:00
|
|
|
, pytest-runner
|
|
|
|
, setuptools-scm
|
|
|
|
, git
|
|
|
|
}:
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
sample-contract = writeText "example.vy" ''
|
|
|
|
count: int128
|
|
|
|
|
|
|
|
@external
|
|
|
|
def __init__(foo: address):
|
|
|
|
self.count = 1
|
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
in
|
2021-01-15 22:18:51 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "vyper";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.3.9";
|
2022-05-18 14:49:53 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-4UBSH4qRBgsy+VO9XzosWedM65R1lTo9ml2C95T9OAA=";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
# Git is used in setup.py to compute version information during building
|
|
|
|
# ever since https://github.com/vyperlang/vyper/pull/2816
|
|
|
|
git
|
|
|
|
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
pytest-runner
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
pythonRelaxDeps = [ "asttokens" "semantic-version" ];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
asttokens
|
|
|
|
pycryptodome
|
|
|
|
semantic-version
|
2023-05-24 13:37:59 +00:00
|
|
|
importlib-metadata
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
# docs
|
|
|
|
recommonmark
|
|
|
|
sphinx
|
2022-08-12 12:06:08 +00:00
|
|
|
sphinx-rtd-theme
|
2021-01-15 22:18:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
$out/bin/vyper "${sample-contract}"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-15 22:18:51 +00:00
|
|
|
description = "Pythonic Smart Contract Language for the EVM";
|
|
|
|
homepage = "https://github.com/vyperlang/vyper";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ siraben ];
|
|
|
|
};
|
|
|
|
}
|