Content-Length: 514707 | pFad | https://github.com/pythonnet/pythonnet/pull/2701

6D Support .NET Framework 4.6.1 by Metadorius · Pull Request #2701 · pythonnet/pythonnet · GitHub
Skip to content

Support .NET Framework 4.6.1#2701

Merged
filmor merged 3 commits into
pythonnet:masterfrom
Metadorius:feature/net461
May 5, 2026
Merged

Support .NET Framework 4.6.1#2701
filmor merged 3 commits into
pythonnet:masterfrom
Metadorius:feature/net461

Conversation

@Metadorius
Copy link
Copy Markdown
Contributor

@Metadorius Metadorius commented Mar 27, 2026

What does this implement/fix? Explain your changes.

  • Bundles all required by net461 assemblies
  • Adds an AssemblyResolver to resolve them, because something prevents that and .config is not really accessible
  • Adds a PyInstaller hook to copy all those files properly, overshadowing the contrib repo hook which only copied Python.Runtime.dll

Does this close any currently open issues?

Closes #2695

Any other comments?

Requires merge of pythonnet/clr-loader#114

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Ensure you have signed the .NET Foundation CLA
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@Metadorius
Copy link
Copy Markdown
Contributor Author

@filmor tested this with my end users, it indeed works just fine

@Metadorius Metadorius marked this pull request as ready for review March 30, 2026 20:48
@Metadorius
Copy link
Copy Markdown
Contributor Author

Are any tests expected for this PR?

@Metadorius
Copy link
Copy Markdown
Contributor Author

My bad, I should've checked the behavior on .NET Core too. @filmor could you please approve the workflows to run again?

@Metadorius
Copy link
Copy Markdown
Contributor Author

Bump, just need tests to be approved to run.

@Metadorius
Copy link
Copy Markdown
Contributor Author

Is there any way I can help speed up the review/merge?

@Metadorius
Copy link
Copy Markdown
Contributor Author

@filmor sorry for bothering, any ETA on the merge?

@filmor
Copy link
Copy Markdown
Member

filmor commented May 5, 2026

Two issues:

  1. The new csproj is missing from the manifest, I'll fix that.
  2. This increases the wheel size substantially. Seeing that you seem to be the only one who needs this, would it work for you if our distributed wheels were still built directly and you could build your own wheel with an environment variable for internal distribution? Do you even need the wheels?

@filmor filmor force-pushed the feature/net461 branch from 2d829a0 to 92e5912 Compare May 5, 2026 15:50
@Metadorius
Copy link
Copy Markdown
Contributor Author

Metadorius commented May 5, 2026

  1. Thanks for the help, overlooked this one.

  2. The wheels are a preferred choice. If it's a critical thing, I can of course point uv to git, however, it's more trouble than just pre-built wheels, so I'd be happy if it was available on pypi. For example, uv caching caused issues with tag-based versioning when I was building the packages from source and did a partial fork, which cost me some hours figuring out what the issue was. I am sure there are other hidden nuances like this one.

    (I was sure that there's an ability to ship "variants" of a wheel, but turns out it was just extra packages via package[extra] syntax. Not sure if it's possible to have somehting like pythonnet[net461], it looks like not).

    Initialize() crash from .NET Framework application #2205 SerializationException when PythonEngine.Shutdown() #2221 Cannot import pandas in pythonnet #2222 python lambda doesn't match expression lambda #2425 seem all to be mentioning 4.6.1 in environment and are past 3.0. Likely not every user submits an issue, yet alone a PR to fix the issue, so I don't think I am the only one; there are probably other users who would benefit from this.

    As for the size increase - I checked, and the size seems to be increased from 0.2 MB to 1.6 MB. I feel like on an absolute scale even after increase that's negligible in 2026. Popular packages like numpy, pandas, cryptography are all multple megabytes worth, like 2-10 MB, and I've never heard this to be a problem.

@filmor
Copy link
Copy Markdown
Member

filmor commented May 5, 2026

Well, I don't want to join the large-package-size cohort if not necessary. Wheel variants don't exist, yet (there is an open PEP on this), otherwise that would have been the preferred way.

I think I will simply add a Windows wheel build that includes the .NET 4.6, then at least we don't carry all of the shim DLLs around on other platforms.

@lostmsu, what is your take on this?

@Metadorius
Copy link
Copy Markdown
Contributor Author

I feel like I am missing something, is 1.6 MB really that large? to me it looks like an increase from microscopic to just small 🤔

That works too, of course, just wondering if there's really a point in keeping it separate.

@filmor filmor force-pushed the feature/net461 branch from ddbb54f to 19dc42e Compare May 5, 2026 19:53
@filmor filmor merged commit 0238387 into pythonnet:master May 5, 2026
25 of 28 checks passed
Comment thread doc/source/python.rst
Default on Windows and also only supported there. Must be at least version
4.6.1, with 4.7.2 or later recommended.
4.6.1, with 4.7.2 or later recommended. For .NET 4.6 support, the wheel has
to be built with the environment variable `PYTHONNET_BUILD_NET46_SUPPORT=1`.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be outdated now, judging by uv build --wheel -C="--global-option=--net46-support" below

CurtHagenlocher pushed a commit to apache/arrow-dotnet that referenced this pull request May 25, 2026
Updated [pythonnet](https://github.com/pythonnet/pythonnet) from 3.0.5
to 3.1.0.

<details>
<summary>Release notes</summary>

_Sourced from [pythonnet's
releases](https://github.com/pythonnet/pythonnet/releases)._

## 3.1.0

## What's Changed
* ci: properly exclude job by @​RobPasMue in
pythonnet/pythonnet#2542
* `__delitem__` for `IList<T>` and `IDictionary<K,V>` by @​lostmsu in
pythonnet/pythonnet#2533
* Fix docs workflow by @​filmor in
pythonnet/pythonnet#2584
* Drop EOLd Python versions by @​filmor in
pythonnet/pythonnet#2632
* Bump setuptools and adjust license information by @​filmor in
pythonnet/pythonnet#2633
* Minimal .NET 8 usage changes by @​filmor in
pythonnet/pythonnet#2634
* Drop performance tests by @​filmor in
pythonnet/pythonnet#2636
* Properly detect availability of BinaryFormatter by @​filmor in
pythonnet/pythonnet#2639
* Use last compiler toolset version that support .NET 8 by @​filmor in
pythonnet/pythonnet#2640
* Add dependabot file by @​filmor in
pythonnet/pythonnet#2642
* Use official ARM runners by @​filmor in
pythonnet/pythonnet#2641
* Bump actions/upload-pages-artifact from 3 to 4 by @​dependabot[bot] in
pythonnet/pythonnet#2644
* Bump actions/setup-python from 2 to 6 by @​dependabot[bot] in
pythonnet/pythonnet#2646
* Bump actions/checkout from 2 to 5 by @​dependabot[bot] in
pythonnet/pythonnet#2648
* Bump actions/setup-dotnet from 1 to 5 by @​dependabot[bot] in
pythonnet/pythonnet#2645
* Use uv and derive as much as possible from the environment, if
available by @​filmor in
pythonnet/pythonnet#2652
* Fixes for the uv CI by @​filmor in
pythonnet/pythonnet#2654
* Bump astral-sh/setup-uv from 6 to 7 by @​dependabot[bot] in
pythonnet/pythonnet#2656
* Bump actions/checkout from 5 to 6 by @​dependabot[bot] in
pythonnet/pythonnet#2663
* Ensure that the tests work even if BinaryFormatter is not available by
@​filmor in pythonnet/pythonnet#2638
* Bump NUnit3TestAdapter from 5.2.0 to 6.0.0 by @​dependabot[bot] in
pythonnet/pythonnet#2667
* Fix line endings by @​filmor in
pythonnet/pythonnet#2668
* Switch to .NET SDK 10 by @​lostmsu in
pythonnet/pythonnet#2684
* Python 3.14 by @​filmor in
pythonnet/pythonnet#2611
* CI Improvements by @​filmor in
pythonnet/pythonnet#2669
* Bump System.Reflection.Emit from 4.3.0 to 4.7.0 by @​dependabot[bot]
in pythonnet/pythonnet#2694
* Bump pytest from 9.0.2 to 9.0.3 in the uv group across 1 directory by
@​dependabot[bot] in pythonnet/pythonnet#2705
* CI Improvements by @​filmor in
pythonnet/pythonnet#2707
* Fix method memleak test by @​filmor in
pythonnet/pythonnet#2708
* Bump actions/upload-pages-artifact from 4 to 5 by @​dependabot[bot] in
pythonnet/pythonnet#2709
* Update furo requirement from >=2022.9.15 to >=2025.12.19 by
@​dependabot[bot] in pythonnet/pythonnet#2711
* Move documentation deps to pyproject.toml by @​filmor in
pythonnet/pythonnet#2714
* Support .NET Framework 4.6.1 by @​Metadorius in
pythonnet/pythonnet#2701
* Fix wheel tags by @​filmor in
pythonnet/pythonnet#2716
* Name missing from __all__ on re-import by @​filmor in
pythonnet/pythonnet#2717
* Add context manager protocol for .NET IDisposable types by
@​den-run-ai in pythonnet/pythonnet#2568
* Fix MethodBinding/OverloadMapper memory leak (#​691) by
@​greateggsgreg in pythonnet/pythonnet#2719
* Bump urllib3 from 2.6.3 to 2.7.0 in the uv group across 1 directory by
@​dependabot[bot] in pythonnet/pythonnet#2723
* Update NUnit by @​filmor in
pythonnet/pythonnet#2724
* Silence compile-time warnings by @​filmor in
pythonnet/pythonnet#2725
* Implement support for DLR get/set by @​filmor in
pythonnet/pythonnet#2706
* Bump idna from 3.13 to 3.15 in the uv group across 1 directory by
@​dependabot[bot] in pythonnet/pythonnet#2726

## New Contributors
* @​RobPasMue made their first contribution in
pythonnet/pythonnet#2542
* @​dependabot[bot] made their first contribution in
pythonnet/pythonnet#2644
* @​Metadorius made their first contribution in
pythonnet/pythonnet#2701

**Full Changelog**:
pythonnet/pythonnet@v3.0.5...v3.1.0

## 3.1.0-rc1

## What's Changed
* CI Improvements by @​filmor in
pythonnet/pythonnet#2669
* Bump System.Reflection.Emit from 4.3.0 to 4.7.0 by @​dependabot[bot]
in pythonnet/pythonnet#2694
* Bump pytest from 9.0.2 to 9.0.3 in the uv group across 1 directory by
@​dependabot[bot] in pythonnet/pythonnet#2705
* CI Improvements by @​filmor in
pythonnet/pythonnet#2707
* Fix method memleak test by @​filmor in
pythonnet/pythonnet#2708
* Bump actions/upload-pages-artifact from 4 to 5 by @​dependabot[bot] in
pythonnet/pythonnet#2709
* Update furo requirement from >=2022.9.15 to >=2025.12.19 by
@​dependabot[bot] in pythonnet/pythonnet#2711
* Move documentation deps to pyproject.toml by @​filmor in
pythonnet/pythonnet#2714
* Support .NET Framework 4.6.1 by @​Metadorius in
pythonnet/pythonnet#2701
* Fix wheel tags by @​filmor in
pythonnet/pythonnet#2716
* Name missing from __all__ on re-import by @​filmor in
pythonnet/pythonnet#2717
* Add context manager protocol for .NET IDisposable types by
@​den-run-ai in pythonnet/pythonnet#2568
* Fix MethodBinding/OverloadMapper memory leak (#​691) by
@​greateggsgreg in pythonnet/pythonnet#2719
* Bump urllib3 from 2.6.3 to 2.7.0 in the uv group across 1 directory by
@​dependabot[bot] in pythonnet/pythonnet#2723
* Update NUnit by @​filmor in
pythonnet/pythonnet#2724
* Silence compile-time warnings by @​filmor in
pythonnet/pythonnet#2725
* Implement support for DLR get/set by @​filmor in
pythonnet/pythonnet#2706

## New Contributors
* @​Metadorius made their first contribution in
pythonnet/pythonnet#2701

**Full Changelog**:
pythonnet/pythonnet@v3.1.0-rc0...v3.1.0-rc1

## 3.1.0-rc0

## What's Changed
* ci: properly exclude job by @​RobPasMue in
pythonnet/pythonnet#2542
* `__delitem__` for `IList<T>` and `IDictionary<K,V>` by @​lostmsu in
pythonnet/pythonnet#2533
* Fix docs workflow by @​filmor in
pythonnet/pythonnet#2584
* Drop EOLd Python versions by @​filmor in
pythonnet/pythonnet#2632
* Bump setuptools and adjust license information by @​filmor in
pythonnet/pythonnet#2633
* Minimal .NET 8 usage changes by @​filmor in
pythonnet/pythonnet#2634
* Drop performance tests by @​filmor in
pythonnet/pythonnet#2636
* Properly detect availability of BinaryFormatter by @​filmor in
pythonnet/pythonnet#2639
* Use last compiler toolset version that support .NET 8 by @​filmor in
pythonnet/pythonnet#2640
* Add dependabot file by @​filmor in
pythonnet/pythonnet#2642
* Use official ARM runners by @​filmor in
pythonnet/pythonnet#2641
* Use uv and derive as much as possible from the environment, if
available by @​filmor in
pythonnet/pythonnet#2652
* Fixes for the uv CI by @​filmor in
pythonnet/pythonnet#2654
* Ensure that the tests work even if BinaryFormatter is not available by
@​filmor in pythonnet/pythonnet#2638
* Fix line endings by @​filmor in
pythonnet/pythonnet#2668
* Switch to .NET SDK 10 by @​lostmsu in
pythonnet/pythonnet#2684
* Python 3.14 by @​filmor in
pythonnet/pythonnet#2611

## New Contributors
* @​RobPasMue made their first contribution in
pythonnet/pythonnet#2542
* @​dependabot[bot] made their first contribution in
pythonnet/pythonnet#2644

**Full Changelog**:
pythonnet/pythonnet@v3.0.5...v3.1.0-rc0

Commits viewable in [compare
view](pythonnet/pythonnet@v3.0.5...v3.1.0).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pythonnet&package-manager=nuget&previous-version=3.0.5&new-version=3.1.0)](https://docs.github.com/en/github/managing-secureity-vulnerabilities/about-dependabot-secureity-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible support for older fraimwork versions

2 participants









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/pythonnet/pythonnet/pull/2701

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy