Commit Graph

24 Commits

Author SHA1 Message Date
Ralf W. Grosse-Kunstleve
f1a2e03d19
feat: remove Python 3.6 support (#5177)
* Change Python version guard: PYTHON < 3.7 IS UNSUPPORTED.

* Replace or remove Python 3.6 jobs.

* Move appveyor to Python 3.8

* Change `[tool.pylint]` `master.py-version` from `3.6` to `3.8`

* Change `[tool.pylint]` `master.py-version` to `3.7`

* Remove `centos:7` job; Change almalinux:8 job to use Python 3.8

* Try 🐍 3.8 • ubuntu-20.04 • x64 without `-DCMAKE_CXX_FLAGS="-D_=1"`

* Update setup.cfg as suggested by @henryiii

* Try running `cmake --build . --target cpptest` on all platforms (`standard` job).

* Disable deadsnakes jobs entirely.

* Apply PR #5179: Add Python 3.10, 3.11, 3.12 to win32 job matrix.

* Add back `-DCMAKE_CXX_FLAGS="-D_=1"` but do not install boost in that case.

* PY_VERSION_HEX < 3.7 cleanup pass: include/pybind11

* WITH_THREAD cleanup pass: include/pybind11

* Undo incorrect change.

* Revert "Disable deadsnakes jobs entirely."

This reverts commit bbcd0087b2.

* WITH_THREAD cleanup pass: tests/

* Change Python version guard in pybind11/__init__.py: pybind11 does not support Python < 3.7.

* Misc cleanup pass

* chore: use future imports

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update tests/test_numpy_array.py

* Update test_numpy_array.py

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-06-22 00:55:00 -04:00
Ralf W. Grosse-Kunstleve
5552cbf205
Add Python 3.10, 3.11, 3.12 to win32 job matrix. (#5179)
* Add Python 3.10, 3.11, 3.12 to win32 job matrix.

* Quotes around Python version numbers (win32 job).

* tests/requirements.txt: no scipy for Python >= 3.10 under win32

* Try running `cmake --build . --target cpptest` on all platforms (`standard` job).
2024-06-21 07:41:17 -07:00
Victor Stinner
dc477fac0e
fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973)
* fix: Use PyObject_VisitManagedDict() of Python 3.13

Use PyObject_VisitManagedDict() and PyObject_ClearManagedDict() in
pybind11_traverse() and pybind11_clear() on Python 3.13 and newer.

* Add Python 3.13 CI

* tests: don't get numpy/scipy on 3.13 yet

* ci: move 3.13 to upstream

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2023-12-14 18:42:55 -08:00
Henry Schreiner
6831666f5c
ci: add more versions of numpy/scipy/pypy (#4714)
* ci: add more versions of numpy/scipy/pypy

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Apply suggestions from code review

* style: pre-commit fixes

* Update requirements.txt

* Update requirements.txt

* Apply suggestions from code review

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-11-16 00:52:05 -05:00
Pablo Speciale
0cbd92bab8
Update pytest to version 7.2.0 (which removes their dependency on py) (#4880)
* Update pytest (which removes their dependency on py)

The py library through 1.11.0 for Python allows remote attackers to conduct a ReDoS (Regular expression Denial of Service) attack via a Subversion repository with crafted info data, because the InfoSvnCommand argument is mishandled.

The particular codepath in question is the regular expression at py._path.svnurl.InfoSvnCommand.lspattern and is only relevant when dealing with subversion (svn) projects. Notably the codepath is not used in the popular pytest project. The developers of the pytest package have released version 7.2.0 which removes their dependency on py. Users of pytest seeing alerts relating to this advisory may update to version 7.2.0 of pytest to resolve this issue. See https://github.com/pytest-dev/py/issues/287#issuecomment-1290407715 for additional context.

* Added conditions so that we keep using 7.0.0 on python 3.6
2023-10-16 07:42:30 -07:00
dependabot[bot]
d462dd91a5
chore(deps): bump scipy from 1.8.0 to 1.10.0 in /tests (#4731)
Bumps [scipy](https://github.com/scipy/scipy) from 1.8.0 to 1.10.0.
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](https://github.com/scipy/scipy/compare/v1.8.0...v1.10.0)

---
updated-dependencies:
- dependency-name: scipy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2023-07-10 10:43:20 -07:00
Aaron Gokaslan
2af163d9c7
Fix: 3.11 beta support (#3923)
* Placeholder commit for 3.11 testing

* Does this fix it?

* Try suggestion

* Placeholder commit for 3.11 testing

* Does this fix it?

* Try suggestion

* fix: try using modern init for embedded interp

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: error message changed in 3.11

* fix: apply logic in Python manually

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix autodetect dynamic attrs in 3.11

* fix: include error message if possible in error

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* ci: enable standard Python 3.11 testing

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Make dynamic attrs condtiion exclusive to ver.

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-07-06 16:35:12 -04:00
Henry Schreiner
a25d40c7bc
tests: use 'build' in tests instead of running setup.py (#3734)
Co-authored-by: Anderson Bravalheri <andersonbravalheri@gmail.com>

Co-authored-by: Anderson Bravalheri <andersonbravalheri@gmail.com>
2022-02-15 00:32:58 -05:00
Henry Schreiner
522c59ceb2
chore: drop Python 3.5 (#3719)
* chore: drop Python 3.5 support

* chore: more fstrings with flynt's help

* ci: drop Python 3.5

* chore: bump dependency versions

* docs: touch up py::args

* tests: remove deprecation warning

* Ban smartquotes

* Very minor tweaks (by-product of reviewing PR #3719).

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2022-02-11 19:06:16 -05:00
Henry Schreiner
72282f75a1
ci: support development releases of Python (#3419)
* ci: support development releases of Python

* fix: better PyPy support

* fix: patch over a few more pypy issues

* Try to patch

* Properly follow pep667

* Fix typo

* Whoops, 667 not in yet

* For testing

* More testing

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try to backport

* Try to simplify fix

* Nail down the fix

* Try pypy workaround

* Typo

* one last typo

* Replacing 0x03110000 with 0x030B0000

* Add TODO. Drop PyPy

* Fix typo

* Revert catch upgrade

* fix: minor cleanup, try pypy again

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2021-11-17 09:44:19 -05:00
Henry Schreiner
e7e2c79f3f
fix: improve support for Python 3.11-dev (#3368)
* ci: support Python 3.11-dev

Also update 3.10 to final, better PyPy usage

* fix: use PyFrame_GetCode on Python 3.9+

* ci: some bitiness of pypy not supported on win

* chore: update CMake support to 3.22rc1 to quiet warning

* fix: use dev version of py to fix Py 3.11

* tests: print proper Eigen version

* ci: include pypy2, not sure why

* ci: avoid running on Python 3.11 for now

* ci: fix runs

* ci: simpler PyPy usage, drop unmaintained scipy + pypy index

* ci: only binary numpy, wait on pypy 3.8

* refactor: address review
2021-10-26 14:50:34 -04:00
Henry Schreiner
db44afa33b
tests: fix pytest usage on Python 3.10 (#3221) 2021-08-26 10:52:13 -07:00
Henry Schreiner
5e4804bb66
tests: use master commit for pytest on 3.10 (#2967) 2021-04-21 13:30:01 -04:00
Henry Schreiner
721834b422
chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837)
* chore: get PyPy 3.7 wheels using NumPy 1.20

* Add Valgrind suppressions after NumPy update

Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net>
2021-01-31 17:29:09 -05:00
Henry Fredrick Schreiner
dff9b3b432 chore: add pytest-timeout, mypy 2021-01-26 20:59:27 -05:00
Yannick Jadoul
0f8d5f2eb6
Add a Valgrind build on debug Python 3.9 (#2746)
* Adding a valgrind build on debug Python 3.9

Co-authored-by: Boris Staletic <boris.staletic@gmail.com>

* Add Valgrind suppression files

- Introduce suppression file, populate it with a first suppression taken from CPython, and fix one leak in the tests
- Suppress leak in NumPy
- More clean tests!
- Tests with names a-e passing (except for test_buffer)
- Suppress multiprocessing errors
- Merge multiprocessing suppressions into other suppression files
- Numpy seems to be spelled with a big P
- Append single entry from valgrind-misc.supp to valgrind-python.supp, and make clear valgrind-python.supp is only CPython

Co-authored-by: Boris Staletic <boris.staletic@gmail.com>

* Enable test_virtual_functions with a workaround

* Add a memcheck cmake target

- Add a memcheck cmake target
- Reformat cmake
- Appease the formatting overlords - they are angry
- Format CMake valgrind target decently

* Update CI config to new action versions

* fix: separate memcheck from pytest

* ci: cleanup

* Merge Valgrind and other deadsnakes builds

Co-authored-by: Boris Staletic <boris.staletic@gmail.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-01-15 21:07:31 +01:00
Yannick Jadoul
830f8eda87
tests: update pytest 6.2.1 and fix test_python_alreadyset_in_destructor (#2741)
* Update pytest to 6.2.1 in tests/requirements.txt

* Pin pytest to last supported version for 3.5

* Suppress PytestUnraisableExceptionWarning and use sys.__unraisablehook__ instead of sys.unraisablehook

* Fix filterwarnings mark on old pytest and old Python versions

* Cleanup ignore_pytest_unraisable_warning decorator
2020-12-24 09:53:23 -05:00
Henry Schreiner
139c05dafa
ci: test on NumPy + Python 3.9 (#2628) 2020-10-29 09:56:00 -04:00
Henry Schreiner
8ae11fbf88 ci: add more runs 2020-10-15 17:38:49 -04:00
Henry Schreiner
1534e17e44
ci: include Python 3.9 RC1 (#2387) 2020-08-12 14:09:42 -04:00
Henry Schreiner
c51b3f436d ci: change caching 2020-07-27 22:12:19 -04:00
Henry Schreiner
ff39ad3f31 ci: include scipy for tests 2020-07-27 22:12:19 -04:00
Henry Schreiner
aab701399a ci: cache, build wheels on macOS PyPy3 2020-07-26 09:25:27 -04:00
Henry Schreiner
b16347e51d ci: enable GHA testing
Adds requirements file too.
2020-07-23 17:42:53 -04:00