Skip to content

Commit

Permalink
wip: use pytest over tox for nix build checks
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilTaken committed Oct 22, 2024
1 parent 63adcf1 commit 11198f5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 23 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ include src/batou/insecure-private.key
recursive-include src/batou/init-template *
recursive-include src/batou/tests/fixture *
recursive-include src/batou/lib/resources *
recursive-include src/batou/lib/tests *
recursive-include src/batou/secrets/tests/fixture *
global-include *.txt
global-include *.in
20 changes: 19 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,25 @@

devShells.default = pkgs.mkShell {
packages = [
(pkgs.python3.withPackages (ps: [ps.tox ps.setuptools ps.pytest]))
#(pkgs.python3.withPackages (ps: [ps.tox ps.setuptools ps.pytest]))
(pkgs.python3.withPackages (ps: [
ps.mock
ps.pytest
ps.pytest-cov
ps.pytest-instafail
ps.pytest-timeout

ps.requests
ps.pyyaml
ps.execnet
ps.importlib-metadata
ps.importlib-resources
ps.remote-pdb
ps.py
ps.configupdater
ps.setuptools
ps.jinja2
]))
pkgs.mercurial
pkgs.age
pkgs.subversion
Expand Down
57 changes: 35 additions & 22 deletions nix/batou.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
unzip,
git,
subversion,
python3,
age,
mercurial,
buildPythonPackage,
Expand All @@ -16,43 +15,57 @@
remote-pdb,
py,
configupdater,
mock,
pytest,
setuptools,
jinja2,
src,
pytestCheckHook,
mock,
pytest-cov,
pytest-instafail,
pytest-timeout,
}:
buildPythonPackage {
propagatedBuildInputs = [
requests
pyyaml
build-system = [setuptools];
dependencies = [
configupdater
execnet
importlib-metadata
importlib-resources
remote-pdb
py
configupdater
mock
pytest
setuptools
jinja2
py
pyyaml
remote-pdb
requests
];

checkPhase = ''
tox -e py
cp report.xml $out
cp -r htmlcov $out
'';

nativeCheckInputs = [
(python3.withPackages (ps: [ps.tox]))
mercurial
pytestCheckHook

py
mock
pytest-cov
pytest-instafail
pytest-timeout
requests

age
git
gnupg
mercurial
rsync
subversion
unzip
rsync
gnupg
];

PY_IGNORE_IMPORTMISMATCH = 1;

disabledTests = [
"test_runs_buildout_successfully"
"test_runs_buildout3_successfully"
];

disabledTestPaths = [
"src/batou/lib/tests/test_supervisor.py"
];

pname = "batou";
Expand Down

0 comments on commit 11198f5

Please sign in to comment.