Pebaz / nimporter

Compile Nim Extensions for Python On Import!
MIT License
824 stars 33 forks source link

Running nimporter clean followed by setup.py adds duplicate lines to MANIFEST.in #21

Closed Benjamin-Lee closed 4 years ago

Benjamin-Lee commented 4 years ago

I should ask first, is running nimporter clean followed by pip install -e . the correct way to recompile the project on changes? I haven't had success otherwise but am probably doing something wrong.

Each time I rerun nimporter clean followed by pip install -e ., I get duplicate entries in MANIFEST.in. Is this intentional?

Pebaz commented 4 years ago

Hello @Benjamin-Lee thank you for reaching out!

The workflow for rebuilding the project each time has been improved. You can now make use of nimporter compile to rebuild every extension module/library in your project.

Also, you spotted a bug with the MANIFEST.in not being deleted on nimporter clean. Thanks for submitting an issue! This bug was fixed in 64eccc7

In summary, the workflow to compile your Nim extensions without bundling them up into a .wheel or .zip is to run nimporter compile which will compile the Nim extensions as if they were freshly imported at runtime.

You can also reference the README.md to get more info on this as it has been updated recently.

I would also recommend that you upgrade Nimporter to get the latest changes.

$ pip install --upgrade nimporter
Benjamin-Lee commented 4 years ago

Thanks for the information and the fix!

I've got the latest Nimporter (1.0.1) but there doesn't seem to be a "compile" command:

~/D/P/R/librtd ❯❯❯ pip install --upgrade nimporter
Requirement already up-to-date: nimporter in /Users/BenjaminLee/.virtualenvs/librtd/lib/python3.7/site-packages (1.0.1)
~/D/P/R/librtd ❯❯❯ nimporter compile
usage: nimporter [-h] {clean,build,bundle} ...
nimporter: error: argument cmd: invalid choice: 'compile' (choose from 'clean', 'build', 'bundle')

Creating a fresh virtual environment and installing from scratch does not solve the issue. Do you have any suggestions?

Benjamin-Lee commented 4 years ago

Interestingly, installing the latest development version of Nimporter via pip install git+https://github.com/Pebaz/nimporter did result in a working nimporter compile command. Looking at the PyPI entry, it seems that the Nimporter 1.0.1 wheel was uploaded on 4/20/2020, not yesterday like the GitHub release says. Might this be the cause?

Pebaz commented 4 years ago

I apologize for this, I had forgotten to update the 1.0.1 PyPi release after making a small change.

The most recent version is ready for download that contains the compile command.

Thank you for bringing this to my attention and have a great rest of your week!