question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publish `plum-dispatch-purepython` without C extensions to PyPI

See original GitHub issue

If my benchmarks are accurate (using benchmark.py), cythonising plum.function is at best 2x faster. For our use-case — a high-level framework on top of lower-level libraries like numpy and torch — this isn’t worth the loss of stack trace and inspect support.

@wesselb would you consider publishing a build of plum without C extensions to PyPI?

One way to go about this is for setup.py to only add to ext_modules if an environment variable is set (e.g. USE_CYTHON), and for the GitHub Action to do an additional build and publish with that variable set. If you’re on board, I’m happy to help where I can!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
wesselbcommented, Jul 27, 2022

Hey @seeM!

Sorry for not replying sooner. I’ve been in the last stretch of writing up my dissertation, which is now finally done, so I can get back to it.

If Cythonising plum.function only gives a 2x speed-up, perhaps the right choice is to get of Cythonising entirely in the main library. As you say, perhaps the loss of stack trace and inspection support isn’t worth it. @PhilipVinc, what are your thoughts on this?

I am taking a break until the end of next week, during which I won’t have access to my laptop. After that, I’ll be back to work. Once I’m back, I’ll setup a few more careful benchmarks to really figure out the benefits of Cythonising. If the benefits are only marginal and if others agree, perhaps we can then decide to just get rid of the compilation step wholly.

1reaction
jmosbachercommented, Aug 5, 2022

Just came to the issues section to ask this very question. This would be greatly appreciated! I absolutely love this package and want to use it for everything but I also really want my packages to be usable in pyscript so I feel like my parents are going through a rough divorce and forcing me to choose… PS @wesselb congrats on finishing your thesis! this package is truly awesome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Publish an Open-Source Python Package to PyPI
In this step-by-step tutorial, you'll learn how to create a Python package for your project and how to publish it to PyPI, the...
Read more >
Prepare C-based Cython package to publish on pypi
The cython extension code is not being built by setup.py . Changes to .pyx/.pxd will not be reflected in the package. Try something...
Read more >
hello-c-extension - PyPI
hello-c-extension. Showcase use and packaging of a C++ extension module. $ python -m pip install hello-c-extension. Use: >>> from cmod import CONSTANT, ...
Read more >
Packaging and distributing projects
You'll need this to upload your project distributions to PyPI (see below). ... If your project also supports Python 2 and contains no...
Read more >
publish v2 to PyPI · Issue #4947 · aws/aws-cli - GitHub
Not publishing CLI v2 to PyPI has been a conscious decision and for the ... Depending on a C extension can mean that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found