Skip to content

Commit

Permalink
MAINT drop support for python 3.6/3.7 (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiedbb authored Sep 23, 2022
1 parent b9897ce commit 8826b8b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 22 deletions.
34 changes: 21 additions & 13 deletions .azure_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ stages:
VERSION_PYTHON: '*'
PACKAGER: 'conda-forge'
BLAS: 'mkl'
py39_conda_forge_openblas:
VERSION_PYTHON: '3.9'
py310_conda_forge_openblas:
VERSION_PYTHON: '3.10'
PACKAGER: 'conda-forge'
BLAS: 'openblas'
py37_conda:
VERSION_PYTHON: '3.7'
py39_conda:
VERSION_PYTHON: '3.9'
PACKAGER: 'conda'
py36_pip:
VERSION_PYTHON: '3.6'
py38_pip:
VERSION_PYTHON: '3.8'
PACKAGER: 'pip'


Expand All @@ -52,16 +52,16 @@ stages:
VERSION_PYTHON: '3.8'
CC_OUTER_LOOP: 'gcc'
CC_INNER_LOOP: 'gcc'
py36_ubuntu_openblas_gcc_gcc:
py38_ubuntu_openblas_gcc_gcc:
PACKAGER: 'ubuntu'
APT_BLAS: 'libopenblas-base libopenblas-dev'
VERSION_PYTHON: '3.8'
CC_OUTER_LOOP: 'gcc'
CC_INNER_LOOP: 'gcc'
# Linux + Python 3.7 and homogeneous runtime nesting.
py37_conda_openblas_clang_clang:
# Linux + Python 3.9 and homogeneous runtime nesting.
py39_conda_openblas_clang_clang:
PACKAGER: 'conda'
VERSION_PYTHON: '3.7'
VERSION_PYTHON: '3.9'
BLAS: 'openblas'
CC_OUTER_LOOP: 'clang-10'
CC_INNER_LOOP: 'clang-10'
Expand Down Expand Up @@ -137,16 +137,24 @@ stages:
- template: continuous_integration/posix.yml
parameters:
name: macOS
vmImage: macOS-10.15
vmImage: macOS-11
matrix:
# MacOS environment with OpenMP installed through homebrew
py36_conda_homebrew_libomp:
py38_conda_homebrew_libomp:
PACKAGER: 'conda'
VERSION_PYTHON: '3.6'
VERSION_PYTHON: '3.8'
BLAS: 'openblas'
CC_OUTER_LOOP: 'clang'
CC_INNER_LOOP: 'clang'
INSTALL_LIBOMP: 'homebrew'
# MacOS env with OpenBLAS and OpenMP installed through conda-forge compilers
py39_conda_forge_clang_openblas:
PACKAGER: 'conda-forge'
VERSION_PYTHON: '*'
BLAS: 'openblas'
CC_OUTER_LOOP: 'clang'
CC_INNER_LOOP: 'clang'
INSTALL_LIBOMP: 'conda-forge'
# MacOS environment with OpenMP installed through conda-forge compilers
pylatest_conda_forge_clang:
PACKAGER: 'conda-forge'
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
3.2.0 (TBD)
===========

- Dropped support for Python 3.6 and 3.7.

3.1.0 (2022-01-31)
==================

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ decorators are accessible through their `wrap` method:
### Sequential BLAS within OpenMP parallel region

When one wants to have sequential BLAS calls within an OpenMP parallel region, it's
safer to set `limits="sequential_blas_under_openmp"` since setting `limits=1` and `user_api="blas"` might not lead to the expected behavior in some configurations
safer to set `limits="sequential_blas_under_openmp"` since setting `limits=1` and
`user_api="blas"` might not lead to the expected behavior in some configurations
(e.g. OpenBLAS with the OpenMP threading layer
https://github.com/xianyi/OpenBLAS/issues/2985).

Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ author = "Thomas Moreau"
author-email = "thomas.moreau.2010@gmail.com"
home-page = "https://github.com/joblib/threadpoolctl"
description-file = "README.md"
requires-python = ">=3.6"
requires-python = ">=3.8"
license = "BSD-3-Clause"
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries :: Python Modules",
]

[tool.black]
line-length = 88
target_version = ['py36', 'py37', 'py38', 'py39']
experimental_string_processing = true
target_version = ['py38', 'py39', 'py310']
preview = true
2 changes: 1 addition & 1 deletion tests/test_threadpoolctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def test_nested_prange_blas(nthreads_outer):

# the method `get_original_num_threads` raises a UserWarning due to different
# num_threads from libraries with the same `user_api`. It will be raised only
# in the CI job with 2 openblas (py37_pip_openblas_gcc_clang). It is expected
# in the CI job with 2 openblas (py38_pip_openblas_gcc_clang). It is expected
# so we can safely filter it.
@pytest.mark.filterwarnings("ignore::UserWarning")
@pytest.mark.parametrize("limit", [1, None])
Expand Down
10 changes: 8 additions & 2 deletions threadpoolctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

# Structure to cast the info on dynamically loaded library. See
# https://linux.die.net/man/3/dl_iterate_phdr for more details.
_SYSTEM_UINT = ctypes.c_uint64 if sys.maxsize > 2 ** 32 else ctypes.c_uint32
_SYSTEM_UINT_HALF = ctypes.c_uint32 if sys.maxsize > 2 ** 32 else ctypes.c_uint16
_SYSTEM_UINT = ctypes.c_uint64 if sys.maxsize > 2**32 else ctypes.c_uint32
_SYSTEM_UINT_HALF = ctypes.c_uint32 if sys.maxsize > 2**32 else ctypes.c_uint16


class _dl_phdr_info(ctypes.Structure):
Expand Down Expand Up @@ -768,6 +768,12 @@ def _get_libc(cls):
if libc is None:
libc_name = find_library("c")
if libc_name is None: # pragma: no cover
warnings.warn(
"libc not found. The ctypes module in Python "
f"{sys.version_info.major}.{sys.version_info.minor} is maybe too "
"old for this OS.",
RuntimeWarning,
)
return None
libc = ctypes.CDLL(libc_name, mode=_RTLD_NOLOAD)
cls._system_libraries["libc"] = libc
Expand Down

0 comments on commit 8826b8b

Please sign in to comment.