From ff11e9259014debd4ba4beddee511dc3c79b36fb Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Mon, 25 Sep 2023 11:07:36 -0700 Subject: [PATCH] release 1.16.0rc1 * change most Heptapod links/refs to GH equivalents * remove Mercurial support files * remove (some) obsolete docs --- .hgignore | 13 ---------- .hgtags | 37 --------------------------- README.md | 21 +++++---------- c/_cffi_backend.c | 2 +- c/test_c.py | 2 +- cffi/__init__.py | 4 +-- cffi/_embedding.h | 2 +- doc/source/conf.py | 4 +-- doc/source/goals.rst | 2 +- doc/source/installation.rst | 51 +++++++------------------------------ doc/source/overview.rst | 4 +-- doc/source/using.rst | 2 +- doc/source/whatsnew.rst | 12 +++++++++ requirements.txt | 2 -- setup.cfg | 6 ++--- setup.py | 2 +- 16 files changed, 42 insertions(+), 124 deletions(-) delete mode 100644 .hgignore delete mode 100644 .hgtags delete mode 100644 requirements.txt diff --git a/.hgignore b/.hgignore deleted file mode 100644 index 6c8efcf8..00000000 --- a/.hgignore +++ /dev/null @@ -1,13 +0,0 @@ -syntax: glob -*.py[co] -*~ -.*.swp -testing/__pycache__ -demo/__pycache__ -__pycache__ -_cffi_backend*.so -_cffi_backend.pyd -doc/build -build -dist -*.egg-info diff --git a/.hgtags b/.hgtags deleted file mode 100644 index a5989130..00000000 --- a/.hgtags +++ /dev/null @@ -1,37 +0,0 @@ -3691a2e644c98fc8753ffb96c4ff2d5d3e57bd17 release-0.4.2 -0000000000000000000000000000000000000000 release-0.4.2 -037096d1bdaa213c2adebf3a4124ad56dba8ba82 release-0.4.1 -0000000000000000000000000000000000000000 release-0.4.1 -bd4b6090aea035a6093e684858aa7bd54a6270ec release-0.4 -0000000000000000000000000000000000000000 release-0.4 -5f31908df6c97a1f70f3fcd4d489d98dc2b30f04 release-0.3 -0000000000000000000000000000000000000000 release-0.3 -6a0f0a476101210a76f4bc4d33c5bbb0f8f979fd release-0.2.1 -0000000000000000000000000000000000000000 release-0.2.1 -a8636625e33b0f84c3744f80d49e84b175a0a215 release-0.2 -0000000000000000000000000000000000000000 release-0.2 -ca6e81df7f1ea58d891129ad016a8888c08f238b release-0.1 -0000000000000000000000000000000000000000 release-0.1 -ada126bd7d1e96cc76303c1fca64a556912549d8 v1.11.1 -5f9690f5832b0292056df45f72314d69c191f75a v1.11.2 -1aafccb9255dbb36f8e785b65624e39628cee63a v1.11.3 -e08abd4703fef26f036e82255f4070277a9e03bd v1.11.4 -48416163071ed48300c3ae4358cc7fd841912413 v1.11.5 -170fb3d1f0b30d32c9794ea40dbb51836dc7d947 v1.12.0 -ac7cb142e8f5dc73033d89c54c54e1b1a6413946 v1.12.1 -e0c76668ecf5ab1ad005799cfe1b7cb58610f155 v1.12.2 -bf80722dea36237710083315e336c81bc8571fd0 v1.12.3 -17c06e75f54cf5a31865961f0b498f99232a0bc8 v1.13.0 -9cc790d05bc5256eee32fddbe60aadf24f14ce44 v1.13.1 -0c9be4c0d79867d108c60ac3c66e2fb3e89aaae9 v1.13.2 -694e7139131f2582e0c872b8ecbc50e8e5451dbf v1.14.0 -4610fa3bd4397721b69acf558b98fbff4c2b4531 v1.14.1 -e927dba37deee51b087d1345868c353779a0ebe2 v1.14.2 -56a682f7336ddc51b99a04149249a47e928fd129 v1.14.3 -ede015a0e6203ba3057f3842063786683caccff6 v1.14.4 -870af0b7cdf9dfae2d582158b4bfcda96987c42e v1.14.4-1 -5d7f0abff7958b650a51e652d0cf19823eb92ff0 v1.14.5 -7a912c19190f62225217daf9e77b57f3eb225373 v1.14.6 -cc972f56c9a65ae9c54aefba2df2a3d523f8b074 v1.15.0rc1 -d2ac4b46674e44d1534a7f5df770a86b4136b007 v1.15.0 -c649a735cf829040d859c3c2ca52d7f5afb5a139 v1.15.1 diff --git a/README.md b/README.md index 21c82b84..6fc11242 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,13 @@ in the doc/ subdirectory. Download -------- -[Download page](https://foss.heptapod.net/pypy/cffi/-/tags) +[Download page](https://github.com/python-cffi/cffi/releases) Source Code ----------- -CFFI is developed using [Mercurial SCM](mercurial-scm.org/). -The source code is publicly available on -[heaptapod](https://foss.heptapod.net/pypy/cffi). - -You can read more about how to contribute to the project on -[PyPy's documentation](https://doc.pypy.org/en/latest/contributing.html). +Source code is publicly available on +[GitHub](https://github.com/python-cffi/cffi). Contact ------- @@ -28,13 +24,8 @@ Contact Testing/development tips ------------------------ -To run tests under CPython, run:: +To run tests under CPython, run the following in the source root directory:: - pip install pytest # if you don't have pytest already - pip install pycparser - python setup.py build_ext -f -i + pip install pytest + pip install -e . # editable install of CFFI for local development pytest c/ testing/ - -If you run in another directory (either the tests or another program), -you should use the environment variable ``PYTHONPATH=/path`` to point -to the location that contains the ``_cffi_backend.so`` just compiled. diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c index 7295aa17..f2044638 100644 --- a/c/_cffi_backend.c +++ b/c/_cffi_backend.c @@ -2,7 +2,7 @@ #include #include "structmember.h" -#define CFFI_VERSION "1.15.1" +#define CFFI_VERSION "1.16.0rc1" #ifdef MS_WIN32 #include diff --git a/c/test_c.py b/c/test_c.py index e846d2f0..59681742 100644 --- a/c/test_c.py +++ b/c/test_c.py @@ -26,7 +26,7 @@ def _testfunc(num): # ____________________________________________________________ import sys -assert __version__ == "1.15.1", ("This test_c.py file is for testing a version" +assert __version__ == "1.16.0rc1", ("This test_c.py file is for testing a version" " of cffi that differs from the one that we" " get from 'import _cffi_backend'") if sys.version_info < (3,): diff --git a/cffi/__init__.py b/cffi/__init__.py index 90e2e655..bcbaa1d3 100644 --- a/cffi/__init__.py +++ b/cffi/__init__.py @@ -5,8 +5,8 @@ from .error import CDefError, FFIError, VerificationError, VerificationMissing from .error import PkgConfigError -__version__ = "1.15.1" -__version_info__ = (1, 15, 1) +__version__ = "1.16.0rc1" +__version_info__ = (1, 16, 0, 'rc1') # The verifier module file names are based on the CRC32 of a string that # contains the following version number. It may be older than __version__ diff --git a/cffi/_embedding.h b/cffi/_embedding.h index c5eaf889..8af266e4 100644 --- a/cffi/_embedding.h +++ b/cffi/_embedding.h @@ -225,7 +225,7 @@ static int _cffi_initialize_python(void) if (f != NULL && f != Py_None) { PyFile_WriteString("\nFrom: " _CFFI_MODULE_NAME - "\ncompiled with cffi version: 1.15.1" + "\ncompiled with cffi version: 1.16.0rc1" "\n_cffi_backend module: ", f); modules = PyImport_GetModuleDict(); mod = PyDict_GetItemString(modules, "_cffi_backend"); diff --git a/doc/source/conf.py b/doc/source/conf.py index fb6421e2..dc343e3a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -45,9 +45,9 @@ # built documents. # # The short X.Y version. -version = '1.15' +version = '1.16' # The full version, including alpha/beta/rc tags. -release = '1.15.1' +release = '1.16.0rc1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/goals.rst b/doc/source/goals.rst index df4877c8..df703f14 100644 --- a/doc/source/goals.rst +++ b/doc/source/goals.rst @@ -65,5 +65,5 @@ everything you need to access C code and nothing more. --- the authors, Armin Rigo and Maciej Fijalkowski -.. _`issue tracker`: https://foss.heptapod.net/pypy/cffi/issues +.. _`issue tracker`: https://github.com/python-cffi/cffi/issues .. _`mailing list`: https://groups.google.com/forum/#!forum/python-cffi diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 42d44d96..f1c53eb6 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -17,9 +17,7 @@ platform as well as on Windows 32 and 64. (It relies occasionally on libffi, so it depends on libffi being bug-free; this may not be fully the case on some of the more exotic platforms.) -CFFI supports CPython 2.7, 3.x (tested with 3.6 to 3.9); and is -distributed with PyPy (CFFI 1.0 is distributed with and requires -PyPy 2.6). +CFFI is tested with CPython 3.8-3.12. The core speed of CFFI is better than ctypes, with import times being either lower if you use the post-1.0 features, or much higher if you @@ -31,7 +29,7 @@ libraries on PyPy. Requirements: -* CPython 2.7 or 3.x, or PyPy (PyPy 2.0 for the earliest +* CPython 3.8+, or PyPy (PyPy 2.0 for the earliest versions of CFFI; or PyPy 2.6 for CFFI 1.0). * in some cases you need to be able to compile C extension modules. @@ -52,26 +50,14 @@ Download and Installation: * https://pypi.python.org/pypi/cffi -* Checksums of the "source" package version 1.15.1: - - - MD5: f493860a6e98cd0c4178149568a6b4f6 - - - SHA1: c42a46cd11f6153f299cf10e9c236e8b2a143c21 - - - SHA256: d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 - -* Or grab the most current version from the `Heptapod page`_: - ``hg clone https://foss.heptapod.net/pypy/cffi`` - -* ``python setup.py install`` or ``python setup_base.py install`` - (should work out of the box on Linux or Windows; see below for - `MacOS X`_.) +* Or grab the most current version from `GitHub`_: + ``git clone https://github.com/python-cffi/cffi`` * running the tests: ``pytest c/ testing/`` (if you didn't install cffi yet, you need first ``python setup_base.py build_ext -f -i``) -.. _`Heptapod page`: https://foss.heptapod.net/pypy/cffi +.. _`GitHub project home`: https://github.com/python-cffi/cffi Demos: @@ -82,9 +68,9 @@ Demos: ultimate reference is given by the tests, notably `testing/cffi1/test_verify1.py`_ and `testing/cffi0/backend_tests.py`_. -.. _`demo`: https://foss.heptapod.net/pypy/cffi/-/tree/branch/default/demo -.. _`testing/cffi1/test_verify1.py`: https://foss.heptapod.net/pypy/cffi/-/blob/branch/default/testing/cffi1/test_verify1.py -.. _`testing/cffi0/backend_tests.py`: https://foss.heptapod.net/pypy/cffi/-/blob/branch/default/testing/cffi0/backend_tests.py +.. _`demo`: https://github.com/python-cffi/cffi/blob/main/demo +.. _`testing/cffi1/test_verify1.py`: https://github.com/python-cffi/cffi/blob/main/testing/cffi1/test_verify1.py +.. _`testing/cffi0/backend_tests.py`: https://github.com/python-cffi/cffi/blob/main/testing/cffi0/backend_tests.py Platform-specific instructions @@ -148,28 +134,9 @@ problem applies whenever you want to run compile() to build a dll with this specific compiler suite download. ``import setuptools`` might help, but YMMV -For Python 3.4 and beyond: -https://www.visualstudio.com/en-us/downloads/visual-studio-2015-ctp-vs - - -Linux and OS/X: UCS2 versus UCS4 -++++++++++++++++++++++++++++++++ - -This is about getting an ImportError about ``_cffi_backend.so`` with a -message like ``Symbol not found: _PyUnicodeUCS2_AsASCIIString``. This -error occurs in Python 2 as soon as you mix "ucs2" and "ucs4" builds of -Python. It means that you are now running a Python compiled with -"ucs4", but the extension module ``_cffi_backend.so`` was compiled by a -different Python: one that was running "ucs2". (If the opposite problem -occurs, you get an error about ``_PyUnicodeUCS4_AsASCIIString`` -instead.) - -If you are using ``pyenv``, then see -https://github.com/yyuu/pyenv/issues/257. - More generally, the solution that should always work is to download the sources of CFFI (instead of a prebuilt binary) and make sure that you -build it with the same version of Python than the one that will use it. +build it with the same version of Python that will use it. For example, with virtualenv: * ``virtualenv ~/venv`` diff --git a/doc/source/overview.rst b/doc/source/overview.rst index 3de8a3f7..4017c3c5 100644 --- a/doc/source/overview.rst +++ b/doc/source/overview.rst @@ -19,8 +19,8 @@ You can find these and some other complete demos in the demo__ directory of the repository__. .. __: installation.html -.. __: https://foss.heptapod.net/pypy/cffi/-/tree/branch/default/demo -.. __: https://foss.heptapod.net/pypy/cffi +.. __: https://github.com/python-cffi/cffi/blob/main/demo +.. __: https://github.com/python-cffi/cffi .. _out-of-line-api-level: .. _real-example: diff --git a/doc/source/using.rst b/doc/source/using.rst index ccaa4dbe..b73ae965 100644 --- a/doc/source/using.rst +++ b/doc/source/using.rst @@ -799,7 +799,7 @@ The ``extern "Python"`` functions cannot be variadic for now. This may be implemented in the future. (`This demo`__ shows how to do it anyway, but it is a bit lengthy.) -.. __: https://foss.heptapod.net/pypy/cffi/-/blob/branch/default/demo/extern_python_varargs.py +.. __: https://github.com/python-cffi/cffi/blob/main/demo/extern_python_varargs.py Each corresponding Python callback function is defined with the ``@ffi.def_extern()`` decorator. Be careful when writing this diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst index ff2b7bab..cb180099 100644 --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -2,6 +2,18 @@ What's New ====================== +v1.16.0rc1 +========== + +* Add support for Python 3.12. With the removal of ``distutils`` from Python 3.12, projects + using CFFI features that depend on ``distutils`` at runtime must add a dependency on + ``setuptools`` to function under Python 3.12+. CFFI does not declare a runtime ``setuptools`` + requirement to avoid an unnecessary dependency for projects that do not require it. +* Drop support for end-of-life Python versions (2.7, 3.6, 3.7). +* Add support for PEP517 builds; ``setuptools`` is now a required build dependency. +* Declare ``python_requires`` metadata for Python 3.8+. This allows unsupported Pythons + to continue using previously released sdists and wheels. + v1.15.1 ======= diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a97f0282..00000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pycparser -pytest diff --git a/setup.cfg b/setup.cfg index 0008de80..1b2e9de6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,8 +3,8 @@ license_file = LICENSE license_files = LICENSE project_urls = Documentation = http://cffi.readthedocs.org/ - Source Code = https://foss.heptapod.net/pypy/cffi - Issue Tracker = https://foss.heptapod.net/pypy/cffi/issues + Source Code = https://github.com/python-cffi/cffi + Issue Tracker = https://github.com/python-cffi/cffi/issues Changelog = https://cffi.readthedocs.io/en/latest/whatsnew.html - Downloads = https://foss.heptapod.net/pypy/cffi/-/tags + Downloads = https://github.com/python-cffi/cffi/releases Contact = https://groups.google.com/forum/#!forum/python-cffi diff --git a/setup.py b/setup.py index ff783403..e9391764 100644 --- a/setup.py +++ b/setup.py @@ -195,7 +195,7 @@ def has_ext_modules(self): `Mailing list `_ """, - version='1.15.1', + version='1.16.0rc1', python_requires='>=3.8', packages=['cffi'] if cpython else [], package_data={'cffi': ['_cffi_include.h', 'parse_c_type.h',