Pebaz / nimporter

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

Document shipping just .nim files #40

Closed juancarlospaco closed 3 years ago

juancarlospaco commented 3 years ago

I am interested in trying all ways of shipping that nimporter can do, one of the options is not documented along with the others, thats the option of just shipping the .nim files, I made a PIP package that install Nim and other that can install Nimpy, so would be nice to document on the readme how users can package the .nim files. For new users it might not be so obvious.

You can make your package depend on it install_requires = ["choosenim_install"], heres an example on Windows:

windows-compile

Commands in order to copy & paste:

Feel free to use the screenshot if is useful for Docs. :)

Pebaz commented 3 years ago

Hello @juancarlospaco !

I am interested in using choosenim_install as a dependency, but I wanted to ask: what does it do if Nim is already installed on the target machine?

Also, I forgot that this was in the readme, but here are the instructions for bundling just the Nim files. Using this method depends on having the Nim compiler installed on the target machine, which is why I'd like to know what the choosenim_install package does if there is already a Nim installation.

If choosenim_install will not clash with a preexisting Nim installation, it might be more appropriate for the readme to be updated to have source distributions rely on it instead of making it a global Nimporter library dependency.

Also, Nimporter already automatically installs nimpy if the Nim compiler is installed on the target machine.

I am impressed by these packages as I did not think to use PyPi as a method of installing non-python software before ;)

juancarlospaco commented 3 years ago

You have admin on the repo of choosenim_install, change what you want, etc.

If it is installed it will install it again, because what if user broke the installation and want to install it again ?.

Pebaz commented 3 years ago

Perfect. I think this is good to use then for source distributions. I made a couple changes to allow older Python versions to install choosenim_install. Can you reupload to Pypi when you get a chance?

juancarlospaco commented 3 years ago

It does whatever choosenim does on a given condition, so any improvement should go into choosenim directly instead of workaround specific behaviors.

Pebaz commented 3 years ago

I'm sorry I don't understand. Could you explain further?

Pebaz commented 3 years ago

Oh you mean Nim's official choosenim installer, not choosenim_install. Sorry I get it now.

Pebaz commented 3 years ago

I updated the readme to include choosenim_install.

I don't want to make it a dependency of Nimporter itself because Nim users with custom installations might not like that.