Skip to content

Commit

Permalink
Merge pull request #3 from bernhard-hagmann/python_django_updates
Browse files Browse the repository at this point in the history
SIANXKE-389: Update Python, Django, and package versions
  • Loading branch information
nezhar authored Nov 6, 2024
2 parents 96491f1 + eb3a9cf commit aa8cf70
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.13'
architecture: 'x64'

- name: Install dependencies and package
Expand All @@ -38,4 +38,4 @@ jobs:
TWINE_REPOSITORY: ${{ secrets.PYPI_REPOSITORY }}
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_NON_INTERACTIVE: yes
TWINE_NON_INTERACTIVE: yes
18 changes: 12 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@ jobs:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
django-version:
- '3.2'
- '4.1'
- '4.2'
- '5.0'
- '5.1'
exclude:
- python-version: 3.9
django-version: 5.0
- python-version: 3.9
django-version: 5.1

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -50,4 +56,4 @@ jobs:
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0]

### Added
- Support for Django 5.0 and 5.1
- Support for Python 3.12 and 3.13

### Removed
- Support for Django 3.2 and 4.1
- Support for Python 3.8

## [1.0.0]

### Added
- Initial setup

[Unreleased]: https://github.com/anexia/django-generic-contact/compare/1.0.0...HEAD
[Unreleased]: https://github.com/anexia/django-generic-contact/compare/1.1.0...HEAD
[1.1.0]: https://github.com/anexia/django-generic-contact/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/anexia/django-generic-contact/releases/tag/1.0.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ GENERIC_CONTACT_DATA_SCHEMA = {
See more examples of `GENERIC_CONTACT_DATA_SCHEMA` in `tests/testapp/tests/test_model.py`.

#### Customizing the Contact model
The base model `GenericContact` only requires the `data`. Thus you can let your own models inherit from this and extend
The base model `GenericContact` only requires the `data`. Thus, you can let your own models inherit from this and extend
it according to your project's needs, e.g.:

```
Expand Down
3 changes: 2 additions & 1 deletion django_generic_contact/validators.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import jsonschema
from django.core.exceptions import ValidationError
from django.core.validators import BaseValidator
from jsonschema.validators import Draft202012Validator


class JSONSchemaValidator(BaseValidator):
def compare(self, value, schema):
try:
jsonschema.validate(
value, schema, format_checker=jsonschema.draft202012_format_checker
value, schema, format_checker=Draft202012Validator.FORMAT_CHECKER
)
except jsonschema.exceptions.ValidationError as e:
raise ValidationError(str(e))
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
-e .

# Development dependencies
setuptools>=68.2.2,<68.3
wheel>=0.41.2,<0.42
twine>=4.0.2,<4.1
coverage>=7.3.2,<7.4
setuptools>=75.1.0,<76.2
wheel>=0.44.0,<0.45
twine>=5.1.1,<5.2
coverage>=7.6.2,<7.7

# Linters and formatters
pre-commit>=3.5.0,<3.6
pre-commit>=4.0.1,<4.2

# TestApp dependencies
django>=3.2,<4.3
jsonschema>=4.19.1,<4.20
django>=4.2,<5.2
jsonschema>=4.23.0,<4.24
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name="django-generic-contact",
version=os.getenv("PACKAGE_VERSION", "1.0.0").replace("refs/tags/", ""),
version=os.getenv("PACKAGE_VERSION", "1.1.0").replace("refs/tags/", ""),
packages=find_packages(),
include_package_data=True,
license="MIT License",
Expand All @@ -24,17 +24,18 @@
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
],
)
10 changes: 5 additions & 5 deletions tests/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@
WSGI_APPLICATION = "core.wsgi.application"

# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
# https://docs.djangoproject.com/en/stable/ref/settings/#databases

DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
"NAME": os.path.join(BASE_DIR, "../../testapp/db.sqlite3"),
}
}

# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
# https://docs.djangoproject.com/en/stable/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
Expand All @@ -89,7 +89,7 @@
]

# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/
# https://docs.djangoproject.com/en/stable/topics/i18n/

LANGUAGE_CODE = "en-us"

Expand All @@ -102,7 +102,7 @@
USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/
# https://docs.djangoproject.com/en/stable/howto/static-files/

STATIC_URL = "/static/"

Expand Down
2 changes: 1 addition & 1 deletion tests/core/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
WSGI config for core project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/
"""

import os
Expand Down

0 comments on commit aa8cf70

Please sign in to comment.