Skip to content

Commit

Permalink
Problem: nix develop don't work (#120)
Browse files Browse the repository at this point in the history
Solution:
- fix default devShell
- update link instruction in ci to use nix
- update python dev dependencies
  • Loading branch information
yihuang authored Feb 26, 2024
1 parent 266e133 commit ca7347d
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 70 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Upgrade poetry
run: python3 -m pip install --user --upgrade poetry
- name: Install dependencies
run: poetry install
- uses: cachix/install-nix-action@v15
- name: Run linting
run: make lint
run: nix develop -c make lint-ci
tests:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ test:

lint:
@poetry run flake8 --show-source --count --statistics
@poetry run isort --check-only .
@poetry run isort --check-only .

lint-ci:
@flake8 --show-source --count --statistics \
--format="::error file=%(path)s,line=%(row)d,col=%(col)d::%(path)s:%(row)d:%(col)d: %(code)s %(text)s"
12 changes: 9 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
durations = [ "setuptools" ];
multitail2 = [ "setuptools" ];
pytest-github-actions-annotate-failures = [ "setuptools" ];
flake8-black = [ "setuptools" ];
flake8-isort = [ "hatchling" ];
};
in
pkgs.lib.mapAttrs
Expand All @@ -44,9 +46,13 @@
type = "app";
program = "${packages.default}/bin/pystarport";
};
devShell = pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
inherit overrides;
devShells.default = pkgs.mkShell {
buildInputs = [
(pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;
inherit overrides;
})
];
};
}
));
Expand Down
61 changes: 49 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ repository = "https://github.com/crypto-com/pystarport"

[tool.poetry.dependencies]
python = "^3.9"
fire = "^0.4"
tomlkit = "^0.7"
fire = "^0"
tomlkit = "^0"
jsonmerge = "^1.7"
python-dateutil = "^2.8"
durations = "^0.3"
durations = "^0"
supervisor = "^4.2"
docker = "^7.0"
bech32 = "^1.1"
Expand All @@ -31,8 +31,8 @@ rpds-py = "^0.17.0"
pytest = "^8.0"
deepdiff = "^6.7"
flake8 = "^7"
black = "^24.2"
isort = "^5.10"
flake8-black = "^0"
flake8-isort = "^6.1"

[tool.poetry.scripts]
pystarport = "pystarport.cli:main"
Expand Down
Loading

0 comments on commit ca7347d

Please sign in to comment.