-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…157) Solution: - seperate dev env and integration test env in nix-shell - minimize dependencies running in ci - manipulate PYTHONPATH to make pystarport editable in dev env - flake8 don't check naming conventions, add the `pep8-naming` plugin in nix-shell. - use pytest's builtin tmp_path fixture to manage tmp directories. - add entrypoint `make lintpy` to run python linter
- Loading branch information
Showing
13 changed files
with
140 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,18 @@ | ||
{ system ? "x86_64-linux" }: | ||
{ system ? "x86_64-linux", pkgs ? import <nixpkgs> { inherit system; } }: | ||
|
||
let | ||
pkgs = import <nixpkgs> { inherit system; }; | ||
|
||
chaind = import ./. { inherit pkgs; }; | ||
pystarport = import ./pystarport { inherit pkgs; }; | ||
|
||
in { | ||
chaindImage = | ||
pkgs.dockerTools.buildImage { | ||
pkgs.dockerTools.buildLayeredImage { | ||
name = "crypto-com/chain-maind"; | ||
tag = chaind.version; | ||
|
||
contents = [ chaind ]; | ||
|
||
config = { | ||
Cmd = [ "${chaind}/bin/chain-maind" ]; | ||
}; | ||
config.Entrypoint = [ "${chaind}/bin/chain-maind" ]; | ||
}; | ||
|
||
pystarportImage = | ||
pkgs.dockerTools.buildImage { | ||
pkgs.dockerTools.buildLayeredImage { | ||
name = "crypto-com/chain-main-pystarport"; | ||
tag = pystarport.version; | ||
|
||
contents = [ chaind pystarport ]; | ||
|
||
config = { | ||
Cmd = [ "${pystarport}/bin/pystarport" ]; | ||
}; | ||
config.Entrypoint = [ "${pystarport}/bin/pystarport" ]; | ||
}; | ||
|
||
in { inherit chaindImage pystarportImage; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ pkgs ? import <nixpkgs> {} }: | ||
with pkgs; | ||
let | ||
chain = import ../. { inherit pkgs; }; | ||
pystarport = import ../pystarport { inherit pkgs; }; | ||
in | ||
mkShell { | ||
buildInputs = [ | ||
chain.instrumented | ||
pystarport | ||
(with python3Packages; [ | ||
pytest | ||
pytest_xdist | ||
flake8 | ||
black | ||
isort | ||
pep8-naming | ||
]) | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
testpaths = integration_tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,18 @@ | ||
{ pkgs ? import <nixpkgs> {} }: | ||
with pkgs; | ||
let | ||
chain = import ./. { inherit pkgs; }; | ||
pystarport = poetry2nix.mkPoetryEnv { | ||
projectDir = ./pystarport; | ||
editablePackageSources = { | ||
pystarport = ./pystarport; | ||
}; | ||
}; | ||
in | ||
mkShell { | ||
buildInputs = [ | ||
go | ||
chain | ||
chain.instrumented | ||
pystarport | ||
python3Packages.poetry | ||
python3Packages.pytest_xdist | ||
python3Packages.pytest | ||
python3Packages.flake8 | ||
python3Packages.black | ||
python3Packages.isort | ||
]; | ||
} | ||
mkShell { | ||
inputsFrom = [ | ||
# base env | ||
(import ./integration_tests/shell.nix { inherit pkgs; }) | ||
]; | ||
buildInputs = [ | ||
go | ||
# make default chain-maind available on PATH | ||
(import ./. { inherit pkgs; }) | ||
python3Packages.poetry | ||
]; | ||
shellHook = '' | ||
# prefer local pystarport directory for development | ||
export PYTHONPATH=./pystarport:$PYTHONPATH | ||
''; | ||
} |