Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
gotcha committed Sep 23, 2024
1 parent cd5a7c0 commit 4311206
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
11 changes: 11 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@

# https://devenv.sh/languages/
languages.python.enable = true;
languages.python.uv.enable = true;
languages.python.venv.enable = true;
languages.python.venv.requirements = ''
tox-uv
black
flake8
isort
-r '' + ./requirements-testing.txt;

# https://devenv.sh/processes/
Expand All @@ -28,12 +32,19 @@
enterShell = ''
hello
git --version
just --list
'';

# https://devenv.sh/tests/
enterTest = ''
echo "Running tests"
git --version | grep --color=auto "${pkgs.git.version}"
just --list
$VIRTUAL_ENV/bin/tox --version
$VIRTUAL_ENV/bin/black --version
$VIRTUAL_ENV/bin/flake8 --version
$VIRTUAL_ENV/bin/isort --version
$VIRTUAL_ENV/bin/zope-testrunner --version
'';

# https://devenv.sh/pre-commit-hooks/
Expand Down
15 changes: 9 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
default_all_environments := `./.devenv/state/venv/bin/tox list | sed '/default environments:$/d' | sed 's/^\([^ ]*\).*$/\1/' | tr '\n' ','`

tox ENVIRONMENT=default_all_environments:
${VIRTUAL_ENV}/bin/tox -e {{ENVIRONMENT}} -c tox-uv.ini
all_environments := `./.devenv/state/venv/bin/tox list | sed '/default environments:$/d' | sed 's/^\([^ ]*\).*$/\1/' | tr '\n' ','`

default_config := ''
# run tox with environments: just tox py38,py39
tox ENVIRONMENTS=all_environments:
${VIRTUAL_ENV}/bin/tox -e {{ENVIRONMENTS}} -c tox-uv.ini

test CONFIG=default_config:
${VIRTUAL_ENV}/bin/zope-testrunner {{CONFIG}} --path src
set positional-arguments

# run zope-testrunner tests; passes args
test *args='':
${VIRTUAL_ENV}/bin/zope-testrunner "$@" --path src

0 comments on commit 4311206

Please sign in to comment.