[Cython] cython-devel Digest, Vol 57, Issue 5

Stephen LARROQUE lrq3000 at gmail.com
Thu Oct 8 10:35:34 EDT 2015

Hello Masood,

I can only answer the second issue. You need to explicitly include the
*.pyx files in your MANIFEST.in, because else this .pyx files aren't
automatically managed by the distutils package so it doesn't know it has to
add the .pyx files.

I have recently packaged two libraries, with different hierarchy layouts,
so you can maybe use one of them as an example to fix your packaging:

First project with a usual package structure:

Second project with a flatout structure:

The commands I use to locally build the package are:

python setup.py sdist --formats=gztar,zip bdist_wininst --plat-name=win32
python setup.py sdist bdist_egg bdist_wheel --plat-name=win32

If your packaging config is correct, you should see the .pyx files in those

And to build all other formats and upload to pypi, I use the python library

twine upload dist/*

Hope this can help you.

Best regards,
Stephen Larroque

2015-10-08 12:00 GMT+02:00 <cython-devel-request at python.org>:

> Send cython-devel mailing list submissions to
>         cython-devel at python.org
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.python.org/mailman/listinfo/cython-devel
> or, via email, send a message with subject or body 'help' to
>         cython-devel-request at python.org
> You can reach the person managing the list at
>         cython-devel-owner at python.org
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of cython-devel digest..."
> Today's Topics:
>    1. Cython coverage and multiple projects (Masood Malekghassemi)
> ----------------------------------------------------------------------
> Message: 1
> Date: Wed, 7 Oct 2015 16:06:01 -0700
> From: Masood Malekghassemi <atash at google.com>
> To: cython-devel at python.org
> Subject: [Cython] Cython coverage and multiple projects
> Message-ID:
>         <CALweS8f=xeQfhmydXR5C70mbO1=1hibmsTgBPuvCuiUEqE=
> g8w at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> I'd asked this of Robert Bradshaw earlier and was pointed in this direction
> (specifically towards Stefan), so here goes!
> I'm having trouble with getting Cython to play nicely with the coverage.py
> tool via the Cython.Coverage plug-in.
> We have tests that are running from a different setup.py project than the
> one which contains the Cython files (the projects respectively being for
> the duration of this discussion the 'tests' project and the 'source'
> project). The generated coverage file contains the line data for individual
> .pyx files, but the paths of the .pyx files themselves *within* the
> .coverage file appear to be rooted in the tests project rather than the
> site-packages folder in which the source project's files were installed
> (i.e. paths that never exist throughout the edit-build-test cycle).
> After editing the .coverage file manually to point to the source project
> directory, coverage.py reports that the .pyx files are not python files and
> errors out... but the .coveragerc file contains the plug-in module via
> `[run]\n plugins = Cython.Coverage`, so I'd have expected the Cython
> coverage.py plug-in to catch those files and handle them instead of letting
> the rest of coverage.py get confused over them.
> Furthermore, this is against the 4.0 coverage.py release rather than the
> 4.0b2 coverage.py release (which appears to be the version against which
> the latest edit to the Cython code base was made). I don't see any API
> differences between the two in the plug-ins, but I might have missed
> something so maybe that's relevant.
> A secondary issue: the .pyx files are never copied over to the installation
> directory, so even if the paths were 'correct' (with respect to being
> copied into the site-packages folder or being accessible via developer mode
> pip-installs), they wouldn't be found. This seems like it wouldn't
> necessarily be an issue from a cursory glance at the source code as the
> file tracer in the Cython coverage.py plug-in appears to spit out blank
> lines in such a scenario.
> Complicating matters further, we're running the tests through pytest. That
> said, I've given up on trying to get pytest-cov to play nicely with this
> until I can get a manual invocation of `coverage report ...` to produce
> output describing the .pyx files.
> Thanks for reading this far. Got any pointers?
> ----------------------------------------------------------------
> Context: https://github.com/soltanmm/grpc/tree/cy-wip/src/python
> Basic steps to run the tests:
>    - make
>    - CONFIG=opt ./tools/run_tests/build_python.sh 2.7
>    - CONFIG=opt PYVER=2.7 ./run_tests/run_python.sh
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.python.org/pipermail/cython-devel/attachments/20151007/11793594/attachment-0001.html
> >
> ------------------------------
> Subject: Digest Footer
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> https://mail.python.org/mailman/listinfo/cython-devel
> ------------------------------
> End of cython-devel Digest, Vol 57, Issue 5
> *******************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20151008/368c6766/attachment.html>

More information about the cython-devel mailing list