Skip to content

Commit d86ae89

Browse files
authored
piston-cli: 1.4.3 -> 1.5.0, tweak, fetchFromGitHub, versionCheckHook (#370904)
2 parents a408375 + cde58d0 commit d86ae89

File tree

1 file changed

+37
-20
lines changed

1 file changed

+37
-20
lines changed
Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,66 @@
11
{
2-
stdenv,
32
lib,
43
python3Packages,
5-
fetchPypi,
4+
fetchFromGitHub,
5+
versionCheckHook,
6+
gitUpdater,
67
}:
78

89
python3Packages.buildPythonApplication rec {
910
pname = "piston-cli";
10-
version = "1.4.3";
11-
format = "pyproject";
11+
version = "1.5.0";
12+
pyproject = true;
1213

13-
src = fetchPypi {
14-
inherit pname version;
15-
sha256 = "qvDGVJcaMXUajdUQWl4W1dost8k0PsS9XX/o8uQrtfY=";
14+
src = fetchFromGitHub {
15+
owner = "Shivansh-007";
16+
repo = "piston-cli";
17+
tag = "v${version}";
18+
hash = "sha256-5S+1YGoPMprWnlsTGGPHtlQT974TsFgct3jVPngTT1k=";
1619
};
1720

18-
propagatedBuildInputs = with python3Packages; [
19-
rich
21+
build-system = [
22+
python3Packages.poetry-core
23+
];
24+
25+
dependencies = with python3Packages; [
26+
appdirs
27+
click
28+
coloredlogs
29+
more-itertools
2030
prompt-toolkit
21-
requests
31+
rich
32+
requests-cache
2233
pygments
2334
pyyaml
2435
more-itertools
2536
];
2637

27-
checkPhase = ''
28-
$out/bin/piston --help > /dev/null
38+
postPatch = ''
39+
substituteInPlace pyproject.toml \
40+
--replace-fail 'piston = "piston:main"' 'piston = "piston.cli:cli_app"'
2941
'';
3042

31-
nativeBuildInputs = with python3Packages; [
32-
poetry-core
33-
];
34-
3543
pythonRelaxDeps = [
3644
"rich"
3745
"more-itertools"
3846
"PyYAML"
47+
"requests-cache"
3948
];
4049

41-
meta = with lib; {
42-
broken = stdenv.hostPlatform.isDarwin;
50+
nativeCheckInputs = [ versionCheckHook ];
51+
versionCheckProgramArg = [ "--version" ];
52+
versionCheckProgram = "${placeholder "out"}/bin/piston";
53+
54+
pythonImportsCheck = [ "piston" ];
55+
56+
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
57+
58+
meta = {
4359
description = "Piston api tool";
4460
homepage = "https://github.com/Shivansh-007/piston-cli";
45-
license = licenses.mit;
46-
maintainers = with maintainers; [ ethancedwards8 ];
61+
license = lib.licenses.mit;
62+
platforms = lib.platforms.unix;
63+
maintainers = with lib.maintainers; [ ethancedwards8 ];
4764
mainProgram = "piston";
4865
};
4966
}

0 commit comments

Comments
 (0)