8000 Merge branch 'master' into pybuffer2 · pythonnet/pythonnet@abf957f · GitHub
[go: up one dir, main page]

Skip to content

Commit abf957f

Browse files
authored
Merge branch 'master' into pybuffer2
2 parents 530e8c7 + de7c7c2 commit abf957f

File tree

136 files changed

+5448
-3231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+5448
-3231
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 29 deletions
This file was deleted.

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ python:
55
- 3.8
66
- 3.7
77
- 3.6
8-
- 3.5
9-
- 2.7
108

119
env:
1210
matrix:
1311
- BUILD_OPTS=--xplat NUNIT_PATH="~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe" RUN_TESTS=dotnet EMBED_TESTS_PATH=netcoreapp2.0_publish/ PERF_TESTS_PATH=net461/
1412
- BUILD_OPTS="" NUNIT_PATH="./packages/NUnit.*/tools/nunit3-console.exe" RUN_TESTS="mono $NUNIT_PATH" EMBED_TESTS_PATH="" PERF_TESTS_PATH=""
13+
- PYTHONNET_SHUTDOWN_MODE="Soft" BUILD_OPTS=--xplat NUNIT_PATH="~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe" RUN_TESTS=dotnet EMBED_TESTS_PATH=netcoreapp2.0_publish/ PERF_TESTS_PATH=net461/
14+
- PYTHONNET_SHUTDOWN_MODE="Soft" BUILD_OPTS="" NUNIT_PATH="./packages/NUnit.*/tools/nunit3-console.exe" RUN_TESTS="mono $NUNIT_PATH" EMBED_TESTS_PATH="" PERF_TESTS_PATH=""
1515

1616
global:
1717
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so

AUTHORS.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
## Development Lead
44

5-
- Barton Cline ([@BartonCline](https://github.com/BartonCline))
65
- Benedikt Reinartz ([@filmor](https://github.com/filmor))
6+
- Victor Milovanov ([@lostmsu](https://github.com/lostmsu))
7+
8+
## Former Development Leads
9+
- Barton Cline ([@BartonCline](https://github.com/BartonCline))
710
- Brian Lloyd ([@brianlloyd](https://github.com/brianlloyd))
811
- David Anthoff ([@davidanthoff](https://github.com/davidanthoff))
912
- Denis Akhiyarov ([@denfromufa](https://github.com/denfromufa))
@@ -17,19 +20,22 @@
1720
- Alexandre Catarino([@AlexCatarino](https://github.com/AlexCatarino))
1821
- Andrey Sant'Anna ([@andreydani](https://github.com/andreydani))
1922
- Arvid JB ([@ArvidJB](https://github.com/ArvidJB))
23+
- Avinash Maddikonda ([@SFM61319](https://github.com/SFM61319))
2024
- Benoît Hudson ([@benoithudson](https://github.com/benoithudson))
2125
- Bradley Friedman ([@leith-bartrich](https://github.com/leith-bartrich))
2226
- Callum Noble ([@callumnoble](https://github.com/callumnoble))
2327
- Christian Heimes ([@tiran](https://github.com/tiran))
2428
- Christoph Gohlke ([@cgohlke](https://github.com/cgohlke))
2529
- Christopher Bremner ([@chrisjbremner](https://github.com/chrisjbremner))
2630
- Christopher Pow ([@christopherpow](https://github.com/christopherpow))
31+
10000 - Daniel Abrahamsson ([@danabr](https://github.com/danabr))
2732
- Daniel Fernandez ([@fdanny](https://github.com/fdanny))
2833
- Daniel Santana ([@dgsantana](https://github.com/dgsantana))
2934
- Dave Hirschfeld ([@dhirschfeld](https://github.com/dhirschfeld))
3035
- David Lassonde ([@lassond](https://github.com/lassond))
3136
- David Lechner ([@dlech](https://github.com/dlech))
3237
- Dmitriy Se ([@dmitriyse](https://github.com/dmitriyse))
38+
- Félix Bourbonnais ([@BadSingleton](https://github.com/BadSingleton))
3339
- Florian Treurniet ([@ftreurni](https://github.com/ftreurni))
3440
- He-chien Tsai ([@t3476](https://github.com/t3476))
3541
- Inna Wiesel ([@inna-w](https://github.com/inna-w))
@@ -54,14 +60,14 @@
5460
- Sean Freitag ([@cowboygneox](https://github.com/cowboygneox))
5561
- Serge Weinstock ([@sweinst](https://github.com/sweinst))
5662
- Simon Mourier ([@smourier](https://github.com/smourier))
57-
- Victor Milovanov ([@lostmsu](https://github.com/lostmsu))
5863
- Viktoria Kovescses ([@vkovec](https://github.com/vkovec))
5964
- Ville M. Vainio ([@vivainio](https://github.com/vivainio))
6065
- Virgil Dupras ([@hsoft](https://github.com/hsoft))
6166
- Wenguang Yang ([@yagweb](https://github.com/yagweb))
6267
- William Sardar ([@williamsardar])(https://github.com/williamsardar)
6368
- Xavier Dupré ([@sdpython](https://github.com/sdpython))
6469
- Zane Purvis ([@zanedp](https://github.com/zanedp))
70+
- ([@amos402]https://github.com/amos402)
6571
- ([@bltribble](https://github.com/bltribble))
6672
- ([@civilx64](https://github.com/civilx64))
6773
- ([@GSPP](https://github.com/GSPP))
@@ -72,4 +78,5 @@
7278
- ([@SnGmng](https://github.com/SnGmng))
7379
- ([@stonebig](https://github.com/stonebig))
7480
- ([@testrunner123](https://github.com/testrunner123))
75-
81+
- ([@DanBarzilian](https://github.com/DanBarzilian))
82+
- ([@alxnull](https://github.com/alxnull))

CHANGELOG.md

Lines changed: 68 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,92 @@
11
# Changelog
22

3-
All notable changes to Python for .NET will be documented in this file.
4-
This project adheres to [Semantic Versioning][].
3+
All notable changes to Python.NET will be documented in this file. This
4+
project adheres to [Semantic Versioning][].
55

66
This document follows the conventions laid out in [Keep a CHANGELOG][].
77

8-
## [unreleased][]
8+
## [Unreleased][]
99

1010
### Added
11+
- Added Python 3 buffer api support and PyBuffer interface for fast byte and numpy array read/write ([#980][p980])
12+
13+
### Changed
14+
- Drop support for Python 2, 3.4, and 3.5
15+
- `clr.AddReference` may now throw errors besides `FileNotFoundException`, that provide more
16+
details about the cause of the failure
17+
- `clr.AddReference` no longer adds ".dll" implicitly
18+
- `PyIter(PyObject)` constructor replaced with static `PyIter.GetIter(PyObject)` method
19+
- Return values from .NET methods that return an interface are now automatically
20+
wrapped in that interface. This is a breaking change for users that rely on being
21+
able to access members that are part of the implementation class, but not the
22+
interface. Use the new __implementation__ or __raw_implementation__ properties to
23+
if you need to "downcast" to the implementation class.
24+
25+
### Fixed
26+
27+
- Fix incorrect dereference of wrapper object in `tp_repr`, which may result in a program crash
28+
- Fix incorrect dereference in params array handling
29+
- Fix `object[]` parameters taking precedence when should not in overload resolution
30+
- Fixed a bug where all .NET class instances were considered Iterable
31+
- Fix incorrect choice of method to invoke when using keyword arguments.
32+
- Fix non-delegate types incorrectly appearing as callable.
33+
- Indexers can now be used with interface objects
34+
- Fixed a bug where indexers could not be used if they were inherited
35+
- Made it possible to use `__len__` also on `ICollection<>` interface objects
1136

12-
- Added automatic NuGet package generation in appveyor and local builds
13-
- Added function that sets Py_NoSiteFlag to 1.
14-
- Added support for Jetson Nano.
15-
- Added support for __len__ for .NET classes that implement ICollection
16-
- Added `PyExport` attribute to hide .NET types from Python
17-
- Added PythonException.Format method to format exceptions the same as traceback.format_exception
18-
- Added Runtime.None to be able to pass None as parameter into Python from .NET
19-
- Added PyObject.IsNone() to check if a Python object is None in .NET.
37+
## [2.5.0][] - 2020-06-14
38+
39+
This version improves performance on benchmarks significantly compared to 2.3.
40+
41+
### Added
42+
43+
- Automatic NuGet package generation in appveyor and local builds
44+
- Function that sets `Py_NoSiteFlag` to 1.
45+
- Support for Jetson Nano.
46+
- Support for `__len__` for .NET classes that implement ICollection
47+
- `PyExport` attribute to hide .NET types from Python
48+
- `PythonException.Format` method to format exceptions the same as
49+
`traceback.format_exception`
50+
- `Runtime.None` to be able to pass `None` as parameter into Python from .NET
51+
- `PyObject.IsNone()` to check if a Python object is None in .NET.
2052
- Support for Python 3.8
21-
- Added Python 3 buffer api support and PyBuffer interface for fast byte and numpy array read/write ([#980][p980])
53+
- Codecs as the designated way to handle automatic conversions between
54+
.NET and Python types
2255

2356
### Changed
2457

2558
- Added argument types information to "No method matches given arguments" message
2659
- Moved wheel import in setup.py inside of a try/except to prevent pip collection failures
27-
- Removes PyLong_GetMax and PyClass_New when targetting Python3
60+
- Removes `PyLong_GetMax` and `PyClass_New` when targetting Python3
2861
- Improved performance of calls from Python to C#
2962
- Added support for converting python iterators to C# arrays
30-
- Changed usage of obselete function GetDelegateForFunctionPointer(IntPtr, Type) to GetDelegateForFunctionPointer<TDelegate>(IntPtr)
31-
- When calling C# from Python, enable passing argument of any type to a parameter of C# type `object` by wrapping it into `PyObject` instance. ([#881][i881])
63+
- Changed usage of the obsolete function
64+
`GetDelegateForFunctionPointer(IntPtr, Type)` to
65+
`GetDelegateForFunctionPointer<TDelegate>(IntPtr)`
66+
- When calling C# from Python, enable passing argument of any type to a
67+
parameter of C# type `object` by wrapping it into `PyObject` instance.
68+
([#881][i881])
3269
- Added support for kwarg parameters when calling .NET methods from Python
3370
- Changed method for finding MSBuild using vswhere
34-
- Reworked `Finalizer`. Now objects drop into its queue upon finalization, which is periodically drained when new objects are created.
35-
- Marked `Runtime.OperatingSystemName` and `Runtime.MachineName` as `Obsolete`, should never have been `public` in the first place. They also don't necessarily return a result that matches the `platform` module's.
71+
- Reworked `Finalizer`. Now objects drop into its queue upon finalization,
72+
which is periodically drained when new objects are created.
73+
- Marked `Runtime.OperatingSystemName` and `Runtime.MachineName` as
74+
`Obsolete`, should never have been `public` in the first place. They also
75+
don't necessarily return a result that matches the `platform` module's.
76+
- Unconditionally depend on `pycparser` for the interop module generation
3677

3778
### Fixed
3879

39-
- Fixed runtime that fails loading when using pythonnet in an environment
40-
together with Nuitka
41-
- Fixes bug where delegates get casts (dotnetcore)
42-
- Determine size of interpreter longs at runtime
43-
- Handling exceptions ocurred in ModuleObject's getattribute
44-
- Fill `__classcell__` correctly for Python subclasses of .NET types
45-
- Fixed issue with params methods that are not passed an array.
80+
- Fixed runtime that fails loading when using pythonnet in an environment
81+
together with Nuitka
82+
- Fixes bug where delegates get casts (dotnetcore)
83+
- Determine size of interpreter longs at runtime
84+
- Handling exceptions ocurred in ModuleObject's getattribute
85+
- Fill `__classcell__` correctly for Python subclasses of .NET types
86+
- Fixed issue with params methods that are not passed an array.
87+
- Use UTF8 to encode strings passed to `PyRun_String` on Python 3
4688

47-
## [2.4.0][]
89+
## [2.4.0][] - 2019-05-15
4890

4991
### Added
5092

@@ -72,6 +114,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
72114
- PythonEngine.Intialize will now call `Py_InitializeEx` with a default value of 0, so signals will not be configured by default on embedding. This is different from the previous behaviour, where `Py_Initialize` was called instead, which sets initSigs to 1. ([#449][i449])
73115
- Refactored MethodBinder.Bind in preparation to make it extensible (#829)
74116
- Look for installed Windows 10 sdk's during installation instead of relying on specific versions.
117+
- Remove `LoadLibrary` call. ([#880][p880])
75118

76119
### Fixed
77120

CONTRIBUTING.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# How to contribute
22

3-
PythonNet is developed and maintained by unpaid community members so well
3+
Python.NET is developed and maintained by unpaid community members so well
44
written, documented and tested pull requests are encouraged.
55

66
By submitting a pull request for this project, you agree to license your
77
contribution under the MIT license to this project.
88

9+
This project has adopted the code of conduct defined by the Contributor
10+
Covenant to clarify expected behavior in our community. For more information
11+
see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
12+
913
## Getting Started
1014

1115
- Make sure you have a [GitHub account](https://github.com/signup/free)
@@ -41,3 +45,4 @@ contribution under the MIT license to this project.
4145

4246
- [General GitHub documentation](https://help.github.com/)
4347
- [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
48+
- [.NET Foundation Code of Conduct](https://dotnetfoundation.org/about/code-of-conduct)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2006-2019 the contributors of the "Python for .NET" project
3+
Copyright (c) 2006-2020 the contributors of the Python.NET project
44

55
Permission is hereby granted, free of charge, to any person obtaining a
66
copy of this software and associated documentation files (the "Software"),

README.rst

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pythonnet - Python for .NET
1+
pythonnet - Python.NET
22
===========================
33

44
|Join the chat at https://gitter.im/pythonnet/pythonnet|
@@ -8,19 +8,23 @@ pythonnet - Python for .NET
88
|license shield| |pypi package version| |conda-forge version| |python supported shield|
99
|stackexchange shield|
1010

11-
Python for .NET is a package that gives Python programmers nearly
11+
Python.NET is a package that gives Python programmers nearly
1212
seamless integration with the .NET Common Language Runtime (CLR) and
1313
provides a powerful application scripting tool for .NET developers. It
1414
allows Python code to interact with the CLR, and may also be used to
1515
embed Python into a .NET application.
1616

17+
.. note::
18+
The master branch of this repository tracks the ongoing development of version 3.0.
19+
Backports of patches to 2.5 are tracked in the
20+
`backports-2.5 branch <https://github.com/pythonnet/pythonnet/tree/backports-2.5>`_.
21+
1722
Calling .NET code from Python
1823
-----------------------------
1924

20-
Python for .NET allows CLR namespaces to be treated essentially as
21-
Python packages.
25+
Python.NET allows CLR namespaces to be treated essentially as Python packages.
2226

23-
.. code-block::
27+
.. code-block:: python
2428
2529
import clr
2630
from System import String
@@ -29,7 +33,7 @@ Python packages.
2933
To load an assembly, use the ``AddReference`` function in the ``clr``
3034
module:
3135

32-
.. code-block::
36+
.. code-block:: python
3337
3438
import clr
3539
clr.AddReference("System.Windows.Forms")
@@ -81,7 +85,7 @@ Example
8185
8286
Output:
8387

84-
.. code::
88+
.. code:: csharp
8589
8690
1.0
8791
-0.958924274663
@@ -90,18 +94,24 @@ Output:
9094
int32
9195
[ 6. 10. 12.]
9296
97+
98+
99+
Resources
100+
---------
101+
93102
Information on installation, FAQ, troubleshooting, debugging, and
94103
projects using pythonnet can be found in the Wiki:
95104

96105
https://github.com/pythonnet/pythonnet/wiki
97106

98-
Python 3.8.0 support
99-
--------------------
107+
Mailing list
108+
https://mail.python.org/mailman/listinfo/pythondotnet
109+
Chat
110+
https://gitter.im/pythonnet/pythonnet
100111

101-
Some features are disabled in Python 3.8.0 because of
102-
`this bug in Python <https://bugs.python.org/issue37633>`_. The error is
103-
``System.EntryPointNotFoundException : Unable to find an entry point named
104-
'Py_CompileString' in DLL 'python38'``. This will be fixed in Python 3.8.1.
112+
.NET Foundation
113+
---------------
114+
This project is supported by the `.NET Foundation <https://dotnetfoundation.org>`_.
105115

106116
.. |Join the chat at https://gitter.im/pythonnet/pythonnet| image:: https://badges.gitter.im/pythonnet/pythonnet.svg
107117
:target: https://gitter.im/pythonnet/pythonnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
@@ -121,8 +131,3 @@ Some features are disabled in Python 3.8.0 because of
121131
:target: http://stackoverflow.com/questions/tagged/python.net
122132
.. |conda-forge version| image:: https://img.shields.io/conda/vn/conda-forge/pythonnet.svg
123133
:target: https://anaconda.org/conda-forge/pythonnet
124-
125-
Resources
126-
---------
127-
Mailing list: https://mail.python.org/mailman/listinfo/pythondotnet
128-
Chat: https://gitter.im/pythonnet/pythonnet

0 commit comments

Comments
 (0)
0