forked from pythonnet/pythonnet
- Notifications
You must be signed in to change notification settings - Fork 9
Modernize import hook#13
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
Draft
BadSingleton wants to merge 163 commits into upstreamChoose a base branch from modernize-import-hook
base:upstream
Could not load branches
Branch not found: {{refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading. Please reload this page.
Draft
Changes from all commits
Commits
Show all changes
163 commits Select commit Hold shift + click to select a range
663df73 reworked PythonException to simplify memory management, and enable .N…
lostmsu d45c39a allows codecs to encode and decode thrown exceptions
lostmsu 0d941c5 turned on CLR exception marshaling
lostmsu 02cd234 revert to C# 7.3
lostmsu defb200 fixed Restore when not all exception fields are set
lostmsu 945dc85 cleaned PythonException code up a bit
lostmsu 3d95e60 remove unused overloads of FromPyErr
lostmsu d667998 capture exception on Exceptions.SetError, restore in ThrowLastAsClrEx…
lostmsu bec8b7d fixed failure in ExceptionEncoded test case caused by ExceptionDispat…
lostmsu 0961c94 added tests for __cause__/InnerException #893 #1098
lostmsu 2cd8627 introduced StolenReference type
lostmsu e4c1b9b prevent undebuggable StackOverflowException during exception interop
lostmsu 81cd197 Merge branch 'master' into PR/ExceptionsImprovement
lostmsu 3c0b737 README: added summary of new exception handling features
lostmsu 0f33f71 disable implicit conversion from PyFloat to .NET integer types (fixes…
lostmsu 5fd77b1 Add PythonEngine.Interrupt (#1337)
gpetrou 7e7cbca Disable implicit conversion from PyFloat to uint64 (#1362)
tminka 32fdc9c Disable implicit conversion from PyFloat to array index (#1363)
tminka 92932fd Better error messages for method argument mismatch and others (#1361)
tminka 063a674 Added the ability to implement delegates with `ref` and `out` paramet…
tminka 909ed1f dropped net40 target from modern projects
lostmsu 47e926e use .NET Standard 2.0 platform detection features
lostmsu 21683b3 drop NativeCodePage alltogether
lostmsu 972c41d WIP: use C# 9 function pointers for PInvoke
lostmsu 51e5184 allow setting PythonDLL
lostmsu 2498d47 always explicitly specify the way strings are marshaled
lostmsu 70fc803 CI: figure out DLL name from environment
lostmsu 28a5dab use Roslyn preview in CI
lostmsu c75229a fixed Linux and Mac DLL loaders breaking dll path
lostmsu a0a1dc1 correctly detect DLL on *nix when running from Python
lostmsu 1b88783 Windows library loader: add support for hModule == 0
lostmsu 2c1aaef fix dll loading in tests
lostmsu 39e41d0 mentiond PythonDLL in changelog
lostmsu 17040fe set PYDLL in AppVeyor
lostmsu b7410b6 revert automatically added 'm' suffix for *nix default dll name
lostmsu 275cae9 specify full DLL name instead of PYVER in GH Actions
lostmsu b4cb37e use Microsoft.Net.Compilers.Toolset instead of Microsoft.Net.Compilers
lostmsu f68e581 in CI MacOS python DLL has 'm' suffix
lostmsu cda604a only set PYTHONNET_PYDLL for test runs from .NET
lostmsu 3982892 workaround for pytest/clr module not preloading python C API library
lostmsu a6cbe20 addressed a few code comments
lostmsu 9e5887c Merge pull request #1365 from losttech/features/VersionIndependent
lostmsu 1afae4c Fix exception string (#1360)
filmor d86bf3c ParameterInfo.Name needs to be checked for null before usage (#1375)
filmor 6b2347a monthly NuGet release previews (#1381)
lostmsu 4da1954 Sign Runtime DLL with a strong name (#1382)
gpetrou b92d929 Replace clr module by loading through clr_loader
filmor fdb7144 Add Changelog entry
filmor f01a78c Fix domain reload tests and activate them on macOS
filmor 0d7e43a Run tests on .NET Core
filmor 67032ea Vendor System.Drawing.Point for testing on .NET Core
filmor 8bc458b Use approximate comparison for single max/min value comparison
filmor d46fa1e Adjust the import tests to use only commonly available deps
filmor f0011a5 Fix PythonTestRunner to work with new pytest setup
filmor c1a01b7 Drop references to the obsolete call
filmor 6510ff7 Merge pull request #1373 from filmor/clr-loader
filmor fb083bb Adjust setup.py for wheel building
filmor 4c05417 enable manual preview release
lostmsu 132b666 rename nuget preview release workflow
lostmsu 0f5e781 NuGet Preview pipeline changes missed in https://github.com/pythonnet…
lostmsu 1ab9cb1 simplify PyScope by delegating ownership to PyObject instance
lostmsu 707ef36 Lossless encoders for IList<T>, IEnumerable<T> and ICollection<T> (#1…
koubaa d0d7616 ensure interned strings can not be referenced after InternString.Shut…
lostmsu 83328d2 made InterruptTest more robust
lostmsu 6db4373 added NuGet shields to README
lostmsu 6f1219f mentioned PythonDLL in README
lostmsu c4f2ad7 Adjust static libpython detection (#1396)
filmor c3fc7f0 allow comparing BorrowedReference to null
lostmsu 60bb68c removed unused Utf8Marshaler
lostmsu 50834ba introduced PyModule (inherits PyScope)
lostmsu ac68aab minor fixes
lostmsu 6f10641 PyImport test validate no initialization failures
lostmsu 676fbb4 PyObject.Length raises an exception when object does not have a conce…
lostmsu 5bcd708 Merge pull request #1391 from losttech/cleanup/21-02-19
filmor b2c15a4 ImportHook: verify __import__ was not updated before overwriting it w…
lostmsu fefa322 drop _PyObject_GetDictPtr and use PyObject_GenericGetDict instead
lostmsu 908316f ImportHook: drop dead code around clr_prefix
lostmsu f2dc8f1 Merge pull request #1400 from losttech/cleanup/21-02-25
lostmsu db765ca suggest to set Runtime.PythonDLL when embedding in .NET
lostmsu 4afa4bd more info on Runtime.PythonDLL
lostmsu 1e5338f allow GIL state debugging; require GILState to be properly disposed
lostmsu 483f192 try libdl.so.2 on Linux before libdl.so
lostmsu a2304dc Merge pull request #1425 from losttech/bugs/libdl.so.2
filmor 6e1eea6 TypeFlags is an enum
lostmsu 486ad0a use C# 9 everywhere by default
lostmsu 95d5e35 added new class PyType to wrap Python type objects and enable new typ…
lostmsu 6379221 reworked Enum marshaling
lostmsu a157fb4 added regression test for https://github.com/pythonnet/pythonnet/issu…
lostmsu 957a3cb disabled ability to register encoders for `System.Type`
lostmsu 23527d1 disabled PythonRegisteredDecoder_NoStackOverflowOnSystemType test due…
lostmsu 257a765 merge latest master
lostmsu c0fe430 reworked `PythonException`:
lostmsu e58411d rum embedding tests before Python tests
lostmsu 00653dc PythonException.StackTrace is GIL-safe
lostmsu 3433201 separate .Steal() and .StealNullable()
lostmsu 95cc52f can't test exception type when runtime is down
lostmsu 63ad42c PythonException: dispose intermediate values used in stack trace gene…
lostmsu faec7fc Point users to Message property of PythonException
lostmsu dfc70f6 minor change in PythonEngine.With
lostmsu d976acf simplified code of PythonException and added a lot more checks
lostmsu 146ebf3 fixed type of reference in PyException_SetCause
lostmsu 272687b minor fixes to Converter.ToArray:
lostmsu 2cd3f61 added a few debug checks to Exceptions.SetError
lostmsu e79f041 method binding failure now supports non-Python exception causes
lostmsu d068f36 XDecref now checks, that refcount is positive in debug builds
lostmsu 4877fe7 fixed __cause__ on overload bind failure and array conversion
lostmsu ed594c1 cache PythonException message
lostmsu e5bce06 minor code cleanup
lostmsu 6819e7b improved handling of dict offset in object instances
lostmsu 6679d1c added a few debug checks
lostmsu dff75d2 do not call find_libpython as Python.Runtime can find it on its own
lostmsu 0775458 Merge pull request #1440 from losttech/PR/No_find_libpyton_for_import…
filmor 16f04e9 fixed __cause__ on overload bind failure and array conversion
lostmsu daccc43 Replaced magic offsets with per-type calculation
lostmsu db746aa detect Py_TRACE_REFS at runtime and calculate object offsets accordingly
lostmsu 33d771c Re-enable the domain reload tests (#1404)
BadSingleton 5ded48d dispose all temporary objects in PyCheck_Iter_PyObject_IsIterable_Thr…
lostmsu 21169db use PyType instances instead of raw pointers in TypeManager type cach…
lostmsu 67bd1c2 merge latest master
lostmsu 2c62028 + class diagram for ManagedType and subclasses
lostmsu 91e98a2 added OverloadMapper to ManagedTypes class diagram
lostmsu 88b19cf refactored tp_dealloc in ExtensionType and descendants
lostmsu 786b450 refactored tp_clear in ExtensionType and descendants into a virtual C…
lostmsu 993707e all Dealloc overrides simply duplicate Clear, so just call both from …
lostmsu 7eac886 handle ProcessExit event to avoid Python crash when CLR (in particula…
lostmsu 2e57b04 + class diagram for ManagedType and subclasses
lostmsu 539ce81 added OverloadMapper to ManagedTypes class diagram
lostmsu 25e3864 refactored tp_dealloc in ExtensionType and descendants
lostmsu 5bca333 refactored tp_clear in ExtensionType and descendants into a virtual C…
lostmsu 7271d88 all Dealloc overrides simply duplicate Clear, so just call both from …
lostmsu 4f3f648 fixup! merge latest master
SDEII c500a39 fixup! reworked `PythonException`:
lostmsu 7d8f754 Merge pull request #1134 from losttech/PR/ExceptionsImprovement
lostmsu a321daa (WIP) modernize the import hook
BadSingleton 279b535 Add the loaded namespaces tracking
BadSingleton f92e95b cleanup and changelog entry
BadSingleton afffc18 Fix a bug where clr wasn't in sys.modules after reload
BadSingleton d821c0f Further refinements to setattr logic on ModuleObjects
BadSingleton e469a8a fixups, add docs
BadSingleton 685b972 merge fixup
BadSingleton be81364 (WIP) import hook in the pytohn module
BadSingleton 73958ed Revert "(WIP) import hook in the pytohn module"
BadSingleton e71a0ef Import hook as a module, take 2
BadSingleton 2af066d fixup! Merge remote-tracking branch 'origin/master' into modernize-im…
BadSingleton bb490bf fixup! fixup! Merge remote-tracking branch 'origin/master' into moder…
BadSingleton 31ea876 Create a clr.loader module
BadSingleton c02d5c6 Test to test if the test passes
BadSingleton 970a189 fix new exception usage
BadSingleton 059605b kick the build because I can't repro
BadSingleton ff170e9 Add Namespaces to the import hook only through AddReference
BadSingleton da051a9 Add a failing test for Unicode conversion
pkese 1b6c6c0 Fix Python -> .Net unicode string conversion
pkese 4674b5c Add separate test for the initial problem (passing); disable failing …
pkese 63de923 Review changes, update API usage
BadSingleton 1629116 Use exclusively PyUnicode_DecodeUTF16 for .NET->Python string convers…
filmor df5ebc2 Activate UnicodeSurrogate test
filmor d084b2e Apply suggested changes
pkese f061d28 Revert stuff that I don't understand
pkese 49ccc1e Apply code review suggestions
filmor 12027ad Merge pull request #1467 from pkese/master
lostmsu 624f7e3 Merge remote-tracking branch 'upstream/master' into modernize-import-…
BadSingleton bd7e745 make PyModule_AddObject in line with CPython
BadSingleton 46a85fe take care of stragglers
BadSingleton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: NuGet Preview Release | ||
| on: | ||
| schedule: | ||
| - cron: "5 4 3 */1 *" # once a month, at 4:05 on 3rd | ||
| workflow_dispatch: | ||
| jobs: | ||
| release: | ||
| name: Release Preview | ||
| runs-on: ubuntu-latest | ||
| environment: NuGet | ||
| timeout-minutes: 10 | ||
| env: | ||
| PYTHONNET_SHUTDOWN_MODE: Normal | ||
| steps: | ||
| - name: Get Date | ||
| run: | | ||
| echo "DATE_VER=$(date "+%Y-%m-%d")" >> $GITHUB_ENV | ||
| - name: Checkout code | ||
| uses: actions/checkout@v2 | ||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v1 | ||
| - name: Set up Python 3.8 | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: 3.8 | ||
| architecture: x64 | ||
| - name: Install dependencies | ||
| run: | | ||
| pip install --upgrade -r requirements.txt | ||
| - name: Build and Install | ||
| run: | | ||
| pip install -v . | ||
| - name: Python Tests | ||
| run: pytest | ||
| env: | ||
| PYTHONNET_PYDLL: libpython3.8.so | ||
| - name: Embedding tests | ||
| run: dotnet test --runtime any-ubuntu src/embed_tests/ | ||
| env: | ||
| PYTHONNET_PYDLL: libpython3.8.so | ||
| - name: Pack | ||
| run: dotnet pack --configuration Release --version-suffix preview${{env.DATE_VER}} --output "Release-Preview" | ||
| - name: Publish NuGet | ||
| run: dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_MONTHLY }} Release-Preview/*.nupkg | ||
| # TODO: Run perf tests | ||
| # TODO: Run mono tests on Windows? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,5 @@ | ||
| /src/runtime/interopNative.cs | ||
| # Configuration data | ||
| configured.props | ||
| # General binaries and Build results | ||
| *.dll | ||
| *.exe | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| [build-system] | ||
| requires = ["setuptools>=42", "wheel", "pycparser"] | ||
| build-backend = "setuptools.build_meta" | ||
| [tool.pytest.ini_options] | ||
| xfail_strict = true | ||
| testpaths = [ | ||
| "tests" | ||
| ] |
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the extra whitespace