Skip to content
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

Python 3.13 support #158

Merged
merged 3 commits into from
Dec 3, 2024
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
27 changes: 23 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ workflows:
workflow:
jobs:
- test_python_34
- test_old_pythons:
matrix:
parameters:
python_version: ["2.7", "3.5", "3.6", "3.7"]
- test:
matrix:
parameters:
python_version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
- test_pypy:
matrix:
parameters:
Expand All @@ -27,7 +31,7 @@ jobs:
docker:
- image: circleci/python:3.4

test:
test_old_pythons:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These versions of Python don't have access to setuptools==71.1.0, so were implicitly pinned at older versions already.

parameters:
python_version:
type: string
Expand All @@ -39,6 +43,21 @@ jobs:
docker:
- image: cimg/python:<<parameters.python_version>>

test:
parameters:
python_version:
type: string
steps:
- checkout
- run:
name: Test
# setuptools dropped support for being a test runner in v72.0.0
command: |
pip install --force-reinstall 'setuptools==71.1.0'
python setup.py test
docker:
- image: cimg/python:<<parameters.python_version>>

test_pypy:
parameters:
python_version:
Expand Down Expand Up @@ -67,7 +86,7 @@ jobs:
. venv/bin/activate
rst-lint --encoding=utf-8 README.rst
docker:
- image: cimg/python:3.12
- image: cimg/python:3.13

clang-format:
working_directory: ~/code
Expand All @@ -91,4 +110,4 @@ jobs:
fi
done
docker:
- image: cimg/python:3.12
- image: cimg/python:3.13
4 changes: 2 additions & 2 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.12"
python-version: "3.13"

- run: |
pip install packaging
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.12"
python-version: "3.13"

- name: Get build tool
run: pip install --upgrade build
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

* Add support for aarch64 wheels. Thank you @bbayles!
* Add wheels for PyPy 3.10
* Added Python 3.13 support

# 2.x.x

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ciso8601
``ciso8601`` converts `ISO 8601`_ or `RFC 3339`_ date time strings into Python datetime objects.

Since it's written as a C module, it is much faster than other Python libraries.
Tested with cPython 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12.
Tested with cPython 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13.

.. _ISO 8601: https://en.wikipedia.org/wiki/ISO_8601
.. _RFC 3339: https://tools.ietf.org/html/rfc3339
Expand Down
12 changes: 6 additions & 6 deletions benchmarking/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ RUN apt-get install -y git curl gcc build-essential
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata

# Install the Python versions
RUN apt install -y python2 python2-dev && \
apt install -y python3.7 python3.7-dev python3.7-venv && \
RUN apt install -y python3.7 python3.7-dev python3.7-venv && \
apt install -y python3.8 python3.8-dev python3.8-venv && \
apt install -y python3.9 python3.9-dev python3.9-venv && \
apt install -y python3.10 python3.10-dev python3.10-venv && \
apt install -y python3.11 python3.11-dev python3.11-venv && \
apt install -y python3.12 python3.12-dev python3.12-venv
apt install -y python3.12 python3.12-dev python3.12-venv && \
apt install -y python3.13 python3.13-dev python3.13-venv

# Make Python 3.12 the default `python`
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.12 10
# Make Python 3.13 the default `python`
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.13 10

# Get pip
RUN python -m ensurepip --upgrade
Expand All @@ -41,4 +41,4 @@ RUN git clone https://github.com/closeio/ciso8601.git && \
chmod +x /ciso8601/benchmarking/run_benchmarks.sh

WORKDIR /ciso8601/benchmarking
ENTRYPOINT ./run_benchmarks.sh
ENTRYPOINT ["bash", "./run_benchmarks.sh"]
4 changes: 2 additions & 2 deletions benchmarking/perform_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def run_tests(timestamp, results_directory, compare_to):
auto_range_count_filepath = os.path.join(results_directory, "auto_range_counts.csv")
test_interation_counts = auto_range_counts(auto_range_count_filepath)

exec(ISO_8601_MODULES[compare_to][0])
exec(ISO_8601_MODULES[compare_to][0], globals())
expected_parse_result = eval(ISO_8601_MODULES[compare_to][1].format(timestamp=timestamp))

results = []
Expand All @@ -178,7 +178,7 @@ def run_tests(timestamp, results_directory, compare_to):
time_taken = None
exception = None
try:
exec(setup)
exec(setup, globals())
parse_result = eval(stmt.format(timestamp=timestamp))

timer = timeit.Timer(stmt=stmt.format(timestamp=timestamp), setup=setup)
Expand Down
2 changes: 1 addition & 1 deletion benchmarking/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
requires =
tox>=4
envlist = py312,py311,py310,py39,py38,py37
envlist = py313,py312,py311,py310,py39,py38,py37
setupdir=..

[testenv]
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"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",
],
)