Skip to content

Update pynet version #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 67 commits into
base: unity-custom
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
21c5dcc
implemented dynamic equality and inequality for PyObject instances
lostmsu Jun 30, 2022
e241a9d
got rid of a few deprecation warnings that pollute GitHub code review
lostmsu Jun 30, 2022
ce3afa6
Fix broken prefix and debug leftover
filmor Jun 28, 2022
14aae2e
Ensure that version.txt is always read from repo root
filmor Jul 6, 2022
60463a3
docs: Fix a few typos
timgates42 Jul 16, 2022
85d0ca6
mention the need for PythonEngine.Initialize and BeginAllowThreads in…
lostmsu Aug 4, 2022
5f63c67
BREAKING: disabled implicit conversion from Python objects implementi…
lostmsu Aug 8, 2022
0909021
Explicit float and int conversion for builtin types (#1904)
filmor Aug 12, 2022
bd48dc1
Fill nb_index slot for integer types (#1907)
filmor Aug 13, 2022
4241493
fixed use of the process handle after Process instance goes out of sc…
lostmsu Sep 16, 2022
bdf671e
fixed new line character at the end of informational version (#1941)
lostmsu Sep 16, 2022
3f12469
Bump clr-loader dependency to 0.2.3 and adjust interface
filmor Sep 16, 2022
db52dde
Improve error message if the runtime fails to load
filmor Sep 16, 2022
fd8fd3b
Fix manifest so we can build with python -m build
filmor Sep 17, 2022
91d3e55
reenabled test for https://github.com/pythonnet/pythonnet/issues/1256…
lostmsu Sep 17, 2022
43769f5
Merge pull request #1942 from filmor/configless-coreclr
filmor Sep 17, 2022
f1ef11d
Bump release candidate version
filmor Sep 18, 2022
a02799d
Fix implicit float conversion for classes that derive from float
filmor Sep 19, 2022
2194d6c
Drop PyLong_Check (which checked for exact type) in favour of PyInt_C…
filmor Sep 19, 2022
52cf03c
Merge pull request #1908 from filmor/implicit-float-int
filmor Sep 20, 2022
15a8b26
Bump release candidate version
filmor Sep 20, 2022
08fd638
Add initial documentation setup
filmor May 26, 2022
64ea044
Ensure build props always read the correct version file
filmor Sep 19, 2022
13f2a9c
Convert back to RST, add section on runtime loading
filmor Sep 26, 2022
42b122d
Publish documentation from the release branch for now
filmor Sep 26, 2022
cc2fdac
Adjust installation documentation
filmor Sep 26, 2022
80adda9
Merge pull request #1863 from filmor/docs
filmor Sep 26, 2022
3c4dd16
Update README
filmor Sep 26, 2022
33b107c
Move clr module to separate file
filmor Sep 26, 2022
6ec635d
Drop unused param doc
filmor Sep 26, 2022
aae9d56
Bump version to 3.0.0
filmor Sep 29, 2022
95c1371
Merge remote-tracking branch 'upstream/release'
filmor Sep 29, 2022
2c233ef
Bump master version to 3.1.0-dev
filmor Sep 29, 2022
eb62787
Run documentation build from master
filmor Sep 29, 2022
a3b7789
Roll changelog over
filmor Sep 29, 2022
0119f1c
Specify supported Python version in project metadata
filmor Sep 29, 2022
bf984f0
Merge backports-2.5 changelog in and fix links
filmor Sep 30, 2022
b5c222c
a few debug helper properties
lostmsu Oct 13, 2022
6838ee1
fixed name collision for generated delegate dispatchers
lostmsu Oct 13, 2022
5a28fd4
delete target object from event handler collections when it has no mo…
lostmsu Oct 13, 2022
ce76dae
Merge pull request #1973 from losttech/bugs/1972
filmor Oct 14, 2022
c422abd
Add Python 3.11 type offsets
filmor Sep 18, 2022
d6c024c
explicit functions for exact type checks
lostmsu Oct 24, 2022
782a0e5
allow decoders to override conversion of types derived from primitive…
lostmsu Oct 24, 2022
02b6c2f
Merge pull request #1986 from losttech/FloatDerivedCodec
filmor Oct 28, 2022
2b52910
Add Python 3.11 to metadata and workflows
filmor Sep 18, 2022
c0b4eb2
Improve geninterop script to handle new case in 3.11
filmor Sep 19, 2022
cc86068
Fix offsets for 3.11
filmor Sep 19, 2022
5636262
Update requires-python
filmor Oct 15, 2022
8668579
Define slots before initialization
filmor Oct 15, 2022
218610e
fixed positive PyInt converted to negative BigInteger
lostmsu Oct 28, 2022
fb17907
Merge pull request #1993 from losttech/bugs/BadBigInt200
filmor Oct 28, 2022
ddf5a70
Only clear dict if tp_dictoffset > 0
filmor Oct 30, 2022
d3b56ff
Ensure that sub-processes in tests use the same runtime settings
filmor Oct 30, 2022
a6efeae
Update MaxSupportedVersion
filmor Oct 30, 2022
da082ac
Enforce tp_traverse/clear in AllocateTypeObject
filmor Oct 30, 2022
e9283e3
Ensure that Python is initialized before probing properties
br-sk Oct 31, 2022
cc97b8a
Add an Action variant of TryUsingDll
filmor Nov 1, 2022
096f50a
Adjust code a bit and skip PythonHome tests for empty strings
filmor Nov 2, 2022
461c9c7
Add tests for deriving a Python subclass from a generic interface
filmor Nov 2, 2022
15e2e95
Set PYTHONHOME for tests
filmor Nov 2, 2022
6968d01
Merge pull request #1955 from filmor/python-3.11
filmor Nov 2, 2022
cc364c3
Update changelog and add Python 3.11 to metadata
filmor Nov 2, 2022
5c1e02f
fixed resolution of generic methods in Python implementations
lostmsu Nov 2, 2022
cfe1585
Merge pull request #1998 from filmor/fix-derived-generic-interface
filmor Nov 2, 2022
e28dd80
Release 3.0.1
filmor Nov 2, 2022
354317a
Merge commit 'e28dd80c3a8fb60bd62671b765ff41c98ac5b1e9' into update-p…
BadSingleton May 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Documentation

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Doxygen Action
uses: mattnotmitt/doxygen-action@1.9.4
with:
working-directory: "doc/"

- name: Build Sphinx documentation
run: |
pip install -r doc/requirements.txt
sphinx-build doc/source/ ./doc/build/html/

- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v1
with:
path: doc/build/html/

deploy:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
8 changes: 5 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [windows, ubuntu, macos]
python: ["3.7", "3.8", "3.9", "3.10"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
platform: [x64, x86]
exclude:
- os: ubuntu
Expand Down Expand Up @@ -54,15 +54,17 @@ jobs:
run: |
pip install -v .

- name: Set Python DLL path (non Windows)
- name: Set Python DLL path and PYTHONHOME (non Windows)
if: ${{ matrix.os != 'windows' }}
run: |
echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV
echo PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV

- name: Set Python DLL path (Windows)
- name: Set Python DLL path and PYTHONHOME (Windows)
if: ${{ matrix.os == 'windows' }}
run: |
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(python -m find_libpython)"
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONHOME=$(python -c 'import sys; print(sys.prefix)')"

- name: Embedding tests
run: dotnet test --runtime any-${{ matrix.platform }} --logger "console;verbosity=detailed" src/embed_tests/
Expand Down
47 changes: 46 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].

### Added

### Changed

### Fixed

## [3.0.1](https://github.com/pythonnet/pythonnet/releases/tag/v3.0.1) - 2022-11-03

### Added

- Support for Python 3.11

### Changed

- Allow decoders to override conversion of types derived from primitive types

### Fixed

- Fixed objects leaking when Python attached event handlers to them even if they were later removed
- Fixed `PyInt` conversion to `BigInteger` and `System.String` produced incorrect result for values between 128 and 255.
- Fixed implementing a generic interface with a Python class


## [3.0.0](https://github.com/pythonnet/pythonnet/releases/tag/v3.0.0) - 2022-09-29

### Added

- Ability to instantiate new .NET arrays using `Array[T](dim1, dim2, ...)` syntax
- Python operator method will call C# operator method for supported binary and unary operators ([#1324][p1324]).
- Add GetPythonThreadID and Interrupt methods in PythonEngine
Expand Down Expand Up @@ -67,6 +92,9 @@ or the DLL must be loaded in advance. This must be done before calling any other
- BREAKING: disabled implicit conversion from C# enums to Python `int` and back.
One must now either use enum members (e.g. `MyEnum.Option`), or use enum constructor
(e.g. `MyEnum(42)` or `MyEnum(42, True)` when `MyEnum` does not have a member with value 42).
- BREAKING: disabled implicit conversion from Python objects implementing sequence protocol to
.NET arrays when the target .NET type is `System.Object`. The conversion is still attempted when the
target type is a `System.Array`.
- Sign Runtime DLL with a strong name
- Implement loading through `clr_loader` instead of the included `ClrModule`, enables
support for .NET Core
Expand Down Expand Up @@ -131,7 +159,24 @@ There is no need to specify it.
- support for .NET Framework 4.0-4.6; Mono before 5.4. Python.NET now requires .NET Standard 2.0
(see [the matrix](https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support))

## [2.5.0][] - 2020-06-14
## [2.5.2](https://github.com/pythonnet/pythonnet/releases/tag/v2.5.2) - 2021-02-05

Bugfix release.

### Fixed
- Fix `object[]` parameters taking precedence when should not in overload resolution
- Empty parameter names (as can be generated from F#) do not cause crashes

## [2.5.1](https://github.com/pythonnet/pythonnet/releases/tag/v2.5.1) - 2020-06-18

Bugfix release.

### Fixed

- Fix incorrect dereference of wrapper object in `tp_repr`, which may result in a program crash
- Fix incorrect dereference in params array handling

## [2.5.0](https://github.com/pythonnet/pythonnet/releases/tag/v2.5.0) - 2020-06-14

This version improves performance on benchmarks significantly compared to 2.3.

Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyProduct>Python.NET</AssemblyProduct>
<LangVersion>10.0</LangVersion>
<IsPackable>false</IsPackable>
<FullVersion>$([System.IO.File]::ReadAllText($(MSBuildThisFileDirectory)version.txt))</FullVersion>
<FullVersion>$([System.IO.File]::ReadAllText("$(MSBuildThisFileDirectory)version.txt").Trim())</FullVersion>
<VersionPrefix>$(FullVersion.Split('-', 2)[0])</VersionPrefix>
<VersionSuffix Condition="$(FullVersion.Contains('-'))">$(FullVersion.Split('-', 2)[1])</VersionSuffix>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
graft src/runtime
prune src/runtime/obj
prune src/runtime/bin
include src/pythonnet.snk
include Directory.Build.*
include pythonnet.sln
include version.txt
26 changes: 21 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ provides a powerful application scripting tool for .NET developers. It
allows Python code to interact with the CLR, and may also be used to
embed Python into a .NET application.

.. note::
The master branch of this repository tracks the ongoing development of version 3.0.
Backports of patches to 2.5 are tracked in the
`backports-2.5 branch <https://github.com/pythonnet/pythonnet/tree/backports-2.5>`_.

Calling .NET code from Python
-----------------------------

Expand All @@ -42,6 +37,25 @@ module:
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Form

By default, Mono will be used on Linux and macOS, .NET Framework on Windows. For
details on the loading of different runtimes, please refer to the documentation.

.NET Core
~~~~~~~~~

If .NET Core is installed in a default location or the ``dotnet`` CLI tool is on
the ``PATH``, loading it instead of the default (Mono/.NET Framework) runtime
just requires setting either the environment variable
``PYTHONNET_RUNTIME=coreclr`` or calling ``pythonnet.load`` explicitly:

.. code-block:: python

from pythonnet import load
load("coreclr")

import clr


Embedding Python in .NET
------------------------

Expand All @@ -50,6 +64,8 @@ Embedding Python in .NET
(internal, derived from ``MissingMethodException``) upon calling ``Initialize``.
Typical values are ``python38.dll`` (Windows), ``libpython3.8.dylib`` (Mac),
``libpython3.8.so`` (most other Unix-like operating systems).
- Then call ``PythonEngine.Initialize()``. If you plan to use Python objects from
multiple threads, also call ``PythonEngine.BeginAllowThreads()``.
- All calls to python should be inside a
``using (Py.GIL()) {/* Your code here */}`` block.
- Import python modules using ``dynamic mod = Py.Import("mod")``, then
Expand Down
2 changes: 2 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
doxygen_xml/
build/
Loading