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
PierreRaybaut committed Nov 6, 2024
1 parent b8c2aaa commit 5beaf68
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.12"]
python-version: ["3.9", "3.13"]

steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Version 2.7.0 ##

Supported versions of Python have been updated (drop support for Python 3.8, add support for Python 3.13):

* PlotPy < 2.7.0: Python 3.8, 3.9, 3.10, 3.11 and 3.12
* PlotPy >= 2.7.0: Python 3.9, 3.10, 3.11, 3.12 and 3.13

💥 New features / Enhancements:

* Added `AnnotatedPolygon` annotation to items
Expand Down
5 changes: 3 additions & 2 deletions doc/dev/platforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ The following sections describe the reference platforms for the project.

.. note::

The officially supported Python versions are 3.8, 3.9 and 3.10.
However, the project should work on any earlier Python 3 version.
The officially supported Python versions are 3.9, 3.10, 3.11, 3.12 and 3.13.

The officially supported Qt binding is PyQt5. However, efforts have been
made and will continue to be made to support PyQt6 and PySide6 as well.

The project is currently tested on the following platforms:

* Microsoft Windows 10 (64-bit)
* Microsoft Windows 11 (64-bit)
* CentOS Stream 8.8 (64-bit)
* Ubuntu 22.04 LTS (64-bit)

However, it should work on any other platform supported by its dependencies.

Expand Down
2 changes: 1 addition & 1 deletion doc/intro/motivation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ From a developer point of view, PlotPy V2 is a major overhaul of PlotPy V1:
all over the codebase

.. note::
PlotPy V2 is fully typed using Python 3.8+ type annotations.
PlotPy V2 is fully typed using Python type annotations.
This means that you can use your IDE to get autocompletion and type checking
(e.g. with VSCode, Visual Studio, etc.).
This is a major improvement when you write code using PlotPy V2:
Expand Down
14 changes: 7 additions & 7 deletions doc/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ The :mod:`plotpy` package requires the following Python modules:
- Version
- Summary
* - Python
- >=3.8, <4
- >=3.9, <4
- Python programming language
* - guidata
- >=3.4
- >=3.7
- Automatic GUI generation for easy dataset editing and display
* - PythonQwt
- >=0.12.1
- >=0.14
- Qt plotting widgets for Python
* - NumPy
- >=1.17
- Fundamental package for array computing in Python
* - SciPy
- >=1.3
- >=1.5
- Fundamental algorithms for scientific computing in Python
* - scikit-image
- >= 0.18
- Image processing in Python
* - Pillow
-
- Python Imaging Library (Fork)
Expand Down
2 changes: 1 addition & 1 deletion doc/update_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@

if __name__ == "__main__":
print("Updating requirements.rst file...", end=" ")
gen_module_req_rst(plotpy, ["Python>=3.8", "PyQt5>=5.11"])
gen_module_req_rst(plotpy, ["Python>=3.9", "PyQt5>=5.11"])
print("done.")
23 changes: 8 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# plotpy setup configuration file

[build-system]
requires = [
"setuptools",
"wheel",
"cython ~= 0.29.0",
"numpy >= 1.17; python_version == '3.8'",
"numpy >= 2.0.0; python_version > '3.8'",
]
requires = ["setuptools", "wheel", "cython ~= 0.29.0", "numpy >= 2.0.0"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -28,11 +22,11 @@ classifiers = [
"Operating System :: Microsoft :: Windows :: Windows 10",
"Operating System :: Microsoft :: Windows :: Windows 11",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Image Processing",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
Expand All @@ -42,12 +36,11 @@ classifiers = [
"Topic :: Software Development :: Widget Sets",
"Topic :: Utilities",
]
requires-python = ">=3.8, <4"
requires-python = ">=3.9, <4"
dependencies = [
"guidata>=3.6.2",
"PythonQwt>=0.12.1",
"NumPy>=1.17",
"SciPy>=1.3",
"guidata>=3.7",
"PythonQwt>=0.14",
"SciPy>=1.5",
"scikit-image >= 0.18",
"Pillow",
"tifffile",
Expand Down Expand Up @@ -90,7 +83,7 @@ addopts = "plotpy"
exclude = [".git", ".vscode", "build", "dist"]
line-length = 88 # Same as Black.
indent-width = 4 # Same as Black.
target-version = "py38" # Assume Python 3.8
target-version = "py39" # Assume Python 3.9.

[tool.ruff.lint]
# all rules can be found here: https://beta.ruff.rs/docs/rules/
Expand All @@ -109,5 +102,5 @@ line-ending = "auto" # Like Black, automatically detect the appropr
"doc/*" = ["E402"]

[tool.cibuildwheel]
build = ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
skip = ["*-manylinux_i686", "*-musllinux*"]
20 changes: 10 additions & 10 deletions scripts/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ set -e -u -x
ARCH=$(uname -m)
export PLAT=manylinux_2_24_$ARCH

# Accurately check if Python version is 3.8 or greater
function is_python_version_ge_38 {
# Accurately check if Python version is 3.9 or greater
function is_python_version_ge_39 {
local pydir="$1"
if [[ $pydir =~ cp([0-9]+)([0-9]+)-cp ]]; then
local version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
# Use sort with version sort flag to compare version against 3.8
if [[ $(echo -e "3.8\n$version" | sort -V | head -n1) == "3.8" ]]; then
return 0 # True, version is >= 3.8
# Use sort with version sort flag to compare version against 3.9
if [[ $(echo -e "3.9\n$version" | sort -V | head -n1) == "3.9" ]]; then
return 0 # True, version is >= 3.9
fi
fi
return 1 # False, version is < 3.8
return 1 # False, version is < 3.9
}

# Compile wheels, only for CPython 3.8+
# Compile wheels, only for CPython 3.9+
for PYDIR in /opt/python/*; do
if is_python_version_ge_38 "$PYDIR"; then
if is_python_version_ge_39 "$PYDIR"; then
PYBIN="$PYDIR/bin"
"${PYBIN}/pip" install -r /io/requirements.txt
"${PYBIN}/pip" wheel /io/ --no-deps -w wheelhouse/
Expand All @@ -33,9 +33,9 @@ for wheel in wheelhouse/*.whl; do
fi
done

# Install packages and test, only for CPython 3.8+
# Install packages and test, only for CPython 3.9+
for PYDIR in /opt/python/*; do
if is_python_version_ge_38 "$PYDIR"; then
if is_python_version_ge_39 "$PYDIR"; then
PYBIN="$PYDIR/bin"
"${PYBIN}/pip" install plotpy --no-index -f /io/wheelhouse
(cd "$HOME"; INSTDIR=$("${PYBIN}/python" -c "import plotpy, os.path as osp; print(osp.dirname(plotpy.__file__))"); export QT_QPA_PLATFORM=offscreen; "${PYBIN}/pytest" "$INSTDIR")
Expand Down

0 comments on commit 5beaf68

Please sign in to comment.