diff --git a/.deepsource.toml b/.deepsource.toml index 2783c4df..9e84a0db 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -3,7 +3,8 @@ version = 1 exclude_patterns = [ "makemigrations.py", "runtests.py", - "tests/**", + "account/tests/**", + "account/tests/test_*.py", ] [[analyzers]] diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d4900ace..0cc1bb37 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Lint with ruff run: | - ruff --format=github --target-version=py311 account tests + ruff --format=github --target-version=py311 account test: name: Testing @@ -51,10 +51,6 @@ jobs: shell: bash run: pip install Django==${{ matrix.django }} 'django-appconf>=1.0.4' 'pytz>=2020.4' - - name: Install test utilities - shell: bash - run: pip install pytest pytest-django - - name: Running Python Tests shell: bash - run: pytest + run: python3 runtests.py diff --git a/CHANGELOG.md b/CHANGELOG.md index d263ac8a..52557c40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ BI indicates a backward incompatible change. Take caution when upgrading to a version with these. Your code will need to be updated to continue working. +## 3.3.1 + +* #373 Re-include migrations in distribution + +## 3.3.0 + +* #370 Drop Django 2.2, fix timezone-aware comparison, packaging tweaks + ## 3.2.1 * #364 - Performance fix to admin classes diff --git a/MANIFEST.in b/MANIFEST.in index 372ea448..79e1f602 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,12 +1,13 @@ +global-exclude *.py[cod] include CHANGELOG.md include LICENSE include README.md recursive-include account *.html recursive-include account *.txt recursive-include account/locale * +recursive-include account/migrations *.py recursive-include docs *.rst exclude tox.ini recursive-exclude django_user_accounts.egg-info * -recursive-exclude tests * exclude docs/conf.py exclude docs/Makefile diff --git a/account/__init__.py b/account/__init__.py index 88c513ea..ff041687 100644 --- a/account/__init__.py +++ b/account/__init__.py @@ -1 +1 @@ -__version__ = "3.3.0" +__version__ = "3.3.1" diff --git a/tests/__init__.py b/account/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to account/tests/__init__.py diff --git a/tests/settings.py b/account/tests/settings.py similarity index 96% rename from tests/settings.py rename to account/tests/settings.py index 386ad249..6ec3bbf8 100644 --- a/tests/settings.py +++ b/account/tests/settings.py @@ -7,7 +7,7 @@ "django.contrib.sites", "django.contrib.messages", "account", - "tests", + "account.tests", ] DATABASES = { "default": { @@ -16,7 +16,7 @@ } } SITE_ID = 1 -ROOT_URLCONF = "tests.urls" +ROOT_URLCONF = "account.tests.urls" SECRET_KEY = "notasecret" TEMPLATES = [ { diff --git a/tests/templates/account/email/email_confirmation_message.txt b/account/tests/templates/account/email/email_confirmation_message.txt similarity index 100% rename from tests/templates/account/email/email_confirmation_message.txt rename to account/tests/templates/account/email/email_confirmation_message.txt diff --git a/tests/templates/account/email/email_confirmation_subject.txt b/account/tests/templates/account/email/email_confirmation_subject.txt similarity index 100% rename from tests/templates/account/email/email_confirmation_subject.txt rename to account/tests/templates/account/email/email_confirmation_subject.txt diff --git a/tests/templates/account/email/password_change.txt b/account/tests/templates/account/email/password_change.txt similarity index 100% rename from tests/templates/account/email/password_change.txt rename to account/tests/templates/account/email/password_change.txt diff --git a/tests/templates/account/email/password_change_subject.txt b/account/tests/templates/account/email/password_change_subject.txt similarity index 100% rename from tests/templates/account/email/password_change_subject.txt rename to account/tests/templates/account/email/password_change_subject.txt diff --git a/tests/templates/account/email/password_reset.txt b/account/tests/templates/account/email/password_reset.txt similarity index 100% rename from tests/templates/account/email/password_reset.txt rename to account/tests/templates/account/email/password_reset.txt diff --git a/tests/templates/account/email/password_reset_subject.txt b/account/tests/templates/account/email/password_reset_subject.txt similarity index 100% rename from tests/templates/account/email/password_reset_subject.txt rename to account/tests/templates/account/email/password_reset_subject.txt diff --git a/tests/templates/account/email_confirm.html b/account/tests/templates/account/email_confirm.html similarity index 100% rename from tests/templates/account/email_confirm.html rename to account/tests/templates/account/email_confirm.html diff --git a/tests/templates/account/email_confirmation_sent.html b/account/tests/templates/account/email_confirmation_sent.html similarity index 100% rename from tests/templates/account/email_confirmation_sent.html rename to account/tests/templates/account/email_confirmation_sent.html diff --git a/tests/templates/account/login.html b/account/tests/templates/account/login.html similarity index 100% rename from tests/templates/account/login.html rename to account/tests/templates/account/login.html diff --git a/tests/templates/account/logout.html b/account/tests/templates/account/logout.html similarity index 100% rename from tests/templates/account/logout.html rename to account/tests/templates/account/logout.html diff --git a/tests/templates/account/password_change.html b/account/tests/templates/account/password_change.html similarity index 100% rename from tests/templates/account/password_change.html rename to account/tests/templates/account/password_change.html diff --git a/tests/templates/account/password_reset_sent.html b/account/tests/templates/account/password_reset_sent.html similarity index 100% rename from tests/templates/account/password_reset_sent.html rename to account/tests/templates/account/password_reset_sent.html diff --git a/tests/templates/account/password_reset_token.html b/account/tests/templates/account/password_reset_token.html similarity index 100% rename from tests/templates/account/password_reset_token.html rename to account/tests/templates/account/password_reset_token.html diff --git a/tests/templates/account/password_reset_token_fail.html b/account/tests/templates/account/password_reset_token_fail.html similarity index 100% rename from tests/templates/account/password_reset_token_fail.html rename to account/tests/templates/account/password_reset_token_fail.html diff --git a/tests/templates/account/settings.html b/account/tests/templates/account/settings.html similarity index 100% rename from tests/templates/account/settings.html rename to account/tests/templates/account/settings.html diff --git a/tests/templates/account/signup.html b/account/tests/templates/account/signup.html similarity index 100% rename from tests/templates/account/signup.html rename to account/tests/templates/account/signup.html diff --git a/tests/templates/account/signup_closed.html b/account/tests/templates/account/signup_closed.html similarity index 100% rename from tests/templates/account/signup_closed.html rename to account/tests/templates/account/signup_closed.html diff --git a/tests/test_auth.py b/account/tests/test_auth.py similarity index 100% rename from tests/test_auth.py rename to account/tests/test_auth.py diff --git a/tests/test_commands.py b/account/tests/test_commands.py similarity index 100% rename from tests/test_commands.py rename to account/tests/test_commands.py diff --git a/tests/test_decorators.py b/account/tests/test_decorators.py similarity index 100% rename from tests/test_decorators.py rename to account/tests/test_decorators.py diff --git a/tests/test_email_address.py b/account/tests/test_email_address.py similarity index 100% rename from tests/test_email_address.py rename to account/tests/test_email_address.py diff --git a/tests/test_models.py b/account/tests/test_models.py similarity index 100% rename from tests/test_models.py rename to account/tests/test_models.py diff --git a/tests/test_password.py b/account/tests/test_password.py similarity index 100% rename from tests/test_password.py rename to account/tests/test_password.py diff --git a/tests/test_views.py b/account/tests/test_views.py similarity index 100% rename from tests/test_views.py rename to account/tests/test_views.py diff --git a/tests/urls.py b/account/tests/urls.py similarity index 100% rename from tests/urls.py rename to account/tests/urls.py diff --git a/makemigrations.py b/makemigrations.py index 894b4d75..eb2aa60d 100644 --- a/makemigrations.py +++ b/makemigrations.py @@ -11,7 +11,7 @@ "django.contrib.contenttypes", "django.contrib.sites", "account", - "tests" + "account.tests" ], MIDDLEWARE_CLASSES=[], DATABASES={ @@ -21,7 +21,7 @@ } }, SITE_ID=1, - ROOT_URLCONF="tests.urls", + ROOT_URLCONF="account.tests.urls", SECRET_KEY="notasecret", ) diff --git a/manage.py b/manage.py index dc935d61..646bf7ab 100644 --- a/manage.py +++ b/manage.py @@ -3,7 +3,7 @@ import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "account.tests.settings") from django.core.management import execute_from_command_line diff --git a/pyproject.toml b/pyproject.toml index cdb037a4..ef886100 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,8 +47,8 @@ skip_glob = "account/migrations/*,docs" include_trailing_comma = "True" [tool.pytest.ini_options] -testpaths = ["tests"] -DJANGO_SETTINGS_MODULE = "tests.settings" +testpaths = ["account/tests"] +DJANGO_SETTINGS_MODULE = "account.tests.settings" [tool.ruff] line-length = 120 @@ -57,7 +57,12 @@ line-length = 120 "account/migrations/**.py" = ["E501"] [tool.setuptools] -packages = ["account"] +package-dir = {"" = "."} +include-package-data = true +zip-safe = false [tool.setuptools.dynamic] version = {attr = "account.__version__"} + +[tool.setuptools.package-data] +account = ["locale/*/LC_MESSAGES/*"] diff --git a/runtests.py b/runtests.py index 1eb34476..5a60937d 100644 --- a/runtests.py +++ b/runtests.py @@ -6,7 +6,7 @@ def runtests(*test_args): - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "account.tests.settings") django.setup() parent = os.path.dirname(os.path.abspath(__file__)) @@ -15,7 +15,7 @@ def runtests(*test_args): from django.test.runner import DiscoverRunner runner_class = DiscoverRunner if not test_args: - test_args = ["tests"] + test_args = ["account/tests"] failures = runner_class(verbosity=1, interactive=True, failfast=False).run_tests(test_args) sys.exit(failures)