Skip to content

Fix DeprecationWarnings. Drop Plone 5.2 support. #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,25 @@ jobs:
matrix:
config:
# [Python version, tox env]
- ["3.7", "plone52-py37"]
- ["3.8", "plone52-py38"]
- ["3.8", "plone60-py38"]
- ["3.9", "plone60-py39"]
- ["3.10", "plone60-py310"]
- ["3.11", "plone60-py311"]
- ["3.12", "plone60-py312"]
- ["3.13", "plone60-py313"]
- ["3.10", "plone61-py310"]
- ["3.11", "plone61-py311"]
- ["3.12", "plone61-py312"]
- ["3.13", "plone61-py313"]
runs-on: ubuntu-latest
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
Expand Down
1 change: 1 addition & 0 deletions news/4090.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Drop support for Plone 5.2. [maurits]
1 change: 1 addition & 0 deletions news/4090.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix DeprecationWarnings. [maurits]
7 changes: 1 addition & 6 deletions plone/namedfile/picture.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from bs4 import BeautifulSoup
from plone.app.uuid.utils import uuidToObject
from plone.base.interfaces import IImagingSchema
from plone.namedfile.interfaces import IAvailableSizes
from plone.registry.interfaces import IRegistry
from zope.component import getUtility
Expand All @@ -9,12 +10,6 @@
import re


try:
from plone.base.interfaces import IImagingSchema
except ImportError:
from Products.CMFPlone.interfaces.controlpanel import IImagingSchema


logger = logging.getLogger(__name__)
appendix_re = re.compile("^(.*)([?#].*)$")
resolveuid_re = re.compile("^[./]*resolve[Uu]id/([^/]*)/?(.*)$")
Expand Down
2 changes: 1 addition & 1 deletion plone/namedfile/scaling.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<browser:page
allowed_attributes="scale tag"
class=".scaling.NavigationRootScaling"
for="plone.app.layout.navigation.interfaces.INavigationRoot"
for="plone.base.interfaces.INavigationRoot"
name="image_scale"
permission="zope2.View"
/>
Expand Down
5 changes: 1 addition & 4 deletions plone/namedfile/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from io import BytesIO
from io import FileIO
from logging import getLogger
from plone.base.interfaces import IImagingSchema
from plone.namedfile.interfaces import IBlobby
from plone.namedfile.utils.jpeg_utils import process_jpeg
from plone.namedfile.utils.png_utils import process_png
Expand All @@ -25,10 +26,6 @@

log = getLogger(__name__)

try:
from plone.base.interfaces.controlpanel import IImagingSchema
except ImportError:
from Products.CMFPlone.interfaces.controlpanel import IImagingSchema

try:
# Zope 5.8.6+
Expand Down
4 changes: 0 additions & 4 deletions requirements-52.txt

This file was deleted.

7 changes: 7 additions & 0 deletions requirements-61.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-e .[test]
zope.testrunner
# Somehow the Zope[wsgi] dependency of CMFPlone is not pulled in, making all tests fail.
# So include it explicitly for now.
Zope[wsgi]
--pre
-c https://dist.plone.org/release/6.1-dev/constraints.txt
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os


version = "6.4.1.dev0"
version = "7.0.0.dev0"

description = "File types and fields for images, files and blob files with filenames"
long_description = "\n\n".join(
Expand All @@ -24,15 +24,15 @@
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Plone",
"Framework :: Plone :: 5.2",
"Framework :: Plone :: 6.0",
"Framework :: Plone :: 6.1",
"Framework :: Plone :: Core",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"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",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: BSD License",
],
Expand All @@ -45,7 +45,7 @@
namespace_packages=["plone"],
include_package_data=True,
zip_safe=False,
python_requires=">=3.7",
python_requires=">=3.8",
install_requires=[
"persistent",
"piexif",
Expand All @@ -67,7 +67,7 @@
"plone.app.testing",
"lxml",
"Pillow",
"plone.testing[z2]",
"plone.testing",
],
},
)
19 changes: 0 additions & 19 deletions sources-52.ini

This file was deleted.

11 changes: 11 additions & 0 deletions sources-61.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[settings]
# This is a mxdev configuration file
#
# available options are documented at
# https://pypi.org/project/mxdev/

requirements-in = requirements-61.txt
requirements-out = requirements-61-mxdev.txt
constraints-out = constraints-61-mxdev.txt
ignores =
plone.namedfile
22 changes: 13 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[tox]
envlist =
plone52-py37,
plone52-py38,
plone60-py38,
plone60-py39,
plone60-py310,
plone60-py311,
plone60-py312,
plone60-py313,
plone61-py310,
plone61-py311,
plone61-py312,
plone61-py313,

skip_missing_interpreters = False

Expand All @@ -17,15 +20,16 @@ commands =
pip list
zope-testrunner --test-path={toxinidir} -s plone.namedfile {posargs:-vc}

[testenv:plone52-py{37,38}]
[testenv:plone60-py{39,310,311,312,313}]
commands_pre =
pip install -U pip
pip install -U --pre mxdev
mxdev -c sources-52.ini
pip install --use-deprecated legacy-resolver -rrequirements-52-mxdev.txt
mxdev -c sources-60.ini
pip install -rrequirements-60-mxdev.txt

[testenv:plone60-py{38,39,310,311}]
[testenv:plone61-py{310,311,312,313}]
commands_pre =
pip install -U pip
pip install -U --pre mxdev
mxdev -c sources-60.ini
pip install -rrequirements-60-mxdev.txt
mxdev -c sources-61.ini
pip install -rrequirements-61-mxdev.txt
Loading