Skip to content

Commit

Permalink
updates CI and tox
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Oct 10, 2024
1 parent a56e58c commit 4dca2b0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 23 deletions.
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dev-dependencies = [
# "black>=24.8.0",
# "celery[pytest]>=5.4.0",
# "django-webtest>=1.9.12",
"factory-boy>=3.3.1",
"factory-boy>=3.3.1",
# "flake8>=7.1.1",
# "flower>=2.0.1",
# "ipython>=8.18.1",
Expand All @@ -52,7 +52,7 @@ dev-dependencies = [
# "psycopg>=2.9.9",
# "pyquery>=2.0.1",
# "pytest-cov>=5.0.0",
"pytest-django>=4.9.0",
"pytest-django>=4.9.0",
# "pytest-echo>=1.7.3",
"django-webtest>=1.9.12",
# "black>=24.8.0",
Expand All @@ -67,10 +67,15 @@ dev-dependencies = [
# "pdbpp>=0.10.3",
# "psycopg-binary>=3.2.2",
# "psycopg>=2.9.9",
"pyquery>=2.0.1",
"pytest-cov>=5.0.0",
"pyquery>=2.0.1",
"pytest-cov>=5.0.0",
# "pytest-django>=4.9.0",
# "pytest-echo>=1.7.3",
"pytest>=8.3.3",
"tox>=4.20.0",
"isort>=5.13.2",
"flake8>=7.1.1",
"black>=24.10.0",
"pdbpp>=0.10.3",
"tox-uv>=1.13.0",
]
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ def app(request):

@pytest.fixture
def demomodel2():
from demo.models import DemoModel1, DemoModel2, DemoModel5
from demo.models import DemoModel2
return DemoModel2.objects.get_or_create(name='name1')[0]


@pytest.fixture
def demomodel1():
from demo.models import DemoModel1, DemoModel2, DemoModel5
from demo.models import DemoModel1
return DemoModel1.objects.get_or_create(name='name1')[0]


@pytest.fixture
def demomodel5():
from demo.models import DemoModel1, DemoModel2, DemoModel5
from demo.models import DemoModel5
return DemoModel5.objects.get_or_create(name='name1')[0]


Expand Down
2 changes: 0 additions & 2 deletions tests/demoapp/demo/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

DEBUG = True
STATIC_URL = '/static/'

Expand Down
8 changes: 5 additions & 3 deletions tests/demoapp/demo/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import path

admin.autodiscover()

urlpatterns = [
path("", admin.site.urls),
]
path(r'admin/', admin.site.urls),
] + staticfiles_urlpatterns()
3 changes: 0 additions & 3 deletions tests/test_checks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from unittest.mock import Mock

from demo.admin import Admin1
from demo.models import DemoModel1
from django.contrib.admin import site

Expand Down
5 changes: 3 additions & 2 deletions tests/test_visibility.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from admin_extra_buttons.handlers import ButtonHandler, ChoiceHandler, LinkHandler, ViewHandler
from admin_extra_buttons.buttons import Button, LinkButton
from unittest.mock import MagicMock

from admin_extra_buttons.buttons import Button, LinkButton
from admin_extra_buttons.handlers import ButtonHandler, LinkHandler


def test_button_visibility():
def v(btn):
Expand Down
10 changes: 4 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ skip_missing_interpreters = true
;skipsdist = true

[testenv]
;install_command=pip install {opts} {packages}
runner = uv-venv-runner
passenv =
PYTHONDONTWRITEBYTECODE
PGHOST
Expand Down Expand Up @@ -34,10 +34,8 @@ commands =
envdir={toxworkdir}/d42-py312/
skip_install = true
commands =
pip install flake8 isort
flake8 src tests
isort -c src tests

uv run flake8 src tests
uv run isort -c src tests

[testenv:package]
deps=
Expand All @@ -51,4 +49,4 @@ setenv =
commands =
python -c "import shutil; shutil.rmtree('dist', ignore_errors=True)"
python -m build
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
; python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*

0 comments on commit 4dca2b0

Please sign in to comment.