Skip to content
Snippets Groups Projects
  1. Feb 13, 2019
  2. Jan 31, 2019
  3. Jan 11, 2019
  4. Jan 10, 2019
    • Michal Vyskocil's avatar
      P: cffi must be compatible with 3.2 · d2065033e33b
      Michal Vyskocil authored
      S: can't use u prefixes, as it is syntax error there
      d2065033e33b
    • Michal Vyskocil's avatar
      Define and raise specific hierarchy of exceptions · 93d6970fc206
      Michal Vyskocil authored
      * PkgConfigNotFound             - not installed
      * PkgConfigError                - base pkg-config errors
          * PkgConfigModuleNotFound   - pc file for module was not found
          * PkgConfigModuleVersionNotFound - requested version was not found
      
      Boilerplate now looks
      ```
      from cffi.error import PkgConfigNotFound, PkgConfigError
      ...
      try:
          # try pkg-config way
          ffibuilder.set_source(..., pkgconfig=["libczmq >= 4.0.0"])
      except PkgConfigNotFound as e:
          # if pkg-config is not installed, try backup
          ffibuilder.set_source(..., libraries=["czmq", "zmq", "uuid", "pgm"])
      except PkgConfigError as e:
          # here we catch both PkgConfigModuleNotFound and PkgConfigModuleVersionNotFound
          # and raise it again - simply to show they are raised
          raise e from None
      ```
      93d6970fc206
  5. Jan 09, 2019
    • Michal Vyskocil's avatar
      Document version pinning for pkgconfig · 59a7c949248b
      Michal Vyskocil authored
      59a7c949248b
    • Michal Vyskocil's avatar
      Exception based flow · 58d9217d4315
      Michal Vyskocil authored
      Now the with non pkg-config backup would be
      ```
      module_name = "_czmq"
      source = "#include <czmq.h>"
      try:
          print(f"### pkg-config path")
          ffibuilder.set_source(
              module_name,
              source,
              pkgconfig=["libczmq"]
          )
      except Exception as e:
          print(f"Exception e: {e}")
          ffibuilder.set_source(
              module_name,
              source,
              libraries=["czmq"]
          )
      ```
      58d9217d4315
  6. Jan 08, 2019
    • Michal Vyskocil's avatar
      428261c7ae2c
    • Michal Vyskocil's avatar
      Real test of a pkgconfig integration · e0251d298a40
      Michal Vyskocil authored
      Fix encoding errors
      
      Given testing Python program
      ```
      from cffi import FFI
      ffibuilder = FFI()
      
      ffibuilder.cdef(
          "char* zsys_hostname();"
      )
      
      ffibuilder.set_source(
          "_czmq",
          "#include <czmq.h>",
          pkgconfig=["libczmq"]
      )
      
      
      if __name__ == "__main__":
          ffibuilder.compile(verbose=True)
      ```
      
      We can run ffibuilder from source dir of czmq
      
      ```
      PKG_CONFIG_PATH=`pwd`/src python3 t.py
      generating ./_czmq.c
      ...
      gcc -pthread -shared -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none ./_czmq.o -L/usr/local/lib64 -L/usr/lib64 -lczmq -lzmq -lpython3.6m -o ./_czmq.cpython-36m-x86_64-linux-gnu.so
      ```
      
      ```
      python3 t.py
      generating ./_czmq.c
      ...
      gcc -pthread -shared -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none ./_czmq.o -L/usr/lib64 -lczmq -lpython3.6m -o ./_czmq.cpython-36m-x86_64-linux-gnu.so
      ```
      
      Note that in the first case `/usr/local` has been added to the compiler path as
      provided by local pkg-config file.
      e0251d298a40
    • Michal Vyskocil's avatar
      merge with latest tip · 48ca9a578dac
      Michal Vyskocil authored
      48ca9a578dac
    • Michal Vyskocil's avatar
      Increase testing coverage and refactor method names · 09ffc07bbde2
      Michal Vyskocil authored
      Making `pkgconfig.call` function accessible, tests can monkey patch it and
      provide mock. This improves testing, however raised a need to give
      functions better names than `pkgconfig.pkgconfig_kwargs` or `pkgconfig.pc`.
      09ffc07bbde2
  7. May 25, 2017
  8. May 22, 2017
  9. Jan 30, 2019
  10. Jan 28, 2019
    • Armin Rigo's avatar
      py3 fix · d100f3412c88
      Armin Rigo authored
      d100f3412c88
    • Armin Rigo's avatar
      Backed out changeset 7a76a3815340 · e2f85d257915
      Armin Rigo authored
      On Windows, there is no lround() or (as far as I can find) any math
      function returning an integer.
      e2f85d257915
    • Armin Rigo's avatar
      Windows compilation fix · e851dbe5757a
      Armin Rigo authored
      e851dbe5757a
    • Armin Rigo's avatar
      Issue #362 · 73a16cc62771
      Armin Rigo authored
      Add "thread canary" objects which are deallocated if the PyThreadState is
      explicitly deallocated by CPython.  If the thread shuts down first, then
      instead the canary is inserted in a zombie list.  In that case, we clear
      and delete properly the PyThreadState at the next occasion.
      73a16cc62771
  11. Jan 27, 2019
  12. Jan 08, 2019
  13. Jan 07, 2019
  14. Jan 05, 2019
  15. Dec 25, 2018
    • Armin Rigo's avatar
      Issue #392 · 126a323eb964
      Armin Rigo authored
      Workaround for a pycparser issue.
      126a323eb964
  16. Dec 18, 2018
Loading