forked from clan/clan-core
templates: cleanup python template
This commit is contained in:
parent
eaaf0d2992
commit
e445beeb0b
@ -1,7 +1,10 @@
|
|||||||
{
|
{
|
||||||
pkgs ? import <nixpkgs> {},
|
pkgs ? import <nixpkgs> {},
|
||||||
|
|
||||||
lib ? pkgs.lib,
|
lib ? pkgs.lib,
|
||||||
python3 ? pkgs.python3,
|
python3 ? pkgs.python3,
|
||||||
|
ruff ? pkgs.ruff,
|
||||||
|
runCommand ? pkgs.runCommand,
|
||||||
}: let
|
}: let
|
||||||
pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml);
|
pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml);
|
||||||
name = pyproject.project.name;
|
name = pyproject.project.name;
|
||||||
@ -39,13 +42,13 @@
|
|||||||
|
|
||||||
checkPython = python3.withPackages (ps: devDependencies);
|
checkPython = python3.withPackages (ps: devDependencies);
|
||||||
|
|
||||||
check = pkgs.runCommand "${name}-check" {} ''
|
check = runCommand "${name}-check" {} ''
|
||||||
cp -r ${src} ./src
|
cp -r ${src} ./src
|
||||||
chmod +w -R ./src
|
chmod +w -R ./src
|
||||||
cd src
|
cd src
|
||||||
export PYTHONPATH=.
|
export PYTHONPATH=.
|
||||||
echo -e "\x1b[32m## run ruff\x1b[0m"
|
echo -e "\x1b[32m## run ruff\x1b[0m"
|
||||||
${pkgs.ruff}/bin/ruff check .
|
${ruff}/bin/ruff check .
|
||||||
echo -e "\x1b[32m## run mypy\x1b[0m"
|
echo -e "\x1b[32m## run mypy\x1b[0m"
|
||||||
${checkPython}/bin/mypy .
|
${checkPython}/bin/mypy .
|
||||||
echo -e "\x1b[32m## run pytest\x1b[0m"
|
echo -e "\x1b[32m## run pytest\x1b[0m"
|
||||||
|
Loading…
Reference in New Issue
Block a user