Skip to content

Commit

Permalink
chore: dropped Python 3.8 support, added Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Oct 7, 2023
1 parent 466bbdb commit 6fc33ed
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 46 deletions.
25 changes: 7 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]
env:
CIBW_ENVIRONMENT_PASS_LINUX: PYTEST_TIMEOUT
CIBW_TEST_COMMAND: "cd {project} && pip install --prefer-binary '.[test]' && python -m pytest -v tests"
CIBW_SKIP: "cp36-*"
CIBW_SKIP: "cp36-* cp37-*"
PYTEST_TIMEOUT: 60
MACOSX_DEPLOYMENT_TARGET: "10.9"

Expand Down Expand Up @@ -34,9 +34,8 @@ jobs:
CIBW_BEFORE_BUILD: "yum install -y flex bison libxml2-devel zlib-devel cairo-devel && pip install -U cmake pip wheel && python setup.py build_c_core"
CIBW_BUILD: "*-manylinux_${{ matrix.wheel_arch }}"
# Skip tests for Python 3.10 onwards because SciPy does not have
# 32-bit wheels for Linux. Also skip tests for Python 3.12 until
# NumPy 1.26 is out (with Python 3.12 wheels)
CIBW_TEST_SKIP: "cp310-manylinux_i686 cp311-manylinux_i686 cp312-manylinux_i686 cp312-*"
# 32-bit wheels for Linux
CIBW_TEST_SKIP: "cp310-manylinux_i686 cp311-manylinux_i686 cp312-manylinux_i686"

- name: Build wheels (musllinux)
uses: pypa/[email protected]
Expand Down Expand Up @@ -69,9 +68,6 @@ jobs:
CIBW_BEFORE_BUILD: "yum install -y flex bison libxml2-devel zlib-devel cairo-devel && pip install -U cmake pip wheel && python setup.py build_c_core"
CIBW_ARCHS_LINUX: aarch64
CIBW_BUILD: "*-manylinux_aarch64"
# Skip tests for Python 3.12 until NumPy 1.26 is out (with Python
# 3.12 wheels)
CIBW_TEST_SKIP: "cp312-*"

- uses: actions/upload-artifact@v3
with:
Expand All @@ -98,9 +94,6 @@ jobs:
CIBW_ARCHS_LINUX: aarch64
CIBW_BUILD: "*-musllinux_aarch64"
CIBW_TEST_COMMAND: "cd {project} && pip install --prefer-binary '.[test-musl]' && python -m pytest -v tests"
# Skip tests for Python 3.12 until NumPy 1.26 is out (with Python
# 3.12 wheels)
CIBW_TEST_SKIP: "cp312-*"

- uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -168,9 +161,6 @@ jobs:
CIBW_BEFORE_BUILD: "python setup.py build_c_core"
CIBW_ENVIRONMENT: "LDFLAGS=-L$HOME/local/lib"
IGRAPH_CMAKE_EXTRA_ARGS: -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake_arch }} ${{ matrix.cmake_extra_args }} -DCMAKE_PREFIX_PATH=$HOME/local
# Skip tests for Python 3.12 until NumPy 1.26 is out (with Python
# 3.12 wheels)
CIBW_TEST_SKIP: "cp312-*"

- uses: actions/upload-artifact@v3
with:
Expand All @@ -189,7 +179,7 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.11.2'
python-version: '3.12.0'

- uses: mymindstorm/setup-emsdk@v12
with:
Expand Down Expand Up @@ -259,9 +249,8 @@ jobs:
CIBW_BUILD: "*-${{ matrix.wheel_arch }}"
CIBW_TEST_COMMAND: "cd /d {project} && pip install --prefer-binary \".[test]\" && python -m pytest tests"
# Skip tests for Python 3.10 onwards because SciPy does not have
# 32-bit wheels for Windows. Also skip tests for Python 3.12 until
# NumPy 1.26 is out (with Python 3.12 wheels)
CIBW_TEST_SKIP: "cp310-win32 cp311-win32 cp312-win32 cp312-*"
# 32-bit wheels for Windows
CIBW_TEST_SKIP: "cp310-win32 cp311-win32 cp312-win32"
IGRAPH_CMAKE_EXTRA_ARGS: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_arch }}-windows-static-md -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -A ${{ matrix.cmake_arch }}
IGRAPH_EXTRA_LIBRARY_PATH: C:/vcpkg/installed/${{ matrix.vcpkg_arch }}-windows-static-md/lib/
IGRAPH_STATIC_EXTENSION: True
Expand Down Expand Up @@ -344,7 +333,7 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.11'
python-version: '3.12'

- name: Build C core
env:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Added

- `python-igraph` is now tested in Python 3.12.

- Added `weights=...` keyword argument to `Graph.layout_kamada_kawai()`.

### Changed
Expand All @@ -14,6 +16,10 @@
- As another consequence of the above, self loops are now looking better and their size can be controlled using the `edge_loop_size` argument in `igraph.plot`.
- As another consequence of the above, if using the `matplotlib` backend when plotting a graph, `igraph.plot` now does not return the `Axes` anymore. Instead, it returns a container artist called `GraphArtist`, which contains as children the elements of the graph plot: a `VertexCollection` for the vertices, and `EdgeCollection` for the edges, and so on. These objects can be used to modify the plot after the initial rendering, e.g. inside a Jupyter notebook, to fine tune the appearance of the plot. While documentation on specific graphic elements is still scant, more descriptive examples will follow in the future.

### Removed

- Dropped support for Python 3.7 as it has reached its end of life.

## [0.10.8] - 2023-09-12

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ faster than the first one as the C core does not need to be recompiled.

We aim to keep up with the development cycle of Python and support all official
Python versions that have not reached their end of life yet. Currently this
means that we support Python 3.7 to 3.11, inclusive. Please refer to [this
means that we support Python 3.8 to 3.12, inclusive. Please refer to [this
page](https://devguide.python.org/versions/) for the status of Python
branches and let us know if you encounter problems with `igraph` on any
of the non-EOL Python versions.
Expand Down
17 changes: 7 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
###########################################################################

# Check Python's version info and exit early if it is too old
if sys.version_info < (3, 7):
print("This module requires Python >= 3.7")
if sys.version_info < (3, 8):
print("This module requires Python >= 3.8")
sys.exit(0)

###########################################################################
Expand Down Expand Up @@ -913,9 +913,8 @@ def get_tag(self):
bdist_wheel_abi3 = None

# We are going to build an abi3 wheel if we are at least on CPython 3.9.
# This is because the C code contains conditionals for CPython 3.7 and
# 3.8 so we cannot use an abi3 wheel built with CPython 3.7 or 3.8 on
# CPython 3.9
# This is because the C code contains conditionals for CPython 3.8 so we cannot
# use an abi3 wheel built with CPython 3.8 on CPython 3.9
should_build_abi3_wheel = (
bdist_wheel_abi3
and platform.python_implementation() == "CPython"
Expand Down Expand Up @@ -1016,9 +1015,7 @@ def get_tag(self):
"numpy>=1.19.0; platform_python_implementation != 'PyPy'",
"pandas>=1.1.0; platform_python_implementation != 'PyPy'",
"scipy>=1.5.0; platform_python_implementation != 'PyPy'",
# Matplotlib 3.6.0 does not support Python 3.7 any more, but we need
# it because Python 3.11 support came in Matplotlib 3.6.0 first
"matplotlib>=3.6.0; platform_python_implementation != 'PyPy' and python_version >= '3.8'",
"matplotlib>=3.6.0; platform_python_implementation != 'PyPy'",
"plotly>=5.3.0",
"Pillow>=9; platform_python_implementation != 'PyPy'",
],
Expand All @@ -1039,7 +1036,7 @@ def get_tag(self):
"pydoctor>=23.4.0",
],
},
"python_requires": ">=3.7",
"python_requires": ">=3.8",
"headers": headers,
"platforms": "ALL",
"keywords": [
Expand All @@ -1057,11 +1054,11 @@ def get_tag(self):
"Operating System :: OS Independent",
"Programming Language :: C",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"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 :: Only",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
Expand Down
20 changes: 5 additions & 15 deletions src/_igraph/pyhelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,11 @@ char* PyUnicode_CopyAsString(PyObject* string);

/* Calling Py_DECREF() on heap-allocated types in tp_dealloc was not needed
* before Python 3.8 (see Python issue 35810) */
#if PY_VERSION_HEX >= 0x03080000
#define PY_FREE_AND_DECREF_TYPE(obj, base_type) { \
PyTypeObject* _tp = Py_TYPE(obj); \
((freefunc)PyType_GetSlot(_tp, Py_tp_free))(obj); \
Py_DECREF(_tp); \
}
#else
#define PY_FREE_AND_DECREF_TYPE(obj, base_type) { \
PyTypeObject* _tp = Py_TYPE(obj); \
((freefunc)PyType_GetSlot(_tp, Py_tp_free))(obj); \
if (_tp == base_type) { \
Py_DECREF(_tp); \
} \
}
#endif
#define PY_FREE_AND_DECREF_TYPE(obj, base_type) { \
PyTypeObject* _tp = Py_TYPE(obj); \
((freefunc)PyType_GetSlot(_tp, Py_tp_free))(obj); \
Py_DECREF(_tp); \
}

#define CHECK_SSIZE_T_RANGE(value, message) { \
if ((value) < 0) { \
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
# and then run "tox" from this directory.

[tox]
envlist = py37, py38, py39, py310, pypy3
envlist = py38, py39, py310, py311, py312, pypy3

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
pypy-3.7: pypy3

[testenv]
Expand Down

0 comments on commit 6fc33ed

Please sign in to comment.