From b6c54e188e7dbb6385db372b23d2cc12a3b69c25 Mon Sep 17 00:00:00 2001 From: Sergey Lyapustin Date: Sun, 5 Jan 2025 12:56:19 +0100 Subject: [PATCH 1/6] Update dependencies and version for Python 3.9+ and Django 4.2+ --- .github/workflows/pypi.yml | 2 +- .github/workflows/test.yml | 9 ++++++--- README.md | 4 ++-- changelog.txt | 6 ++++++ django_classified/__init__.py | 9 +++++---- setup.cfg | 3 ++- setup.py | 24 +++++++++++++----------- 7 files changed, 35 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 0c65b86..5bb5c7d 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -36,7 +36,7 @@ jobs: with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ - name: Publish distribution 📦 to PyPI if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 90fb494..323387c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,13 +8,16 @@ 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", ] steps: diff --git a/README.md b/README.md index e30d688..842fc58 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ ## Requirements -* Python >=3.8 -* Django >=3.2 +* Python >=3.9 +* Django >=4.2 ## Design diff --git a/changelog.txt b/changelog.txt index 1867ece..3277bc5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,11 @@ Changelog ========= +v1.1.0 () +----------------- + - 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 diff --git a/django_classified/__init__.py b/django_classified/__init__.py index 1429f4e..4f80522 100644 --- a/django_classified/__init__.py +++ b/django_classified/__init__.py @@ -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" diff --git a/setup.cfg b/setup.cfg index b88034e..9a530fd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,3 @@ [metadata] -description-file = README.md +description_file = README.md +name = django-classified diff --git a/setup.py b/setup.py index b198af3..b26a0c6 100644 --- a/setup.py +++ b/setup.py @@ -7,34 +7,36 @@ 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="s.lyapustin@gmail.com", 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", + "Django>=4.2,<5.2", "Pillow>=6.0", "sorl-thumbnail>=12.6", "unidecode", # Babel is used for currency formatting - 'Babel>=1.0,<3.0', - ] + "Babel>=1.0,<3.0", + ], ) From 370706cc0bb853ea7deea07b8b40ca48ed344cb1 Mon Sep 17 00:00:00 2001 From: Sergey Lyapustin Date: Sun, 5 Jan 2025 13:03:57 +0100 Subject: [PATCH 2/6] Fix encoding in README.md and update package dependencies --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index b26a0c6..fb41227 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ 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( @@ -33,10 +33,10 @@ "django-bootstrap-form", "django-filter", "Django>=4.2,<5.2", - "Pillow>=6.0", - "sorl-thumbnail>=12.6", + "Pillow", + "sorl-thumbnail", "unidecode", # Babel is used for currency formatting - "Babel>=1.0,<3.0", + "babel", ], ) From 71b7b48c2348cd7143540d8fdb2344228d913165 Mon Sep 17 00:00:00 2001 From: Sergey Lyapustin Date: Sun, 5 Jan 2025 13:19:56 +0100 Subject: [PATCH 3/6] Update GitHub Actions workflow to exclude incompatible Python and Django version combinations --- .github/workflows/test.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 323387c..d4cd878 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,17 @@ jobs: "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 }} From f63674028077a491080883d3a05625de29562e8e Mon Sep 17 00:00:00 2001 From: Sergey Lyapustin Date: Sun, 5 Jan 2025 13:23:14 +0100 Subject: [PATCH 4/6] Upgrade pip, setuptools, and wheel in GitHub Actions workflow --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d4cd878..c2dae2a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,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 From 0f8fedd79c68e925ffeb8e766d414b98cb356cb6 Mon Sep 17 00:00:00 2001 From: Sergey Lyapustin Date: Sun, 5 Jan 2025 13:32:49 +0100 Subject: [PATCH 5/6] Enhance GitHub Actions workflow to support multiple Python versions and include twine for package publishing --- .github/workflows/pypi.yml | 57 +++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 5bb5c7d..fc67e77 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -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 }} From 8c85ef422eb3bc4a2ad3f19b06b913d9f74f657f Mon Sep 17 00:00:00 2001 From: Sergey Lyapustin Date: Sun, 5 Jan 2025 13:33:55 +0100 Subject: [PATCH 6/6] Update changelog for version 1.1.0 to reflect Python 3.11-3.13 and Django 4.2-5.2 support --- changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 3277bc5..b9f91c4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,6 @@ Changelog ========= -v1.1.0 () +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