50 Commits

Author SHA1 Message Date
Nicolas Roche
5ac2c57433 Ensure relative path to libpython.a is from project location
Part of eng/toolchain/gnatcoll-bindings#11
2024-10-15 14:18:16 +00:00
Boris Yakobowski
ee2d9c6fb6 Switch dependencies to gnatcoll_core
None of the libraries present here depend on libgpr, so we
can tighten the dependencies from gnatcoll to gnatcoll_core.

For eng/toolchain/gnatcoll-core#25
2024-06-20 10:41:09 +02:00
Olivier Hainque
0993f57d57 Fix python3/python_support.c redef of PyMODINIT_FUNC for Windows
The base PyMODINIT_FUNC (without attributes) is PyObject* in python3,
not void. Adjust the redefinition we do on Windows to remove a declspec
accordingly.
2024-05-29 12:06:45 +02:00
Nicolas Roche
2c128911ec distutils has been removed in python 3.12. Replace calls to
distutils.sysconfig to direct sysconfig calls.

Issue: eng/toolchain/gnatcoll-bindings#4
2024-04-29 17:46:48 +02:00
Vincent Jicquel
ab62dd3c5d Revert "Merge branch 'mr/jicquel/#4.python-3.12' into 'master'"
This reverts merge request !8
2024-04-04 08:05:04 +00:00
Vincent Jicquel
0a097d9322 Update python scripts to the new python version 3.12
distutils has been removed in python 3.12. Replace calls to
distutils.sysconfig to direct sysconfig calls.

Issue: eng/toolchain/gnatcoll-bindings#4
2024-03-22 14:22:50 +00:00
Nicolas Roche
8b274e50e2 Ensure that copy of Python static library is successful.
Part of CS0038379
2024-02-02 12:01:59 +01:00
Nicolas Roche
6786f75d72 Apply black to setup.py 2024-02-02 11:50:11 +01:00
Nicolas Roche
cd650de5e3 Add minimal support for Python 3.11
Part of eng/toolchain/gnatcoll-bindings#1
2023-10-31 11:41:09 +01:00
Adrien Boulanger
0decdc2341 VA24-029: Fix invalid conversion to C strings
Missing ASCII.NUL to be a valid C string

Change-Id: I70f2368523648d257d3c0b5dc59e10ee76f1db8a
2022-11-02 16:47:26 +01:00
Vadim Godunko
72ba437993 V927-001 Subprogram to create and register Python module.
Change-Id: Ic896a79c72bf85e0f273bfbf85186a9bd222a85b
2022-10-04 22:41:47 +04:00
Vadim Godunko
8313f88587 V927-001 Return correct value and remove unused variable.
Change-Id: Ia7b4a80b904710c235a159f8a1e6318e70d776ae
2022-09-30 10:38:06 +04:00
Adrien Boulanger
c62ce3517a S712-022: Over-referrencing when using old arguments as keywords
Change-Id: I91e966aab0b7e4a4cf231e9ecf3656ddb7982a7a
2022-04-07 15:45:09 +02:00
Adrien Boulanger
d7ee0cd71b S712-022: Fix over-referrenced object in the bindings
- PyObject_GetAttrString returns a new ref which must
be decref'd.
- Over-referrenced class when calling internal method

Change-Id: I16170aaa3e8daeaf4ad02dcc4cfee3f53574574e
2022-04-05 11:48:33 +02:00
Adrien Boulanger
1624f7e808 U914-005: Transition from python 3.7 to 3.9
- Disable the new vectorcall API (the tp_call profile only
supports the old call format).
- Add missing GIL locks
- Manually config python to use utf-8 (this was automatic with
previous versions)

Change-Id: I214b53e1e1b4fbc2a9af1cf1ec8985cff7905a55
2021-12-01 12:08:28 +01:00
Nicolas Setton
1a230fb6c1 U515-001 gracefully handle the absence of a static python lib
Fix a Python error that occurred when the static lib was not
found.

Change-Id: I02096a913e03714a23bf25935cf056e332452dd5
2021-05-26 10:56:34 +01:00
Nicolas Boulenguez
aeea734354 Use ADAFLAGS CFLAGS CPPFLAGS LDFLAGS if they exist in the environment 2021-04-05 15:56:56 +02:00
Nicolas Boulenguez
1adbba0a53 python.gpr: compute one External_As_List instead of many Split.
This is more efficient and readable.
2021-04-05 15:55:44 +02:00
Nicolas Boulenguez
53d37d3ed4 Removed unused OS_Kind external variable.
The related part of setup.py is still required by the imported
gnatcoll.gpr.
2021-04-05 15:55:13 +02:00
Nicolas Boulenguez
bd6661cae4 In library projects, only set version in the relocatable case 2021-04-05 15:54:31 +02:00
Nicolas Boulenguez
92da3a0af8 Explicitly mark projects with the library qualifier 2021-04-05 15:46:19 +02:00
Dmitriy Anisimkov
335f34c0d2 Fix compilation issue in debug mode
no-tn-check

Add Unreferenced mark to unreferenced but necessary variable.

Change-Id: Ia27e62b67544a9ee78f0f7a2276771476a6e62b5
2021-03-23 16:51:44 +01:00
Adrien Boulanger
7a272ebf03 U305-023: Defensive code for the GIL
Trying to ensure/release the GIL when there is no interpreter will
raise an exception.

Change-Id: I4f85bfbfdd799b906848d2038b52825c4c709e54
2021-03-19 12:34:13 +01:00
Adrien Boulanger
fc63e2906b U201-012: Ensure frame state when calling python function.
Most of the commands can only be called if we have the GIL:
retrieve it.
Add a controlled type to automatically retrieve/free the GIL.
Lock every call using Py_INCREF/Py_DECREF.

Change-Id: I8989fcb3eacf6aedbb90056469536144a2795a3f
2021-02-25 11:17:13 +01:00
Adrien Boulanger
45aaa42efc TC15-079: Remove forbidden flags METH_OLDARGS
METH_OLDARGS (0x0, i.e. no flag) was obsolete in python2
and is forbidden with python3.

(no-precommit-check)
Change-Id: I576042492d74ca69bd59ed6ea6264cb7562c650f
2021-02-12 11:18:02 +01:00