Skip to content

Commit

Permalink
Drop support for Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Cederstrand committed Oct 28, 2024
1 parent 573f6b7 commit 3b2b02c
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 53 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
needs: pre_job
strategy:
matrix:
python-version: ['3.8', '3.12']
python-version: ['3.9', '3.13']
include:
# Allow failure on Python dev - e.g. Cython install regularly fails
- python-version: "3.13-dev"
- python-version: "3.14-dev"
allowed_failure: true
max-parallel: 1

Expand All @@ -58,7 +58,7 @@ jobs:
- name: Install cutting-edge Cython-based packages on Python dev versions
continue-on-error: ${{ matrix.allowed_failure || false }}
if: matrix.python-version == '3.13-dev'
if: matrix.python-version == '3.14-dev'
run: |
sudo apt-get install libxml2-dev libxslt1-dev
python -m pip install git+https://github.com/cython/cython.git
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.13'

- name: Unencrypt secret file
env:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Change Log

HEAD
----
- Dropped support for Python 3.8 which is EOL per October 7, 2024.


5.4.3
Expand Down
2 changes: 1 addition & 1 deletion exchangelib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@
"discover",
]

# Set a default user agent, e.g. "exchangelib/3.1.1 (python-requests/2.22.0)"
import requests.utils

# Set a default user agent, e.g. "exchangelib/5.4.3 (python-requests/2.31.0)"
BaseProtocol.USERAGENT = f"{__name__}/{__version__} ({requests.utils.default_user_agent()})"


Expand Down
7 changes: 1 addition & 6 deletions exchangelib/ewsdatetime.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import datetime
import logging

try:
import zoneinfo
except ImportError:
from backports import zoneinfo
import zoneinfo

import tzlocal

Expand Down Expand Up @@ -283,7 +279,6 @@ def from_timezone(cls, tz):
try:
return {
cls.__module__.split(".")[0]: lambda z: z,
"backports": cls.from_zoneinfo,
"datetime": cls.from_datetime,
"dateutil": cls.from_dateutil,
"pytz": cls.from_pytz,
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name = "exchangelib"
dynamic = ["version"]
description = "Client for Microsoft Exchange Web Services (EWS)"
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.8"
requires-python = ">=3.9"
license = {text = "BSD-2-Clause"}
keywords = [
"autodiscover",
Expand All @@ -38,7 +38,6 @@ classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = [
'backports.zoneinfo; python_version < "3.9"',
"cached_property",
"defusedxml >= 0.6.0",
"dnspython >= 2.2.0",
Expand Down
6 changes: 1 addition & 5 deletions scripts/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
import datetime
import logging
import time
import zoneinfo
from pathlib import Path

try:
import zoneinfo
except ImportError:
from backports import zoneinfo

from yaml import safe_load

from exchangelib import DELEGATE, Account, CalendarItem, Configuration, Credentials, FaultTolerance
Expand Down
6 changes: 1 addition & 5 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
import time
import unittest
import unittest.util
import zoneinfo
from collections import namedtuple
from decimal import Decimal
from pathlib import Path

from yaml import safe_load

try:
import zoneinfo
except ImportError:
from backports import zoneinfo

from exchangelib.account import Account, Identity
from exchangelib.attachments import FileAttachment
from exchangelib.configuration import Configuration
Expand Down
6 changes: 1 addition & 5 deletions tests/test_ewsdatetime.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import datetime
import unittest
import zoneinfo

import dateutil.tz
import pytz
import requests_mock

try:
import zoneinfo
except ImportError:
from backports import zoneinfo

from exchangelib.errors import NaiveDateTimeNotAllowed, UnknownTimeZone
from exchangelib.ewsdatetime import UTC, EWSDate, EWSDateTime, EWSTimeZone
from exchangelib.util import CONNECTION_ERRORS
Expand Down
6 changes: 1 addition & 5 deletions tests/test_field.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import datetime
import warnings
import zoneinfo
from collections import namedtuple
from decimal import Decimal

try:
import zoneinfo
except ImportError:
from backports import zoneinfo

from exchangelib.extended_properties import ExternId
from exchangelib.fields import (
Base64Field,
Expand Down
6 changes: 1 addition & 5 deletions tests/test_items/test_contacts.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import datetime

try:
import zoneinfo
except ImportError:
from backports import zoneinfo
import zoneinfo

from exchangelib.errors import ErrorInvalidIdMalformed
from exchangelib.folders import Contacts
Expand Down
6 changes: 1 addition & 5 deletions tests/test_items/test_generic.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import datetime

try:
import zoneinfo
except ImportError:
from backports import zoneinfo
import zoneinfo

from exchangelib.attachments import ItemAttachment
from exchangelib.errors import ErrorInternalServerError, ErrorItemNotFound
Expand Down
6 changes: 1 addition & 5 deletions tests/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
import socket
import tempfile
import warnings
import zoneinfo
from contextlib import suppress
from unittest.mock import Mock, patch

try:
import zoneinfo
except ImportError:
from backports import zoneinfo

import psutil
import requests_mock
from oauthlib.oauth2 import InvalidClientIdError
Expand Down
6 changes: 1 addition & 5 deletions tests/test_restriction.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import datetime

try:
import zoneinfo
except ImportError:
from backports import zoneinfo
import zoneinfo

from exchangelib.folders import Calendar, Root
from exchangelib.queryset import Q
Expand Down

0 comments on commit 3b2b02c

Please sign in to comment.