Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44d65d9

Browse files
committed
merge latest master
2 parents a3591b6 + b7e8fdc commit 44d65d9

33 files changed

+399
-316
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131

3232
- name: Setup .NET
3333
uses: actions/setup-dotnet@v1
34+
with:
35+
dotnet-version: '6.0.x'
3436

3537
- name: Set up Python ${{ matrix.python }}
3638
uses: actions/setup-python@v2

.github/workflows/nuget-preview.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525

2626
- name: Setup .NET
2727
uses: actions/setup-dotnet@v1
28+
with:
29+
dotnet-version: '6.0.x'
2830

2931
- name: Set up Python 3.8
3032
uses: actions/setup-python@v2

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
12-
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.0.0-5.final">
12+
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.0.1">
1313
<PrivateAssets>all</PrivateAssets>
1414
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
1515
</PackageReference>

README.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pythonnet - Python.NET
33

44
|Join the chat at https://gitter.im/pythonnet/pythonnet| |stackexchange shield|
55

6-
|gh shield| |appveyor shield|
6+
|gh shield|
77

88
|license shield|
99

@@ -49,7 +49,7 @@ Embedding Python in .NET
4949
starting with version 3.0, otherwise you will receive ``BadPythonDllException``
5050
(internal, derived from ``MissingMethodException``) upon calling ``Initialize``.
5151
Typical values are ``python38.dll`` (Windows), ``libpython3.8.dylib`` (Mac),
52-
``libpython3.8.so`` (most other *nix).
52+
``libpython3.8.so`` (most other Unix-like operating systems).
5353
- All calls to python should be inside a
5454
``using (Py.GIL()) {/* Your code here */}`` block.
5555
- Import python modules using ``dynamic mod = Py.Import("mod")``, then
@@ -123,12 +123,6 @@ This project is supported by the `.NET Foundation <https://dotnetfoundation.org>
123123

124124
.. |Join the chat at https://gitter.im/pythonnet/pythonnet| image:: https://badges.gitter.im/pythonnet/pythonnet.svg
125125
:target: https://gitter.im/pythonnet/pythonnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
126-
.. |appveyor shield| image:: https://img.shields.io/appveyor/ci/pythonnet/pythonnet/master.svg?label=AppVeyor
127-
:target: https://ci.appveyor.com/project/pythonnet/pythonnet/branch/master
128-
.. |travis shield| image:: https://img.shields.io/travis/pythonnet/pythonnet/master.svg?label=Travis
129-
:target: https://travis-ci.org/pythonnet/pythonnet
130-
.. |codecov shield| image:: https://img.shields.io/codecov/c/github/pythonnet/pythonnet/master.svg?label=Codecov
131-
:target: https://codecov.io/github/pythonnet/pythonnet
132126
.. |license shield| image:: https://img.shields.io/badge/license-MIT-blue.svg?maxAge=3600
133127
:target: ./LICENSE
134128
.. |pypi package version| image:: https://img.shields.io/pypi/v/pythonnet.svg

pythonnet.sln

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 16
3-
VisualStudioVersion = 16.0.30717.126
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.0.31912.275
44
MinimumVisualStudioVersion = 15.0.26124.0
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.Runtime", "src\runtime\Python.Runtime.csproj", "{4E8C8FE2-0FB8-4517-B2D9-5FB2D5FC849B}"
66
EndProject
@@ -25,9 +25,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repo", "Repo", "{441A0123-F
2525
EndProject
2626
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CI", "CI", "{D301657F-5EAF-4534-B280-B858D651B2E5}"
2727
ProjectSection(SolutionItems) = preProject
28-
appveyor.yml = appveyor.yml
29-
ci\appveyor_build_recipe.ps1 = ci\appveyor_build_recipe.ps1
30-
ci\appveyor_run_tests.ps1 = ci\appveyor_run_tests.ps1
3128
.github\workflows\main.yml = .github\workflows\main.yml
3229
.github\workflows\nuget-preview.yml = .github\workflows\nuget-preview.yml
3330
EndProjectSection
@@ -37,13 +34,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
3734
setup.py = setup.py
3835
EndProjectSection
3936
EndProject
40-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "conda.recipe", "conda.recipe", "{7FD2404D-0CE8-4645-8DFB-766470E2150E}"
41-
ProjectSection(SolutionItems) = preProject
42-
conda.recipe\bld.bat = conda.recipe\bld.bat
43-
conda.recipe\meta.yaml = conda.recipe\meta.yaml
44-
conda.recipe\README.md = conda.recipe\README.md
45-
EndProjectSection
46-
EndProject
4737
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{BC426F42-8494-4AA5-82C9-5109ACD97BD1}"
4838
ProjectSection(SolutionItems) = preProject
4939
tools\geninterop\geninterop.py = tools\geninterop\geninterop.py
@@ -90,18 +80,6 @@ Global
9080
{E6B01706-00BA-4144-9029-186AC42FBE9A}.Release|x64.Build.0 = Release|x64
9181
{E6B01706-00BA-4144-9029-186AC42FBE9A}.Release|x86.ActiveCfg = Release|x86
9282
{E6B01706-00BA-4144-9029-186AC42FBE9A}.Release|x86.Build.0 = Release|x86
93-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
94-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
95-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Debug|x64.ActiveCfg = Debug|Any CPU
96-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Debug|x64.Build.0 = Debug|Any CPU
97-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Debug|x86.ActiveCfg = Debug|Any CPU
98-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Debug|x86.Build.0 = Debug|Any CPU
99-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
100-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Release|Any CPU.Build.0 = Release|Any CPU
101-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Release|x64.ActiveCfg = Release|Any CPU
102-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Release|x64.Build.0 = Release|Any CPU
103-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Release|x86.ActiveCfg = Release|Any CPU
104-
{F9F5FA13-BC52-4C0B-BC1C-FE3C0B8FCCDD}.Release|x86.Build.0 = Release|Any CPU
10583
{819E089B-4770-400E-93C6-4F7A35F0EA12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
10684
{819E089B-4770-400E-93C6-4F7A35F0EA12}.Debug|Any CPU.Build.0 = Debug|Any CPU
10785
{819E089B-4770-400E-93C6-4F7A35F0EA12}.Debug|x64.ActiveCfg = Debug|Any CPU

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
PY_MAJOR = sys.version_info[0]
1212
PY_MINOR = sys.version_info[1]
1313

14+
# Disable SourceLink during the build until it can read repo-format v1, #1613
15+
os.environ["EnableSourceControlManagerQueries"] = "false"
1416

1517
class DotnetLib:
1618
def __init__(self, name, path, **kwargs):
@@ -154,6 +156,7 @@ def finalize_options(self):
154156
packages=["pythonnet", "pythonnet.find_libpython"],
155157
install_requires=["clr_loader"],
156158
long_description=long_description,
159+
long_description_content_type="text/x-rst",
157160
py_modules=["clr"],
158161
dotnet_libs=dotnet_libs,
159162
classifiers=[

src/console/Console.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
3+
<TargetFrameworks>net472;net6.0</TargetFrameworks>
44
<Platforms>x64;x86</Platforms>
55
<OutputType>Exe</OutputType>
66
<AssemblyName>nPython</AssemblyName>

src/embed_tests/Codecs.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,18 @@ public PyObject TryEncode(object value)
421421
}
422422
}
423423

424-
class InstancelessExceptionDecoder : IPyObjectDecoder
424+
class InstancelessExceptionDecoder : IPyObjectDecoder, IDisposable
425425
{
426426
readonly PyObject PyErr = Py.Import("clr.interop").GetAttr("PyErr");
427427

428428
public bool CanDecode(PyType objectType, Type targetType)
429429
=> PythonReferenceComparer.Instance.Equals(PyErr, objectType);
430430

431+
public void Dispose()
432+
{
433+
PyErr.Dispose();
434+
}
435+
431436
public bool TryDecode<T>(PyObject pyObj, out T value)
432437
{
433438
if (pyObj.HasAttr("value"))

src/embed_tests/GlobalTestsSetup.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ namespace Python.EmbeddingTest
99
[SetUpFixture]
1010
public partial class GlobalTestsSetup
1111
{
12+
[OneTimeSetUp]
13+
public void GlobalSetup()
14+
{
15+
Finalizer.Instance.ErrorHandler += FinalizerErrorHandler;
16+
}
17+
18+
private void FinalizerErrorHandler(object sender, Finalizer.ErrorArgs e)
19+
{
20+
if (e.Error is RuntimeShutdownException)
21+
{
22+
// allow objects to leak after the python runtime run
23+
// they were created in is gone
24+
e.Handled = true;
25+
}
26+
}
27+
1228
[OneTimeTearDown]
1329
public void FinalCleanup()
1430
{

src/embed_tests/Inheritance.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public void SetUp()
2424
[OneTimeTearDown]
2525
public void Dispose()
2626
{
27+
ExtraBaseTypeProvider.ExtraBase.Dispose();
2728
PythonEngine.Shutdown();
2829
}
2930

0 commit comments

Comments
 (0)