Giter Site home page Giter Site logo

easycython's Introduction

easycython

Because writing a setup.py each time is painful.

Status

Linux

x64 2.7 3.4 3.5 3.6
https://travis-ci.org/cjrh/easycython.svg?branch=master https://coveralls.io/repos/cjrh/easycython/badge.png

Windows

x86 2.7 3.4 3.5 3.6
x64 2.7 3.4 3.5 3.6
https://ci.appveyor.com/api/projects/status/23heqrp96f6ftmsr

Introduction

easycython.py is a script that will attempt to automatically convert one or more .pyx files into the corresponding compiled .pyd|.so binary modules files. Example:

$ python easycython.py myext.pyx

pip install easycython will automatically create an executable script in your Scripts/ folder, so you should be able to simply:

$ easycython myext.pyx

or even:

$ easycython *.pyx

You can type:

$ easycython -h

to obtain the following CLI:

usage: easycython.py [-h] [--annotation] [--no-annotation] [--numpy-includes]
                     [--no-numpy-includes]
                     [filenames [filenames ...]]

positional arguments:
  filenames

optional arguments:
  -h, --help           show this help message and exit
  --annotation
  --no-annotation      (default: True)
  --numpy-includes
  --no-numpy-includes  (default: True)
  • --annotation (default) will emit the HTML Cython annotation file.
  • --numpy-includes (default) will add the numpy headers to the build command.
  • Compiler flags -O2 -march=native are automatically passed to the compiler. I have not yet had to step through the generated C code with a debugger.

easycython's People

Contributors

cjrh avatar dependabot-preview[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easycython's Issues

Add more flexible support for linking to other C libs

This from a DM from @twilighttucson:

Currently, there is built-in support for numpy as you probably already saw, but I'm quite happy to add support for OpenMP. Would it be sufficient to add a command-line flag to specify openmp support? Perhaps something like

easycython --openmp myfile.pyx

?

I could generalise this e.g., for numpy too as in:

easycython --openmp --numpy myfile.pyx

?

What kind of thing would work best for your use case?

So the thinking is that additional C libs could be specified by name on the easycython command line. I'm not going to build in complete support for custom libs though, like C's -L and so on. These libs, like openmp would have to be installed in the system in the default paths for the headers and libs.

Vim integration

I would like to make a vim bundle for driving easycython. Firstly, the cython support for vim must be improved to highlight correctly (it seems like cpdef for instance is not recognized). Then, the plugin should allow launching easycython on a file, and (configurable) automatically open the annotation html file in the system browser for inspection. It would be awesome if compilation errors could be traversed in the .pyx source.

Add more tests

I want a lot more tests, in which easycython is used to compile a bunch of different things. I especially want tests where .pxds are used, and where numpy integration is heavily tested.

Allow file extension `.pyx` to be omitted on cmd line

Since the cython source modules are always going to have extension .pyx, it is convenient to allow the user to write only the module name and omit the extension. When working in a terminal, the shell will do completion on the filename but will stop at the extension because generally there will be multiple files with the same base name. This change would allow the user to use the shell completion for the main name and infer the extension.

This should probably be done as part of #3.

Cython directive 'language_level'

Very handy tool, this, works well! The only issue I can find is this: If you use the tool, you get this warning:

FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2).

Is there a way to set the language_level to 3 to make sure Cython uses the correct version of Python and get rid of this warning?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.