Skip to content

Commit

Permalink
Remove official Py2 support but keep building Linux wheels for it.
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder committed Dec 17, 2024
1 parent 375d793 commit f89f0f0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 65 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
Expand Down Expand Up @@ -126,7 +126,6 @@ jobs:
matrix:
os: [macos-latest, windows-latest]
python-version:
- "2.7"
- "3.8"
- "3.9"
- "3.10"
Expand All @@ -135,11 +134,6 @@ jobs:
- "3.13"
- "3.14-dev"

exclude:
# fails due to lack of a compatible compiler
- os: windows-latest
python-version: 2.7

runs-on: ${{ matrix.os }}

env:
Expand All @@ -150,7 +144,6 @@ jobs:

- name: Set up Python
uses: actions/setup-python@v5
if: startsWith(matrix.python-version, '3.')
with:
python-version: ${{ matrix.python-version }}

Expand Down
56 changes: 2 additions & 54 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ code slips in accidentally.
How fast is it?
---------------

Here are some timings for Python 2.7 for the following scenarios:
Here are some timings for the following scenarios:

1) five acquire-release cycles ('lock_unlock')
2) five acquire calls followed by five release calls (nested locking, 'reentrant_lock_unlock')
Expand All @@ -71,59 +71,7 @@ substantially slower for both locks and the benchmark includes the thread
creation time, so I only looped 1000x here to get useful
timings instead of 100000x for the single threaded case.

::

Testing _RLock (2.7.18)

sequential (x100000):
lock_unlock : 853.55 msec
reentrant_lock_unlock : 684.52 msec
mixed_lock_unlock : 758.27 msec
lock_unlock_nonblocking : 860.40 msec
context_manager : 2876.00 msec

threaded 10T (x1000):
lock_unlock : 2210.69 msec
reentrant_lock_unlock : 1864.38 msec
mixed_lock_unlock : 1963.10 msec
lock_unlock_nonblocking : 3709.91 msec
context_manager : 2640.32 msec

Testing FastRLock (0.8.1)

sequential (x100000):
lock_unlock : 139.76 msec
reentrant_lock_unlock : 137.56 msec
mixed_lock_unlock : 140.75 msec
lock_unlock_nonblocking : 164.64 msec
context_manager : 593.06 msec

threaded 10T (x1000):
lock_unlock : 1621.13 msec
reentrant_lock_unlock : 1807.09 msec
mixed_lock_unlock : 1834.21 msec
lock_unlock_nonblocking : 1642.06 msec
context_manager : 1730.29 msec

Testing Cython interface of FastRLock (0.8.1)

sequential (x100000):
lock_unlock : 19.14 msec
reentrant_lock_unlock : 19.12 msec
mixed_lock_unlock : 16.81 msec
lock_unlock_nonblocking : 14.49 msec

threaded 10T (x1000):
lock_unlock : 1511.85 msec
reentrant_lock_unlock : 1541.96 msec
mixed_lock_unlock : 1585.70 msec
lock_unlock_nonblocking : 1585.35 msec


How does it compare to Python 3.7 and later?
--------------------------------------------

The results here are more mixed. Depending on the optimisation of the CPython
The results here are mixed. Depending on the optimisation of the CPython
installation, it can be faster, about the same speed, or somewhat slower.
In any case, the direct Cython interface is always faster than going through
the Python API, because it avoids the Python call overhead and executes
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,13 @@ def read_file(filename):
'Intended Audience :: Information Technology',
'License :: OSI Approved :: MIT License',
'Programming Language :: Cython',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Operating System :: OS Independent',
'Topic :: Software Development',
],

packages=[PKGNAME],
package_data={PKGNAME: ['*.pxd', '*.pxi']},
package_data={PKGNAME: ['*.pyx', '*.pxd', '*.pxi']},
ext_modules=ext_modules,
zip_safe=False,

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,37,38,39,310,311,312,313}
envlist = py{37,38,39,310,311,312,313}

[testenv]
platform =
Expand Down

0 comments on commit f89f0f0

Please sign in to comment.