Deprecate Python 3.7 (EOL: 2023-06-27)

This commit is contained in:
Martin Wendt 2023-08-12 09:39:24 +02:00
parent 0619d59757
commit 3b4e61f28f
7 changed files with 147 additions and 41 deletions

View file

@ -2,45 +2,45 @@ language: python
dist: jammy
matrix:
include:
- python: "3.11" # EOL 2027-10-24
env: TOXENV=check,py311
- python: "3.10" # EOL 2026-10-04
env: TOXENV=py310
- python: "3.9" # EOL 2025-10-05
env: TOXENV=py39
- python: "3.8" # EOL 2024-10-14
env: TOXENV=py38
# - python: "3.7" # EOL 2023-06-27
# env: TOXENV=py37
# - python: "3.6" # EOL 2021-12-21
# env: TOXENV=py36
# - python: "3.5" # EOL 2020-09-13
# env: TOXENV=py35
# - python: "3.4" # EOL 2019-03-18
# env: TOXENV=py34
- python: "3.12-dev"
env: TOXENV=py312
allow_failures:
- python: "3.12-dev"
env: TOXENV=py312
include:
- python: "3.11" # EOL 2027-10-24
env: TOXENV=check,py311
- python: "3.10" # EOL 2026-10-04
env: TOXENV=py310
- python: "3.9" # EOL 2025-10-05
env: TOXENV=py39
- python: "3.8" # EOL 2024-10-14
env: TOXENV=py38
- python: "3.7" # EOL 2023-06-27
env: TOXENV=py37
# - python: "3.6" # EOL 2021-12-21
# env: TOXENV=py36
# - python: "3.5" # EOL 2020-09-13
# env: TOXENV=py35
# - python: "3.4" # EOL 2019-03-18
# env: TOXENV=py34
- python: "3.12-dev"
env: TOXENV=py312
allow_failures:
- python: "3.12-dev"
env: TOXENV=py312
before_install:
# See issue #80: litmus fails to build on travis
# The branch 'travis-litmus' still has this enabled to investigate...
# See issue #80: litmus fails to build on travis
# The branch 'travis-litmus' still has this enabled to investigate...
# - sudo apt-get install libneon27-dev
# - ./install_litmus.sh
services:
- redis-server
- redis-server
install:
- travis_retry pip install -U pip setuptools # for Py37
- travis_retry pip install -U tox coveralls coverage
- travis_retry pip install -U pip setuptools # for Py37
- travis_retry pip install -U tox coveralls coverage
script:
- travis_retry tox
- travis_retry tox
after_success:
- coverage combine
- coveralls
- coverage combine
- coveralls

View file

@ -4,7 +4,7 @@
- BREAKING:
- See option `fs_dav_provider.follow_symlinks` below.
- Stop testing Python 3.7 (EOL: 2023-06-27)
- Deprecate Python 3.7 (EOL: 2023-06-27)
- Install pam_dc dependencies using extra syntax: `pip install wsgidav[pam]`
- #281 Requesting range off end of file does not return 416 status code
- #282 Hotfix PUT request without content-length (fix for Finder on MacOS Ventura)

89
Pipfile.lock generated
View file

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "289f2f86cbcd30aa45a888daf24f2984d130418bd4c0bfa1bec52bf66dc68d20"
"sha256": "2602537a2b140562230c639e870ccfc70b2b3d48e1e36ad90a3e0b55d4c378ea"
},
"pipfile-spec": 6,
"requires": {
@ -16,6 +16,30 @@
]
},
"default": {
"cachetools": {
"hashes": [
"sha256:95ef631eeaea14ba2e36f06437f36463aac3a096799e876ee55e5cdccb102590",
"sha256:dce83f2d9b4e1f732a8cd44af8e8fab2dbe46201467fc98b3ef8f269092bf62b"
],
"markers": "python_version >= '3.7'",
"version": "==5.3.1"
},
"chardet": {
"hashes": [
"sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7",
"sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970"
],
"markers": "python_version >= '3.7'",
"version": "==5.2.0"
},
"colorama": {
"hashes": [
"sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44",
"sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"
],
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'",
"version": "==0.4.6"
},
"defusedxml": {
"hashes": [
"sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69",
@ -24,6 +48,21 @@
"index": "pypi",
"version": "==0.7.1"
},
"distlib": {
"hashes": [
"sha256:2e24928bc811348f0feb63014e97aaae3037f2cf48712d51ae61df7fd6075057",
"sha256:9dafe54b34a028eafd95039d5e5d4851a13734540f1331060d31c9916e7147a8"
],
"version": "==0.3.7"
},
"filelock": {
"hashes": [
"sha256:002740518d8aa59a26b0c76e10fb8c6e15eae825d34b6fdf670333fd7b938d81",
"sha256:cbb791cdea2a72f23da6ac5b5269ab0a0d161e9ef0100e653b69049a7706d1ec"
],
"markers": "python_version >= '3.7'",
"version": "==3.12.2"
},
"jinja2": {
"hashes": [
"sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852",
@ -96,6 +135,38 @@
"markers": "python_version >= '3.7'",
"version": "==2.1.3"
},
"packaging": {
"hashes": [
"sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61",
"sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"
],
"markers": "python_version >= '3.7'",
"version": "==23.1"
},
"platformdirs": {
"hashes": [
"sha256:b45696dab2d7cc691a3226759c0d3b00c47c8b6e293d96f6436f733303f77f6d",
"sha256:d7c24979f292f916dc9cbf8648319032f551ea8c49a4c9bf2fb556a02070ec1d"
],
"markers": "python_version >= '3.7'",
"version": "==3.10.0"
},
"pluggy": {
"hashes": [
"sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849",
"sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"
],
"markers": "python_version >= '3.7'",
"version": "==1.2.0"
},
"pyproject-api": {
"hashes": [
"sha256:14cf09828670c7b08842249c1f28c8ee6581b872e893f81b62d5465bec41502f",
"sha256:ffb5b2d7cad43f5b2688ab490de7c4d3f6f15e0b819cb588c4b771567c9729eb"
],
"markers": "python_version >= '3.7'",
"version": "==1.5.3"
},
"pyyaml": {
"hashes": [
"sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc",
@ -142,6 +213,22 @@
"index": "pypi",
"version": "==6.0.1"
},
"tox": {
"hashes": [
"sha256:79399a3d4641d1fd15eb6bd62c2f35923988038bf0ecf37a688b5e7a767de7d7",
"sha256:89120e1568c763924301cfde61ba7d4b5c4615eeb1086d5370deb03e9cf63c41"
],
"index": "pypi",
"version": "==4.7.0"
},
"virtualenv": {
"hashes": [
"sha256:95a6e9398b4967fbcb5fef2acec5efaf9aa4972049d9ae41f95e0972a683fd02",
"sha256:e5c3b4ce817b0b328af041506a2a299418c98747c4b1e68cb7527e74ced23efc"
],
"markers": "python_version >= '3.7'",
"version": "==20.24.3"
},
"wsgidav": {
"editable": true,
"path": "."

View file

@ -35,8 +35,8 @@ classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
; Programming Language :: Python :: 3.6
; Programming Language :: Python :: 3.7
# NOTE: See also wsgidav_app.MIN_PYTHON_VERSION_INFO
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10

View file

@ -7,7 +7,7 @@ envlist =
py310 # EOL 2026-10-04
py39 # EOL 2025-10-05
py38 # EOL 2024-10-14
# py37 # EOL 2023-06-27
py37 # EOL 2023-06-27
# py36 # EOL 2021-12-21
# py35 # EOL 2020-09-13
# py34 # EOL 2019-03-18

View file

@ -17,6 +17,7 @@ import socket
import stat
import sys
import time
import warnings
from copy import deepcopy
from email.utils import formatdate, parsedate
from hashlib import md5
@ -55,6 +56,20 @@ class NO_DEFAULT:
""""""
def check_python_version(min_version: tuple[str]) -> bool:
"""Check for deprecated Python version."""
if sys.version_info < min_version:
min_ver = ".".join([str(s) for s in min_version[:3]])
warnings.warn(
f"Support for Python version less than `{min_ver}` is deprecated "
f"(using {PYTHON_VERSION})",
DeprecationWarning,
stacklevel=2,
)
return False
return True
# ========================================================================
# String tools
# ========================================================================
@ -1663,9 +1678,7 @@ def parse_if_header_dict(environ):
ifLockList = []
resource1 = "*"
for (tmpURLVar, URLVar, _tmpContentVar, contentVar) in reIfSeparator.findall(
iftext
):
for tmpURLVar, URLVar, _tmpContentVar, contentVar in reIfSeparator.findall(iftext):
if tmpURLVar != "":
resource1 = URLVar
else:
@ -1714,7 +1727,7 @@ def test_if_header_dict(dav_res, if_dict, fullurl, locktoken_list, entity_tag):
for listTestConds in listTest:
matchfailed = False
for (testflag, checkstyle, checkvalue) in listTestConds:
for testflag, checkstyle, checkvalue in listTestConds:
if checkstyle == "entity" and supportEntityTag:
testresult = entity_tag == checkvalue
elif checkstyle == "entity":

View file

@ -64,6 +64,7 @@ from wsgidav.lock_man.lock_storage import LockStorageDict
from wsgidav.mw.base_mw import BaseMiddleware
from wsgidav.prop_man.property_manager import PropertyManager
from wsgidav.util import (
check_python_version,
dynamic_import_class,
dynamic_instantiate_class_from_opts,
safe_re_encode,
@ -130,12 +131,17 @@ def _check_config(config):
return True
#: Minimal Python version that is supported by WsgiDAV
MIN_PYTHON_VERSION_INFO = (3, 8)
check_python_version(MIN_PYTHON_VERSION_INFO)
# ========================================================================
# WsgiDAVApp
# ========================================================================
class WsgiDAVApp:
def __init__(self, config):
self.config = copy.deepcopy(DEFAULT_CONFIG)
util.deep_update(self.config, config)
config = self.config
@ -275,6 +281,7 @@ class WsgiDAVApp:
__version__, util.PYTHON_VERSION, platform.platform(aliased=True)
)
)
if self.verbose >= 4:
_logger.info(
"Default encoding: {!r} (file system: {!r})".format(
@ -414,7 +421,6 @@ class WsgiDAVApp:
return share, self.provider_map.get(share)
def __call__(self, environ, start_response):
# util.log("SCRIPT_NAME={!r}, PATH_INFO={!r}".format(
# environ.get("SCRIPT_NAME"), environ.get("PATH_INFO")))