Commit graph

16 commits

Author SHA1 Message Date
William S Fulton
842ae379aa GHA: Fix for pycodestyle check in examples
E275 missing whitespace after keyword
For pycodestyle 2.9.0 released on 30 July 2022.
2022-07-31 09:02:00 +01:00
luz paz
c8bec18554 Fix various typos
Found via `codespell -q 3 -L ans,anumber,ba,bae,chello,clos,cmo,coo,dout,fo,funktion,goin,inout,methid,nd,nin,nnumber,object,objekt,od,ois,packag,parm,parms,pres,statics,strack,struc,tempdate,te,thru,uint,upto,writen`
2022-04-11 07:59:36 +12:00
William S Fulton
89bee6a7fa Modify examples to be both Python 2 and 3 compatible
For removing dependency on 2to3
2020-08-15 16:46:01 +01:00
William S Fulton
03323f5c8b The Python module import logic has changed to stop obfuscating real ImportError problems.
Only one import of the low-level C/C++ module from the pure Python module is
attempted now. Previously a second import of the low-level C/C++ module was attempted
after an ImportError occurred and was done to support 'split modules'. A 'split module' is
a configuration where the pure Python module is a module within a Python package and the
low-level C/C++ module is a global Python module. Now a 'split module' configuration is
no longer supported by default. This configuration can be supported with a simple
customization, such as:

  %module(package="mypackage", moduleimport="import $module") foo

or if using -builtin:

  %module(package="mypackage", moduleimport="from $module import *") foo

instead of

  %module(package="mypackage") foo

See the updated Python chapter titled "Location of modules" in the documentation.

Closes #848 #1343
2018-12-16 16:41:39 +00:00
William S Fulton
ff93f2e26e Skip Python subprocess calls in import_packages testcase on Windows
Getting these kind of errors on Appveyor which uses mingw/cygwin to run
a Python interpreter:

Native windows Python 3.6 running under cygwin and mingw Python 3.7 running under mingw:
  Fatal Python error: _Py_HashRandomization_Init: failed to get random
  numbers to initialize Python

Cygwin Python 2.7 running under cygwin:
  0 [main] python2.7 496 child_info_fork::abort: address space needed by '_foo.dll' (0x6D0000)
  is already occupied
2018-12-06 06:50:57 +00:00
William S Fulton
604ae7186b Fix for running 'python -m' when using swig -builtin
Same as e05b5ea for -builtin.

Also added runtime tests to check 'python -m'.
2018-12-04 19:12:13 +00:00
William S Fulton
0d588d19ad Fix out of source clean target in import_packages Makefile 2018-01-07 00:57:23 +00:00
William S Fulton
830422a87b Fix Makefile and skip testing python-2.4 for import_packages test 2018-01-05 20:17:08 +00:00
William S Fulton
aedc3c3eaf Replace assert in Python import examples with code that always runs. 2017-08-13 21:32:44 +01:00
William S Fulton
dd40a25349 Add missing print statements to the Python import_packages tests 2016-06-06 22:12:56 +01:00
William S Fulton
53ff928688 Examples readme file tweak 2016-06-05 11:23:58 +01:00
Mike Romberg
2ea01f349d remove builtin tests as they are already covered. 2016-06-04 14:12:33 -06:00
Mike Romberg
0cc3c78abf Apply patch to cleanup whitespace from wsfulton 2016-06-04 14:07:50 -06:00
Mike Romberg
055ddc6dfc remove -py3 related tests. Move py3 specific code to it's own module 2016-06-03 18:11:07 -06:00
Mike Romberg
621325a7dd Something optimizes out empty files and breaks the tests. Put something in. 2016-06-03 01:30:43 -06:00
Mike Romberg
ddc9fc1eb9 split_wrapper -> split_modules to avoid conflict with clean rule 2016-06-02 22:45:59 -06:00