PEP-394 recommends specifying python2 or python3 in shebangs unless the
script is known to only run in an activated virtual environment.
PEP-394 also says distributors may not provide the python command.
Newer versions of Ubuntu, at least, no longer provide python unless the
python-is-python3 package is explicitly installed.
Removed some shebangs from testcases (the test-suite does not need them).
* char_binary_java_fix-tidyup:
Move SWIGStringWithLengthHelper to csharphead.swg
cdata whitespace/cosmetic fixups
cdata doc updates
Rename `typemaps/cdata_struct.swg` to `typemaps/cdata_begin.swg`. And `typemaps/cdata.swg` to `typemaps/cdata.swg`. Move `cdata_apply.swg` content to `typemaps/cdata.swg`.
Group the C# marshalling of STRING-LENGTH typemap into C# class named SWIGStringWithLengthHelper.
Leave Length & string reverse order typemap in typemaps/strings.swg
Support old C# as "LPUTF8Str" was add in 2017.
Improve documentation. Follow @wsfulton reviews.
Use a dummy for MzScheme and untested OCaml cdate. To prevent compilation error.
Further fixing follow reviews.
Reorganise raw data typemap, so typemaps folder contain only common part. Improve document.
Inline SWIG_string_to_utf8_bytes SWIG_utf8_bytes_to_string code
Fixes of STRING/BYTES LENGTH typemaps.
Conflicts:
CHANGES.current
The cdata.i docs in C#, Java, D, Go had a confusing mix of target language
and C declarations. Improve the main cdata documentation in Library.html instead.
* py-stable-abi2:
Note about abi3audit and inlined functions
Add recent stable ABI improvements to changes file
Switch to SWIG_Py_DECREF instead of Py_Decref
Show ABI version in CI job name
C89 conformance for Python stable ABI
Remove Py_TYPE definition
Move Stable ABI to more sensible section and update html sectioning
Add abi3audit information for Python stable ABI
Use PyObject_Free instead of deprecated macros
Don't run abi3audit on builtin test
Strict Python stable abi conformance fix for PyUnicode_GetLength
Don't use abi3audit if not installed
Unused parameter warning fix in SWIG_Python_TypeError
Add PY_ABI_VER for testing Python stable ABI using abi3audit
configure.ac python versions update
Tidy up EXTRA_ build flags
Py_DecRef Py_IncRef for examples and html docs
Additional casts for Python DecRef change
Py_XDECREF -> Py_DecRef for stable ABI compliance
Py_DECREF -> Py_DecRef for stable ABI compliance
Py_IncRef casts
Py_XINCREF -> Py_IncRef for stable ABI compliance
Py_INCREF -> Py_IncRef for stable ABI compliance
Add Python increment and decrement wrappers
minor enhancement in changes file
Conflicts:
CHANGES.current
Fix Java STRING LENGTH typemap.
Use string type in static typed languages (Java, C#, D and Go).
Add BYTES LENGTH typemap and apply it for binary data.
Use byte type in static typed languages.
Add li_cdata_cpp, li_cdata and char_binary
tests for most of languages(apart from R and experimental).
Fix the director_binary_string test and add it to C#, D, Go,
Perl, PHP, Python, Ruby and octave.
Update documents.
Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
Since this was first added, the -py3 option has been dropped
and the Stable ABI is known as exactly that, not the Python3 Stable ABI.
Document the new option and turn on c++20 testing for it to cover
std::filesystem and std::string_view testing which are affected
Without this you get two set_transform() functions defined in the
.py file, which can trigger warnings from linting tools.
Renaming the SWIG-generated wrapper is a reasonably clean solution
(though does leave an unused _set_transform() Python function).
See #2578
We were providing an example set of typemaps in the manual, but they
were specific to Python2 which isn't helpful these days.
For typical cases argcargv.i is a better option. It doesn't currently
seem to directly support the "argv without argc" case which this example
actually shows, but generally APIs take a length as well as a char**.
Closes: #2040
This has only been present for backward compatibility since 2006
and now has the value 0 so doesn't do anything, so don't use it
as an example of a flag in the docs.
If a "docstring" feature is present it will still override a Doxygen comment.
If the "autodoc" feature is also present, the combined "autodoc" and "docstring"
will override the Doxygen comment. If no "docstring" is present then the
"autodoc" feature will not be generated when there is a Doxygen comment.
This way the "autodoc" feature can be specified and used to provide documentation
for 'missing' Doxygen comments.
Closes#1635
pyabc.i for abstract base classes now supports versions of Python
prior to 3.3 by using the collection module for these older versions.
Python-3.3 and later continue to use the collections.abc module.
The -py3 option no longer has any effect on the %pythonabc feature.
Correct logic for suppressing static methods.
Previous logic was missing director disown methods.
Add changes file entry for -flatstaticmethod.
Closes#2137
The initial prototype shown in these examples has a `len` parameter
but that the rest of the example is as if that parameter isn't there
so remove it from the initial prototype.
Fixes https://sourceforge.net/p/swig/bugs/1289/
Both function annotations and variable annotations are turned on using the
"python:annotations" feature. Example:
%feature("python:annotations", "c");
struct V {
float val;
};
The generated code contains a variable annotation containing the C float type:
class V(object):
val: "float" = property(_example.V_val_get, _example.V_val_set)
...
Python 3.5 and earlier do not support variable annotations, so variable
annotations can be turned off with a "python:annotations:novar" feature flag.
Example turning on function annotations but not variable annotations globally:
%feature("python:annotations", "c");
%feature("python:annotations:novar");
or via the command line:
-features python:annotations=c,python:annotations:novar
Closes#1951
Python function annotations containing C/C++ types are no longer
generated when using the -py3 option. Function annotations support
has been moved to a feature to provide finer grained control.
It can be turned on globally by adding:
%feature("python:annotations", "c");
or by using the command line argument:
-features python:annotations=c
The implementation is designed to be expandable to support different
annotations implementations. Future implementations could implement
something like the following for generating pure Python types:
%feature("python:annotations", "python");
or typing module types to conform to PEP-484:
%feature("python:annotations", "typing");
Closes#1561
Issue #735