<div dir="ltr">Hello Masood,<div><br></div><div>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.</div><div><br></div><div>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:</div><div><br></div><div>First project with a usual package structure:</div><div><a href="https://github.com/lrq3000/unireedsolomon/blob/master/MANIFEST.in">https://github.com/lrq3000/unireedsolomon/blob/master/MANIFEST.in</a><br></div><div><a href="https://github.com/lrq3000/unireedsolomon/blob/master/setup.py">https://github.com/lrq3000/unireedsolomon/blob/master/setup.py</a></div><div><br></div><div>Second project with a flatout structure:</div><div><a href="https://github.com/lrq3000/reedsolomon/blob/master/MANIFEST.in">https://github.com/lrq3000/reedsolomon/blob/master/MANIFEST.in</a><br></div><div><a href="https://github.com/lrq3000/reedsolomon/blob/master/setup.py">https://github.com/lrq3000/reedsolomon/blob/master/setup.py</a></div><div><br></div><div>The commands I use to locally build the package are:</div><div><br></div><div><div>python setup.py sdist --formats=gztar,zip bdist_wininst --plat-name=win32</div><div>python setup.py sdist bdist_egg bdist_wheel --plat-name=win32</div></div><div><br></div><div>If your packaging config is correct, you should see the .pyx files in those builds.</div><div><br></div><div>And to build all other formats and upload to pypi, I use the python library Twine:</div><div><br></div><div>twine upload dist/*<br></div><div><br></div><div>Hope this can help you.</div><div><br></div><div>Best regards,</div><div>Stephen Larroque</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-08 12:00 GMT+02:00  <span dir="ltr"><<a href="mailto:cython-devel-request@python.org" target="_blank">cython-devel-request@python.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send cython-devel mailing list submissions to<br>
        <a href="mailto:cython-devel@python.org">cython-devel@python.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://mail.python.org/mailman/listinfo/cython-devel" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/cython-devel</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:cython-devel-request@python.org">cython-devel-request@python.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:cython-devel-owner@python.org">cython-devel-owner@python.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of cython-devel digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Cython coverage and multiple projects (Masood Malekghassemi)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 7 Oct 2015 16:06:01 -0700<br>
From: Masood Malekghassemi <<a href="mailto:atash@google.com">atash@google.com</a>><br>
To: <a href="mailto:cython-devel@python.org">cython-devel@python.org</a><br>
Subject: [Cython] Cython coverage and multiple projects<br>
Message-ID:<br>
        <CALweS8f=xeQfhmydXR5C70mbO1=1hibmsTgBPuvCuiUEqE=<a href="mailto:g8w@mail.gmail.com">g8w@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
I'd asked this of Robert Bradshaw earlier and was pointed in this direction<br>
(specifically towards Stefan), so here goes!<br>
<br>
I'm having trouble with getting Cython to play nicely with the coverage.py<br>
tool via the Cython.Coverage plug-in.<br>
<br>
We have tests that are running from a different setup.py project than the<br>
one which contains the Cython files (the projects respectively being for<br>
the duration of this discussion the 'tests' project and the 'source'<br>
project). The generated coverage file contains the line data for individual<br>
.pyx files, but the paths of the .pyx files themselves *within* the<br>
.coverage file appear to be rooted in the tests project rather than the<br>
site-packages folder in which the source project's files were installed<br>
(i.e. paths that never exist throughout the edit-build-test cycle).<br>
<br>
After editing the .coverage file manually to point to the source project<br>
directory, coverage.py reports that the .pyx files are not python files and<br>
errors out... but the .coveragerc file contains the plug-in module via<br>
`[run]\n plugins = Cython.Coverage`, so I'd have expected the Cython<br>
coverage.py plug-in to catch those files and handle them instead of letting<br>
the rest of coverage.py get confused over them.<br>
<br>
Furthermore, this is against the 4.0 coverage.py release rather than the<br>
4.0b2 coverage.py release (which appears to be the version against which<br>
the latest edit to the Cython code base was made). I don't see any API<br>
differences between the two in the plug-ins, but I might have missed<br>
something so maybe that's relevant.<br>
<br>
A secondary issue: the .pyx files are never copied over to the installation<br>
directory, so even if the paths were 'correct' (with respect to being<br>
copied into the site-packages folder or being accessible via developer mode<br>
pip-installs), they wouldn't be found. This seems like it wouldn't<br>
necessarily be an issue from a cursory glance at the source code as the<br>
file tracer in the Cython coverage.py plug-in appears to spit out blank<br>
lines in such a scenario.<br>
<br>
Complicating matters further, we're running the tests through pytest. That<br>
said, I've given up on trying to get pytest-cov to play nicely with this<br>
until I can get a manual invocation of `coverage report ...` to produce<br>
output describing the .pyx files.<br>
<br>
Thanks for reading this far. Got any pointers?<br>
<br>
<br>
----------------------------------------------------------------<br>
Context: <a href="https://github.com/soltanmm/grpc/tree/cy-wip/src/python" rel="noreferrer" target="_blank">https://github.com/soltanmm/grpc/tree/cy-wip/src/python</a><br>
Basic steps to run the tests:<br>
<br>
   - cd $GRPC_REPOSITORY_ROOT<br>
   - make<br>
   - CONFIG=opt ./tools/run_tests/build_python.sh 2.7<br>
   - CONFIG=opt PYVER=2.7 ./run_tests/run_python.sh<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.python.org/pipermail/cython-devel/attachments/20151007/11793594/attachment-0001.html" rel="noreferrer" target="_blank">http://mail.python.org/pipermail/cython-devel/attachments/20151007/11793594/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
cython-devel mailing list<br>
<a href="mailto:cython-devel@python.org">cython-devel@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/cython-devel" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/cython-devel</a><br>
<br>
<br>
------------------------------<br>
<br>
End of cython-devel Digest, Vol 57, Issue 5<br>
*******************************************<br>
</blockquote></div><br></div>