Skip to content

Commit

Permalink
Drop Python 3.7 and lower
Browse files Browse the repository at this point in the history
  • Loading branch information
Secrus committed Aug 15, 2023
1 parent 071bf63 commit 002e0f6
Show file tree
Hide file tree
Showing 6 changed files with 525 additions and 548 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
with:
package-dir: .
output-dir: dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
defaults:
run:
shell: bash
Expand Down
20 changes: 8 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ Pendulum
.. image:: https://img.shields.io/pypi/l/pendulum.svg
:target: https://pypi.python.org/pypi/pendulum

.. image:: https://img.shields.io/codecov/c/github/sdispater/pendulum/master.svg
:target: https://codecov.io/gh/sdispater/pendulum/branch/master

.. image:: https://github.com/sdispater/pendulum/actions/workflows/tests.yml/badge.svg
:alt: Pendulum Build status
:target: https://github.com/sdispater/pendulum/actions


Python datetimes made easy.

Supports Python **2.7** and **3.4+**.
Supports Python **3.8 and newer**.


.. code-block:: python
Expand Down Expand Up @@ -56,6 +53,13 @@ Supports Python **2.7** and **3.4+**.
'2013-03-31T03:00:00+02:00'
Resources
=========

* `Official Website <https://pendulum.eustace.io>`_
* `Documentation <https://pendulum.eustace.io/docs/>`_
* `Issue Tracker <https://github.com/sdispater/pendulum/issues>`_

Why Pendulum?
=============

Expand Down Expand Up @@ -121,14 +125,6 @@ a possible solution, if any:
return '' if val is None else val.isoformat()
Resources
=========

* `Official Website <https://pendulum.eustace.io>`_
* `Documentation <https://pendulum.eustace.io/docs/>`_
* `Issue Tracker <https://github.com/sdispater/pendulum/issues>`_


Contributing
============

Expand Down
11 changes: 3 additions & 8 deletions pendulum/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import calendar
import datetime
import sys
import traceback

from typing import TYPE_CHECKING
Expand Down Expand Up @@ -1243,13 +1242,9 @@ def __add__(self, other: datetime.timedelta) -> Self:
if not isinstance(other, datetime.timedelta):
return NotImplemented

if sys.version_info >= (3, 8):
# This is a workaround for Python 3.8+
# since calling astimezone() will call this method
# instead of the base datetime class one.
caller = traceback.extract_stack(limit=2)[0].name
if caller == "astimezone":
return super().__add__(other)
caller = traceback.extract_stack(limit=2)[0].name
if caller == "astimezone":
return super().__add__(other)

return self._add_timedelta_(other)

Expand Down
Loading

0 comments on commit 002e0f6

Please sign in to comment.