Nimporter Versions Save

Compile Nim Extensions for Python On Import!

v2.0.0rc

2 years ago

Complete Rewrite of Nimporter Core Functionality

There have been a large number of inconsistencies corrected, flaws remedied, and conventions standardized upon in order to make this the best version of Nimporter ever!

Main Changes

  • Nimporter can now be used to distribute Source Distributions of libraries without requiring the user to have a Nim compiler installed! 🎉
  • New logo
  • Formalized why Nimporter chooses C compiler: when Importing, CC must match CC used to build Python. When Exporting, CC will either match the CC used to build Python (bdist_wheel) or will be one of many within a matrix of supported CCs (sdist)
  • Removed nimporter [bundle|build]
  • Nimporter is more formalized now. Extension Modules and Extension Libraries are first class notions now.
  • Hashing and Caching is now supported for Libs & Modules correctly!
  • Extension libraries must use structure defined in this cookiecutter template
  • If NIMPORTER_INSTRUMENT is in environment, compile output is printed for debugging
  • Added Semgrep in CI to scan for code patterns that could lead to security vulnerabilities

I believe everything in #60 has been addressed as it pertained to the rewrite.

@SekouDiaoNlp @juancarlospaco @benjamin-lee @retsyo @paul-nameless @ivan1248 @philippeitis @WesleyYue If any of you happen to have time, can you test the new functionality of Nimporter on any of your projects by installing this v2.0.0rc release?

Let me know any pain points you encounter if you chose to refactor and maybe things can be polished off. Also, there are a few things that are different in this version:

  • Nim Extension Libraries have a specific folder structure (as noted in the new readme)
  • Only Nim Extension Libraries can customize compiler switches
  • Interactions with setup.py are slightly different
  • The C compiler is customized automatically by Nimporter to improve cross-platform distribution
  • More in the readme

I have a question regarding the utility of Python & Nim in regards to Nim binary dependencies. For instance, if some Nim code is using Raylib for example, would this work with a Binary Distribution? If so, I think I should update the readme to say that Source Distributions only support pure Nim code because of how they work now. Source Distributions precompile a bunch of different platform/architecture/CC combinations in order to allow users with those target triples to use their own CC to without having Nim installed. However, I think that this has some implications that may not be fully known at this time.

Let me know if there are any glaring bugs 🐞 and I'll work to fix them. I know this represents some breaking changes, but if Nimporter can gain the ability to allow Python users to install Source Distributions without installing a Nim compiler, that would be totally amazing! 🚀

v1.1.0

2 years ago

Minor Version Release v1.1.0

What's Changed

  • Fixed Issue with macOS build using 'd:lto' flag + Added support for *.nim.cfg and *.nims files to specify compiler flags. + Amended the README see #52 by @SekouDiaoNlp in https://github.com/Pebaz/nimporter/pull/55
  • Deprecating switches.py in favor of *.nim.cfg and *.nims

New Contributors

Full Changelog: https://github.com/Pebaz/nimporter/compare/v1.0.4...v1.1.0

v1.0.4

3 years ago

Fixes:

#37 #40

v1.0.3

3 years ago

New Features:

  • Fixed bug where exclude_dirs argument in build_nim_extensions() was not being fully utilized.

v1.0.2

3 years ago

v1.0.1

3 years ago

New Features

  • Added CLI command: nimporter compile which improves workflows related to compiling all Nim sources without running the application or bundling an application into a Zip archive without using a setup.py.

Bug Fixes

  • Fixed MANIFEST.in not being deleted on nimporter clean if it resided in project root

v1.0.0

4 years ago

Major Release v1.0.0

After 2 months of hard work, I am proud to announce the release of Nimporter version 1.0.0! I have now implemented all of features necessary to consider Nimporter complete but will continue to provide bug fixes and small enhancements as they become necessary. The greatest feature in this release is the ability to distribute libraries using Nim code without requiring the end user to install a Nim compiler. Here is a list of the new features introduced in this version:

  • Distribute libraries with Nim code without requiring end users to install a Nim compiler!
  • Much easier installation: pip install nimporter.
  • Nimporter can work with Nim installed via Choosenim or manually.
  • Nimporter finds Nim standard library automatically.
  • Entire Nim projects with .nimble dependencies are now officially supported.
  • Binary (wheel) distributions are officially supported and are effortless to create (1 extra line of code).
  • Source distributions now directly imply that they contain bundled Nim source files.
  • Absolute control over CLI args are 100% supported for an arbitrary number of platforms and situations.
  • Arbitrarily complex namespacing is maintained for libraries packaged with Nim code.
  • 44 unit tests and 5 integration tests.
  • 94% code coverage
  • Official Nimporter CLI for cleaning cached builds and compiling extensions in the terminal.
  • Generated documentation.
  • New logo. 😃

There is now no excuse not to make your Python code more performant using Nim. All of the hard work has been done for you: simply plop a Nim source file into your project, import nimporter, and then directly import your Nim code. You can now think of Nimporter as Cython for Nim, but seamless.

Furthermore, none of your end users have to install a Nim compiler (or a C compiler for that matter). Distribution is 1 extra line of code.

Using Nim with Python now involves the same effort as writing pure Python.

Welcome to Nimporter 1.0.0.

v0.1.5

4 years ago

Includes changes from

  • @Pebaz
  • @WesleyYue

Changelog

  • Bugfix: Fixed bug when importing importlib.util as noted here.
  • Improvement: Improved breadth of supported Python versions by using custom hash function rather than importlib.util.source_hash() introduced in Python 3.7+.

v0.1.4

4 years ago

Includes changes from

  • @Pebaz

Changelog

  • Bugfix: Fix critical bug on Windows caused by Nim outputting MSVC banner to STDERR which would be raised as an exception by Nimporter.

v0.1.3

4 years ago

Includes changes from

  • @Pebaz

Changelog

  • Improvement: Added documentation on how to distribute Nim source files along with a library.
  • Improvement: Nimporter now has a IGNORE_CACHE parameter that forces the rebuild of any Nim file while set.
  • Bugfix: Libraries distributed with Nim source files can now import those files using relative paths.