Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Modernisation#1015

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
filmor wants to merge22 commits intomasterfrommodernisation
Closed

Modernisation#1015

filmor wants to merge22 commits intomasterfrommodernisation

Conversation

@filmor
Copy link
Member

Ongoing development to get to a .NET Standard only, platform-independent and Python version agnostic version of Python.NET that runs on .NET Framework, .NET Core and Mono (and hopefully also the respective AoT variants).

mikofski reacted with thumbs up emoji
Drops also- Custom XDecref/XIncref (should be readded)- Remote object handling for .NET Framework
Contrary to what I said before, I don't think trying to providea single DLL for Python 2 and 3. We will in the future defaultto Python 3, and if someone really wants Python 2, for a whilewe will support a separate compile configuration for that.
@Jeff17Robbins
Copy link
Contributor

Is the intention to only support Python3.8?

@filmor
Copy link
MemberAuthor

The intention is to support at least all Python 3 versions from 3.5 onwards. The Python (3) API and ABI is mostly backwards-compatible for our purposes. The one comment on Python 3.8 just refers tohttps://docs.python.org/3/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build, which allows us to use the exact same build even for Debug Pythons from 3.8 onwards.

@Jeff17Robbins
Copy link
Contributor

How can a singleinterop3.cs work across disparate Python 3 releases?

As#995 demonstrated, the Python team continues to change the internals ofstruct PyObject, with potential impact on Python.NET, so I'm assuming we need to keep version-dependentinterop3[n].cs files?

@filmor
Copy link
MemberAuthor

@Jeff17Robbins No, it didn't change. The problem was that they changed the /meaning/ of one of the slots and it now used a different type (same size, though). The structure as such hasn't changed in the Python 3 line, just reusage of deprecated slots and addition of new ones at the end.

@Jeff17Robbins
Copy link
Contributor

Jeff17Robbins commentedDec 17, 2019
edited
Loading

@filmor I think it actually did change.

You are correct that the new fieldPy_ssize_t tp_vectorcall_offset; (represented ininterop38.cs aspublic static int tp_vectorcall_offset = 0;) simply overwroteprintfunc tp_print (represented ininterop37.cs aspublic static int tp_print = 0;

But, they also added two new fields right aftertp_finalize:

vectorcallfunc tp_vectorcall;/* bpo-37250: kept for backwards compatibility in CPython 3.8 only */Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);

These two new fields change all the offsets of the fields that are defined after them. The structure thusis a different size, and fields we care about, likeht_qualname (akaqualname) has a different offset in Python3.8 as compared to Python3.7.

If you diffinterop37.cs withinterop38.cs, you'll see these two new fields:

        public static int tp_vectorcall = 0;        public static int tp_print = 0;

@filmor
Copy link
MemberAuthor

Meh. Ah well, I'll add this back in due time, but probably in form of a hash-table that is stored in a resource stream instead of autogenerated code. Thanks for the hint :)

@Jeff17Robbins
Copy link
Contributor

Maybe we can create some kind of "sanity check" on the automated process that generates the hash-table to make sure thatgeninterop.py captured all the fields from the C struct definitions? It is a crucial, yet somewhat fragile, step of the process.

@zivillian
Copy link

I looked at this branch today and it is currently broken for VS2019.

Even after adding the missing projects to the .sln and fixing the Project SDK

-<Project Sdk="Microsoft.NET.Test.Sdk">+<Project Sdk="Microsoft.NET.Sdk">

it throws errors about missing properties and methods like

Python.Runtime.Runtime.pyversionPython.Runtime.Runtime.MachinePython.Runtime.Runtime.MachineNamePython.Runtime.Runtime.OperatingSystemPython.Runtime.Runtime.OperatingSystemNamePython.Runtime.Runtime.Py_Initialize()

Am I looking at the incorrect source, or is there anything missing?

@lostmsu
Copy link
Member

@filmor btw, I think this could take advantage of#1043

@filmorfilmor mentioned this pull requestApr 13, 2020
4 tasks
@filmorfilmor closed thisJan 29, 2021
@filmorfilmor deleted the modernisation branchJanuary 29, 2021 06:56
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@filmor@Jeff17Robbins@zivillian@lostmsu

[8]ページ先頭

©2009-2026 Movatter.jp