Skip to content

Commit

Permalink
Merge pull request #69 from slyapustin/django-python-upgrade
Browse files Browse the repository at this point in the history
Django 4.2-5.2 support
  • Loading branch information
slyapustin authored Jan 5, 2025
2 parents 8b835d5 + 8c85ef4 commit 13b3235
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 50 deletions.
57 changes: 31 additions & 26 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,36 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: >-
python -m pip install --upgrade setuptools wheel
- name: Build
run: >-
python setup.py sdist bdist_wheel
# We do this, since failures on test.pypi aren't that bad
- name: Publish to Test PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish distribution 📦 to PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: >-
python -m pip install --upgrade setuptools wheel twine
- name: Build
run: >-
python setup.py sdist bdist_wheel
# We do this, since failures on test.pypi aren't that bad
- name: Publish to Test PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/

- name: Publish distribution 📦 to PyPI
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
21 changes: 18 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,29 @@ jobs:
strategy:
matrix:
python-version: [
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
]
django-version: [
"django>=3.2,<3.3",
"django>=4.0,<4.1",
"django>=4.2,<5.0",
"django>=5.0,<5.1",
"django>=5.1,<5.2",
]

# What Python version can I use with Django? https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
exclude:
- python-version: "3.9"
django-version: "django>=5.0,<5.1"
- python-version: "3.9"
django-version: "django>=5.1,<5.2"
- python-version: "3.13"
django-version: "django>=4.2,<5.0"
- python-version: "3.13"
django-version: "django>=5.0,<5.1"

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -26,6 +40,7 @@ jobs:

- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel --quiet
pip install "${{ matrix.django-version }}" --quiet
python setup.py install
pip install flake8
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

## Requirements

* Python >=3.8
* Django >=3.2
* Python >=3.9
* Django >=4.2

## Design

Expand Down
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Changelog
=========
v1.1.0 (05/01/2025)
-----------------
- Added support for Python 3.11-3.13, dropped Python 3.8 support
- Added Django 4.2-5.2 support, dropped Django 3.2 support


v1.0.0 (17/07/2022)
-----------------
- Drop Python 3.6,2.7 support
Expand Down
9 changes: 5 additions & 4 deletions django_classified/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
VERSION = (1, 0, 0)
VERSION = (1, 1, 0)


def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
"""Return the version as a human-format string."""
version = f"{VERSION[0]}.{VERSION[1]}"
# Append 3rd digit if > 0
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
version = f"{version}.{VERSION[2]}"

return version


default_app_config = 'django_classified.apps.DjangoClassifiedConfig'
default_app_config = "django_classified.apps.DjangoClassifiedConfig"
name = "django_classified"
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[metadata]
description-file = README.md
description_file = README.md
name = django-classified
30 changes: 16 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,40 @@

from django_classified import get_version # noqa isort:skip

with open("README.md") as fh:
with open("README.md", encoding="utf-8") as fh:
long_description = fh.read()

setuptools.setup(
author='Sergey Lyapustin',
author="Sergey Lyapustin",
name="django-classified",
version=get_version().replace(' ', '-'),
version=get_version().replace(" ", "-"),
author_email="[email protected]",
description="Django Classified",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/slyapustin/django-classified",
keywords='django classified',
packages=setuptools.find_packages(exclude=('demo',)),
python_requires=">=3.8",
keywords="django classified",
packages=setuptools.find_packages(exclude=("demo",)),
python_requires=">=3.9",
include_package_data=True,
zip_safe=False,
classifiers=[
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
"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",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
install_requires=[
"django-bootstrap-form",
"django-filter",
"Django>=3.2,<4.1",
"Pillow>=6.0",
"sorl-thumbnail>=12.6",
"Django>=4.2,<5.2",
"Pillow",
"sorl-thumbnail",
"unidecode",
# Babel is used for currency formatting
'Babel>=1.0,<3.0',
]
"babel",
],
)

0 comments on commit 13b3235

Please sign in to comment.