summaryrefslogtreecommitdiffstats
path: root/Modules/Setup
Commit message (Collapse)AuthorAgeFilesLines
* gh-104773: PEP 594: Remove the audioop module (#104937)Victor Stinner2023-05-251-1/+0
|
* gh-104773: PEP 594: Remove the crypt module (#104908)Victor Stinner2023-05-251-4/+0
| | | | Remove the crypt module and its private _crypt extension, deprecated in Python 3.11.
* gh-104773: PEP 594: Remove the nis module (#104897)Victor Stinner2023-05-241-1/+0
|
* gh-104773: PEP 594: Remove the spwd module (#104871)Victor Stinner2023-05-241-1/+0
| | | Remove spwd from the configure script and Modules/Setup.
* gh-99108: Refresh HACL* (#104808)Jonathan Protzenko2023-05-241-1/+1
| | | Refresh HACL* from upstream to improve SHA2 performance and fix a 32-bit issue in SHA3.
* gh-104773: PEP 594: Remove the ossaudiodev module (#104862)Victor Stinner2023-05-241-2/+1
| | | | | * Remove ossaudiodev extension in configure.ac and regenerate the configure script. * Remove ossaudiodev in Modules/Setup and Modules/Setup.stdlib.in.
* gh-99108: fix typo in Modules/Setup (#104293)Jonathan Protzenko2023-05-081-1/+1
| | | case sensitive filename
* gh-99108: Replace SHA3 implementation HACL* version (#103597)Jonathan Protzenko2023-05-081-1/+1
| | | | | | | | | | | Replaces our built-in SHA3 implementation with a verified one from the HACL* project. This implementation is used when OpenSSL does not provide SHA3 or is not present. 3.11 shiped with a very slow tiny sha3 implementation to get off of the <=3.10 reference implementation that wound up having serious bugs. This brings us back to a reasonably performing built-in implementation consistent with what we've just replaced our other guaranteed available standard hash algorithms with: code from the HACL* project. --------- Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-99108: Add missing md5/sha1 defines to Modules/Setup (#102308)Anthony Sottile2023-02-281-2/+2
|
* gh-99108: Followup fix for Modules/Setup (GH-102183)Jonathan Protzenko2023-02-231-2/+2
| | | Automerge-Triggered-By: GH:erlend-aasland
* gh-99108: Import MD5 and SHA1 from HACL* (#102089)Jonathan Protzenko2023-02-221-2/+2
| | | Replaces our fallback non-OpenSSL MD5 and SHA1 implementations with those from HACL* as we've already done with SHA2.
* gh-99108: Refactor _sha256 & _sha512 into _sha2. (#101924)Gregory P. Smith2023-02-161-2/+1
| | | | | | | | | This merges their code. They're backed by the same single HACL* static library, having them be a single module simplifies maintenance. This should unbreak the wasm enscripten builds that currently fail due to linking in --whole-archive mode and the HACL* library appearing twice. Long unnoticed error fixed: _sha512.SHA384Type was doubly assigned and was actually SHA512Type. Nobody depends on those internal names. Also rename LIBHACL_ make vars to LIBHACL_SHA2_ in preperation for other future HACL things.
* gh-101524: Split Up the _xxsubinterpreters Module (gh-101526)Eric Snow2023-02-041-0/+1
| | | | | This is step 1 in potentially dropping all the "channel"-related code. Channels have already been removed from PEP 554. https://github.com/python/cpython/issues/101524
* gh-98627: Add the _testsinglephase Module (gh-99039)Eric Snow2022-11-081-0/+1
| | | | | This makes it more clear that a given test is definitely testing against a single-phase init (legacy) extension module. The new module is a companion to _testmultiphase. https://github.com/python/cpython/issues/98627
* gh-93939: Build C extensions without setup.py (GH-94474)Christian Heimes2022-07-141-1/+1
| | | Combines GH-93940, GH-94452, and GH-94433
* bpo-45847: Port _scproxy to PY_STDLIB_MOD (GH-29644)Christian Heimes2021-11-201-2/+2
|
* bpo-45573: Move mandatory core modules to Modules/Setup.bootstrap (GH-29616)Christian Heimes2021-11-191-25/+2
|
* bpo-45774: Autoconfiscate SQLite detection (GH-29507)Erlend Egeberg Aasland2021-11-191-1/+0
| | | Co-authored-by: Christian Heimes <christian@python.org>
* bpo-45573: Introduce extension module flags in Makefile (GH-29594)Christian Heimes2021-11-181-3/+12
| | | | | | | | | | | | | | | | | | ``configure`` now uses a standardized format to forward state, compiler flags, and linker flags to ``Makefile``, ``setup.py``, and ``Modules/Setup``. ``makesetup`` use the new variables by default if a module line does not contain any compiler or linker flags. ``setup.py`` has a new function ``addext()``. For a module ``egg``, configure adds: * ``MODULE_EGG`` with value yes, missing, disabled, or n/a * ``MODULE_EGG_CFLAGS`` * ``MODULE_EGG_LDFLAGS`` ``Makefile.pre.in`` may also provide ``MODULE_EGG_DEPS`` that lists dependencies such as header files and static libs. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-45800: Move pyexpat build setup into configure (GH-29547)Christian Heimes2021-11-141-2/+2
| | | | | | Settings for :mod:`pyexpat` C extension are now detected by ``configure``. The bundled ``expat`` library is built in ``Makefile``. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-45798: Move _decimal build setup into configure (GH-29541)Christian Heimes2021-11-131-2/+1
| | | | | | | Settings for :mod:`decimal` internal C extension are now detected by :program:`configure`. The bundled `libmpdec` library is built in ``Makefile``. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-45747: Detect gdbm/dbm dependencies in configure (GH-29467)Christian Heimes2021-11-101-1/+1
| | | Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-45548: Some test modules must be built as shared libs (GH-29268)Christian Heimes2021-10-291-4/+6
| | | | | | | | | | | | | Some test cases don't work when test modules are static extensions. Add dependency on Modules/config.c to trigger a rebuild whenever a module build type is changed. ``makesetup`` puts shared extensions into ``Modules/`` directory. Create symlinks from pybuilddir so the extensions can be imported. Note: It is not possible to use the content of pybuilddir.txt as a build target. Makefile evaluates target variables in the first pass. The pybuilddir.txt file does not exist at that point.
* bpo-45548: Fix out-of-tree and Debian builds (GH-29263)Christian Heimes2021-10-281-55/+52
| | | | | | | | | | | | | | | Add Modules subdirs to SRCDIRS to generate directories for out-of-tree object files. Debian wants ncurses lib. Works on Fedora, too. Debian also needs pkg-config to detect correct flags. Remove more outdated comments. Makefile now tracks header dependencies -lintl is injected by configure when needed. Build _dbm with gdbm-compat. Group some modules by purpose. socket, select, and mmap work on Windows, too.
* bpo-45548: Add missing extensions to Modules/Setup (GH-29199)Christian Heimes2021-10-251-33/+33
| | | | | | | | | | Adds _ctypes, _decimal, _multiprocessing, _posixshmem, _scproxy, _sqlite3, and _uuid. Use Makefile variables to build OpenSSL and TCL/TK modules. Drop ``-lm`` from math lines. Extensions are always linked against libm. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-45548: Remove _math.c workarounds for pre-C99 libm (GH-29179)Christian Heimes2021-10-251-2/+2
| | | | | | | | | | | | | The :mod:`math` and :mod:`cmath` implementation now require a C99 compatible ``libm`` and no longer ship with workarounds for missing acosh, asinh, expm1, and log1p functions. The changeset also removes ``_math.c`` and moves the last remaining workaround into ``_math.h``. This simplifies static builds with ``Modules/Setup`` and resolves symbol conflicts. Co-authored-by: Mark Dickinson <mdickinson@enthought.com> Co-authored-by: Brett Cannon <brett@python.org> Signed-off-by: Christian Heimes <christian@python.org>
* bpo-45570: Simplify setup macros for pyexpat (GH-29159)Christian Heimes2021-10-221-2/+2
| | | | | | | | * ``HAVE_EXPAT_CONFIG_H`` is not used by our code and not used by system-wide expat header files * ``USE_PYEXPAT_CAPI`` is no longer used by our code * ``XML_POOR_ENTROPY`` should be defined in expat_config.h Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43974: Move Py_BUILD_CORE_MODULE into module code (GH-29157)Christian Heimes2021-10-221-31/+31
| | | | | | | | | | | | | | setup.py no longer defines Py_BUILD_CORE_MODULE. Instead every module defines the macro before #include "Python.h" unless Py_BUILD_CORE_BUILTIN is already defined. Py_BUILD_CORE_BUILTIN is defined for every module that is built by Modules/Setup. The PR also simplifies Modules/Setup. Makefile and makesetup already define Py_BUILD_CORE_BUILTIN and include Modules/internal for us. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-45548: Make `Modules/Setup` easier to read (GH-29143)Brett Cannon2021-10-221-196/+115
|
* bpo-45548: add some missing entries to `Modules/Setup` (GH-29115)Brett Cannon2021-10-211-2/+20
| | | Also remove a duplicate entry for `_weakref`.
* bpo-45434: Remove pystrhex.h header file (GH-28923)Victor Stinner2021-10-131-9/+13
| | | | | | | | | | | | | | | Move Include/pystrhex.h to Include/internal/pycore_strhex.h. The header file only contains private functions. The following C extensions are now built with Py_BUILD_CORE_MODULE macro defined to get access to the internal C API: * _blake2 * _hashopenssl * _md5 * _sha1 * _sha3 * _ssl * binascii
* bpo-44353: Implement typing.NewType __call__ method in C (#27262)Yurii Karabas2021-07-221-0/+1
| | | | Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Denis Laxalde <denis@laxalde.org>
* bpo-40137: Add pycore_moduleobject.h internal header (GH-25507)Victor Stinner2021-04-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add pycore_moduleobject.h internal header file with static inline functions to access module members: * _PyModule_GetDict() * _PyModule_GetDef() * _PyModule_GetState() These functions don't check at runtime if their argument has a valid type and can be inlined even if Python is not built with LTO. _PyType_GetModuleByDef() uses _PyModule_GetDef(). Replace PyModule_GetState() with _PyModule_GetState() in the extension modules, considered as performance sensitive: * _abc * _functools * _operator * _pickle * _queue * _random * _sre * _struct * _thread * _winapi * array * posix The following extensions are now built with the Py_BUILD_CORE_MODULE macro defined, to be able to use the internal pycore_moduleobject.h header: _abc, array, _operator, _queue, _sre, _struct.
* bpo-43669: PEP 644: Require OpenSSL 1.1.1 or newer (GH-23014)Christian Heimes2021-04-171-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | - Remove HAVE_X509_VERIFY_PARAM_SET1_HOST check - Update hashopenssl to require OpenSSL 1.1.1 - multissltests only OpenSSL > 1.1.0 - ALPN is always supported - SNI is always supported - Remove deprecated NPN code. Python wrappers are no-op. - ECDH is always supported - Remove OPENSSL_VERSION_1_1 macro - Remove locking callbacks - Drop PY_OPENSSL_1_1_API macro - Drop HAVE_SSL_CTX_CLEAR_OPTIONS macro - SSL_CTRL_GET_MAX_PROTO_VERSION is always defined now - security level is always available now - get_num_tickets is available with TLS 1.3 - X509_V_ERR MISMATCH is always available now - Always set SSL_MODE_RELEASE_BUFFERS - X509_V_FLAG_TRUSTED_FIRST is always available - get_ciphers is always supported - SSL_CTX_set_keylog_callback is always available - Update Modules/Setup with static link example - Mention PEP in whatsnew - Drop 1.0.2 and 1.1.0 from GHA tests
* bpo-42161: Modules/ uses _PyLong_GetZero() and _PyLong_GetOne() (GH-22998)Victor Stinner2020-10-271-2/+2
| | | | | | Use _PyLong_GetZero() and _PyLong_GetOne() in Modules/ directory. _cursesmodule.c and zoneinfo.c are now built with Py_BUILD_CORE_MODULE macro defined.
* bpo-1635741: _PyUnicode_Name_CAPI moves to internal C API (GH-22713)Victor Stinner2020-10-261-1/+1
| | | | | | | | | | The private _PyUnicode_Name_CAPI structure of the PyCapsule API unicodedata.ucnhash_CAPI moves to the internal C API. Moreover, the structure gets a new state member which must be passed to the getcode() and getname() functions. * Move Include/ucnhash.h to Include/internal/pycore_ucnhash.h * unicodedata module is now built with Py_BUILD_CORE_MODULE. * unicodedata: move hashAPI variable into unicodedata_module_state.
* bpo-40422: Move _Py_closerange to fileutils.c (GH-22680)Kyle Evans2020-10-131-1/+1
| | | | | | | This API is relatively lightweight and organizationally, given that it's used by multiple modules, it makes sense to move it to fileutils. Requires making sure that _posixsubprocess is compiled with the appropriate Py_BUIILD_CORE_BUILTIN macro.
* bpo-41078: Add pycore_list.h internal header file (GH-21057)Victor Stinner2020-06-221-1/+1
| | | | | * Move _PyList_ITEMS() to pycore_list.h. * The C extension "_heapq" is now built with Py_BUILD_CORE_MODULE macro defined to access the internal C API.
* bpo-40939: Remove the old parser (GH-20768)Pablo Galindo2020-06-111-7/+0
| | | This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
* bpo-40503: PEP 615: Tests and implementation for zoneinfo (GH-19909)Paul Ganssle2020-05-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the initial implementation of PEP 615, the zoneinfo module, ported from the standalone reference implementation (see https://www.python.org/dev/peps/pep-0615/#reference-implementation for a link, which has a more detailed commit history). This includes (hopefully) all functional elements described in the PEP, but documentation is found in a separate PR. This includes: 1. A pure python implementation of the ZoneInfo class 2. A C accelerated implementation of the ZoneInfo class 3. Tests with 100% branch coverage for the Python code (though C code coverage is less than 100%). 4. A compile-time configuration option on Linux (though not on Windows) Differences from the reference implementation: - The module is arranged slightly differently: the accelerated module is `_zoneinfo` rather than `zoneinfo._czoneinfo`, which also necessitates some changes in the test support function. (Suggested by Victor Stinner and Steve Dower.) - The tests are arranged slightly differently and do not include the property tests. The tests live at test/test_zoneinfo/test_zoneinfo.py rather than test/test_zoneinfo.py or test/test_zoneinfo/__init__.py because we may do some refactoring in the future that would likely require this separation anyway; we may: - include the property tests - automatically run all the tests against both pure Python and C, rather than manually constructing C and Python test classes (similar to the way this works with test_datetime.py, which generates C and Python test cases from datetimetester.py). - This includes a compile-time configuration option on Linux (though not on Windows); added with much help from Thomas Wouters. - Integration into the CPython build system is obviously different from building a standalone zoneinfo module wheel. - This includes configuration to install the tzdata package as part of CI, though only on the coverage jobs. Introducing a PyPI dependency as part of the CI build was controversial, and this is seen as less of a major change, since the coverage jobs already depend on pip and PyPI. Additional changes that were introduced as part of this PR, most / all of which were backported to the reference implementation: - Fixed reference and memory leaks With much debugging help from Pablo Galindo - Added smoke tests ensuring that the C and Python modules are built The import machinery can be somewhat fragile, and the "seamlessly falls back to pure Python" nature of this module makes it so that a problem building the C extension or a failure to import the pure Python version might easily go unnoticed. - Adjustments to zoneinfo.__dir__ Suggested by Petr Viktorin. - Slight refactorings as suggested by Steve Dower. - Removed unnecessary if check on std_abbr Discovered this because of a missing line in branch coverage.
* bpo-40602: Rename hashtable.h to pycore_hashtable.h (GH-20044)Victor Stinner2020-05-121-1/+1
| | | | | | | * Move Modules/hashtable.h to Include/internal/pycore_hashtable.h * Move Modules/hashtable.c to Python/hashtable.c * Python is now linked to hashtable.c. _tracemalloc is no longer linked to hashtable.c. Previously, marshal.c got hashtable.c via _tracemalloc.c which is built as a builtin module.
* bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)Pablo Galindo2020-04-221-0/+3
| | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-40286: Add randbytes() method to random.Random (GH-19527)Victor Stinner2020-04-171-1/+1
| | | | | | | | | | | | Add random.randbytes() function and random.Random.randbytes() method to generate random bytes. Modify secrets.token_bytes() to use SystemRandom.randbytes() rather than calling directly os.urandom(). Rename also genrand_int32() to genrand_uint32(), since it returns an unsigned 32-bit integer, not a signed integer. The _random module is now built with Py_BUILD_CORE_MODULE defined.
* bpo-40302: Add pycore_byteswap.h header file (GH-19552)Victor Stinner2020-04-171-2/+2
| | | | | | | | | | | | | | Add a new internal pycore_byteswap.h header file with the following functions: * _Py_bswap16() * _Py_bswap32() * _Py_bswap64() Use these functions in _ctypes, sha256 and sha512 modules, and also use in the UTF-32 encoder. sha256, sha512 and _ctypes modules are now built with the internal C API.
* bpo-35081: Move dtoa.h header to the internal C API (GH-18489)Victor Stinner2020-02-121-2/+2
| | | | | | | Move the dtoa.h header file to the internal C API as pycore_dtoa.h: it only contains private functions (prefixed by "_Py"). The math and cmath modules must now be compiled with the Py_BUILD_CORE macro defined.
* bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266)Dong-hee Na2019-08-231-0/+1
|
* closes bpo-35184: Fix XML_POOR_ENTROPY option that breaks makesetup parsing ↵aaronpaulhurst2019-06-111-1/+1
| | | | | | | | of pyexpat line in Setup. (GH-13064) When the line is uncommented, the equals character causes it to be incorrectly interpreted as a macro definition by makesetup. This results in invalid Makefile output. The expat code only requires XML_POOR_ENTROPY to be defined; the value is unnecessary.
* bpo-36635: Add _testinternalcapi module (GH-12841)Victor Stinner2019-04-181-0/+1
| | | | | | Add a new _testinternalcapi module to test the internal C API. Move _Py_GetConfigsAsDict() function to the internal C API: _testembed now uses _testinternalcapi to access the function.
* bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)Victor Stinner2019-04-171-7/+7
| | | | | | | | | | | | | | | | | | | | Change PyAPI_FUNC(type), PyAPI_DATA(type) and PyMODINIT_FUNC macros of pyport.h when Py_BUILD_CORE_MODULE is defined. The Py_BUILD_CORE_MODULE define must be now be used to build a C extension as a dynamic library accessing Python internals: export the PyInit_xxx() function in DLL exports on Windows. Changes: * Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE now imply Py_BUILD_CORE directy in pyport.h. * ceval.c compilation now fails with an error if Py_BUILD_CORE is not defined, just to ensure that Python is build with the correct defines. * setup.py now compiles _pickle.c with Py_BUILD_CORE_MODULE define. * setup.py compiles _json.c with Py_BUILD_CORE_MODULE define, rather than Py_BUILD_CORE_BUILTIN define * PCbuild/pythoncore.vcxproj: Add Py_BUILD_CORE_BUILTIN define.
* bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606)Victor Stinner2018-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | locale.localeconv() now sets temporarily the LC_CTYPE locale to the LC_MONETARY locale if the two locales are different and monetary strings are non-ASCII. This temporary change affects other threads. Changes: * locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode monetary fields. * Add LocaleInfo.grouping_buffer: copy localeconv() grouping string since it can be replaced anytime if a different thread calls localeconv(). * _Py_GetLocaleconvNumeric() now requires a "struct lconv *" structure, so locale.localeconv() now longer calls localeconv() twice. Moreover, the function now requires all arguments to be non-NULL. * Rename STATIC_LOCALE_INFO_INIT to LocaleInfo_STATIC_INIT. * Move _Py_GetLocaleconvNumeric() definition from fileutils.h to pycore_fileutils.h. pycore_fileutils.h now includes locale.h. * The _locale module is now built with Py_BUILD_CORE defined.