Skip to content

Commit

Permalink
tox updates (#1534)
Browse files Browse the repository at this point in the history
* tox updates

* bumped setup-python

* fix handling of # char (tox-dev/tox#2617)

* updated dep url

* removed escape char from tox.ini

* added double escape

* removed broken escape char

* added tox minversion

* upgrade to tox v4 syntax

* updated tox versions
  • Loading branch information
matthewhegarty committed Jan 31, 2023
1 parent 60af51f commit 9f568c9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/django-import-export-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: isort
Expand All @@ -66,15 +66,15 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-py coverage coveralls
pip install tox coverage coveralls
- name: Run tox targets for ${{ matrix.python-version }} (sqlite)
run: tox --py current
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)
- name: Run tox targets for ${{ matrix.python-version }} (postgres)
run: tox --py current
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)
env:
IMPORT_EXPORT_TEST_TYPE: postgres
- name: Run tox targets for ${{ matrix.python-version }} (mysql)
run: tox --py current
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)
env:
IMPORT_EXPORT_TEST_TYPE: mysql-innodb
- name: Combine test coverage
Expand Down
7 changes: 6 additions & 1 deletion tests/core/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ def test_use_tz(self):
@override_settings(USE_TZ=True, TIME_ZONE='Europe/Ljubljana')
def test_clean_returns_tz_aware_datetime_when_naive_datetime_passed(self):
# issue 1165
target_dt = timezone.make_aware(self.datetime, pytz.timezone('Europe/Ljubljana'))
if django.VERSION >= (5, 0):
from zoneinfo import ZoneInfo
tz = ZoneInfo("Europe/Ljubljana")
else:
tz = pytz.timezone('Europe/Ljubljana')
target_dt = timezone.make_aware(self.datetime, tz)
self.assertEqual(target_dt, self.widget.clean(self.datetime))

@override_settings(USE_TZ=True, TIME_ZONE='Europe/Ljubljana')
Expand Down
2 changes: 2 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@
USE_TZ = False
if django.VERSION >= (4, 1):
FORM_RENDERER = "django.forms.renderers.DjangoDivFormRenderer"
if django.VERSION >= (5, 0):
FORM_RENDERER = "django.forms.renderers.DjangoTemplates"
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[tox]
min_version = 4.0
envlist =
isort
{py37,py38,py39,py310}-{django32}
{py38,py39,py310}-{django40,django41,djangomain}
{py311}-{django41,djangomain}
{py38,py39,py310}-{django40}
{py310,py311}-{django41,djangomain}
py311-djangomain-tablibdev

[gh-actions]
Expand All @@ -18,12 +19,11 @@ python =
setenv = PYTHONPATH = {toxinidir}/tests
commands = python ./runtests.py
deps =
tablibdev: -egit+https://github.com/jazzband/tablib.git#egg=tablib
tablibdev: -egit+https://github.com/jazzband/tablib.git@master\#egg=tablib
django32: Django>=3.2,<4.0
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
djangomain: https://github.com/django/django/archive/main.tar.gz
tablib
-rrequirements/test.txt

# if postgres / mysql environment variables exist, we can go ahead and run db specific tests
Expand Down

0 comments on commit 9f568c9

Please sign in to comment.