Skip to content

Releases: tonybaloney/CSnakes

v1.0.35

05 Jun 09:21
80d6483
Compare
Choose a tag to compare

What's Changed

Major updates

Simple Async return Syntax

Simple async return type syntax is now supported. Where previously you needed to annotate a function as Coroutine[TYield, TSend, TReturn] the source generator supports simple return types, e.g.:

async def example() -> list[int]: 
   ... 

Package install API

If you need to install a single, or multiple packages at runtime using pip or uv pip you can use the IPythonPackageInstaller .InstallPackageand.InstallPackages` methods. See docs for more details

Disable Signal Handlers

Python will automatically install signal handlers to capture CTRL+C (SIGINT) or SIGTERM. There is now an extension method on IPythonEnvironmentBuilder to .DisableSignalHandlers() see docs for an example. This feature is opt-in, so the default remains that Python will handle SIGINT whilst Python has been activated. Carefully consider where in your process you want to handle SIGINT.

Better error reporting in source generation

If the source generator sees invalid syntax, it will now provide more robust and detailed reporting, see #395 for more details.

Dev Updates

Bug Fixes

  • Add missing disposal of buffer exporters in proxies by @atifaziz in #488
  • Discard result when function returns None by @atifaziz in #493
  • Fix Python parameter parsing to reject invalid syntax by @atifaziz in #395
  • Fix bug where Python arg name was used on C# side by @atifaziz in #498

New Contributors

Full Changelog: v1.0.34...v1.0.35

v1.0.34

25 May 01:21
3a0e1bb
Compare
Choose a tag to compare

What's Changed

This release is mostly a bugfix release, including several optimizations to the PyBuffer implementation.

Bug fixes

  • Change all spawned processes to use argument lists. Add InstallPackage to IPythonPackageInstaller by @tonybaloney in #470
  • Fix memory leak in PythonRunString by @atifaziz in #458
  • Fix leaks by making IPyBuffer disposable by @atifaziz in #469

Performance improvements

Full Changelog: v1.0.33...v1.0.34

v1.0.33

07 May 09:59
db3ec2a
Compare
Choose a tag to compare

What's Changed

Highlights:

  • Async function calls are 50-70% faster
  • Loggers are no longer required when establishing environments

Performance Improvements

  • Refactor to use a single event loop for coroutines by @atifaziz in #438
  • Make all loggers & logging optional by @atifaziz in #446
  • Improve performance with per-type overloads for PyObject.From by @atifaziz in #445

Features

  • (Experimental) Optionally embed source code for modules in generated classes by @tonybaloney in #451
  • Implement truthy-falsy for PyObject by @atifaziz in #437

Other

  • Update test-related packages to their latest versions by @atifaziz in #439
  • Fix typo in error message when configuring Conda environment by @atifaziz in #444

Full Changelog: v.1.32.0...v1.0.33

v1.0.32

29 Apr 02:58
e7b405f
Compare
Choose a tag to compare

What's Changed

  • Async methods are now cancelleable via CancellationTokens
  • A general performance guide is now available on the docs
  • Optional parameters are marked as nullable even when they don't have a default value of None
  • Optional returns are typed as nullable

General Improvements

  • Add CancellationToken parameter to generated async methods by @atifaziz in #431
  • Make generator iterator disposal idempotent by @atifaziz in #423
  • Make GIL acquisition a ref struct by @atifaziz in #430
  • Make coroutine task result to be just TYield by @atifaziz in #425
  • Add a doc page on performance considerations by @tonybaloney in #421
  • Fix optionality of function parameters & return by @atifaziz in #299

Bug fixes

Other changes

Full Changelog: v1.0.31...v.1.32.0

v1.0.31

23 Apr 02:40
01a9f3f
Compare
Choose a tag to compare

What's Changed

This project includes experimental NativeAOT support if you use the source generator.

Performance improvements

Functions returning tuples will be 20-30% faster:

  • Move known conversions to (AOT-friendly) generated code by @atifaziz in #413
  • Return immortals from PyObject.From for long + BigInteger by @atifaziz in #417

Bug Fixes

  • More rebust search for conda source folder by @gukoff in #391
  • Fix PyObject.As for int on LP64 & LLP64 by @atifaziz in #415
  • Fix formatting inconsistencies by @atifaziz in #389
  • Fix FromRedistributable overload resolution error by @atifaziz in #409
  • Add missing System.Threading.Tasks import in generated code by @atifaziz in #410

Other Changes

New Contributors

Full Changelog: v1.0.30...v1.0.31

v1.0.30

26 Mar 03:13
ffb9dba
Compare
Choose a tag to compare

What's Changed

Bug Fixes

  • sys.executable is now the python executable path instead of the .NET host process. Stops confusion from packages (like spacy) which assume you can call sys.executable to pip install packages. PR by @tonybaloney in #380
  • Make GIL disposal idempotent once disposed by @atifaziz in #372

Improvements

Other

New Contributors

Full Changelog: v1.0.29...v1.0.30

v1.0.29

14 Mar 05:16
e68f37c
Compare
Choose a tag to compare

What's Changed

  • Fix crash on GIL acquisition within pybind11 extensions by @tonybaloney in #369

Full Changelog: v1.0.28...v1.0.29

v1.0.28

12 Mar 09:17
adab35b
Compare
Choose a tag to compare

What's Changed

.FromRedistributable() locator now has arguments for Python version (3.9-3.14), free-threaded builds and debug builds.

Other Changes

Full Changelog: v1.0.27...v1.0.28

v1.0.27

14 Feb 05:34
de9f054
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.26...v1.0.27

v1.0.26

27 Jan 05:01
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.25...v1.0.26