Skip to content

Commit 92e5912

Browse files
committed
Build .NET 4.6 support conditionally
1 parent 2439e6a commit 92e5912

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
graft src/runtime
22
prune src/runtime/obj
33
prune src/runtime/bin
4+
graft src/compat
45
include src/pythonnet.snk
56
include Directory.Build.*
67
include pythonnet.sln

doc/source/python.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ Mono (``mono``)
4545

4646
.NET Framework (``netfx``)
4747
Default on Windows and also only supported there. Must be at least version
48-
4.6.1, with 4.7.2 or later recommended.
48+
4.6.1, with 4.7.2 or later recommended. For .NET 4.6 support, the wheel has
49+
to be built with the environment variable `PYTHONNET_BUILD_NET46_SUPPORT=1`.
4950

5051
.NET Core (``coreclr``)
5152
Self-contained is not supported, must be at least version 3.1.

setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ def finalize_options(self):
124124
"bdist_wheel": bdist_wheel,
125125
}
126126

127-
dotnet_libs = [
128-
DotnetLib(
129-
"python-runtime",
130-
"src/compat/Python.Runtime.Compat.csproj",
131-
output="pythonnet/runtime",
132-
)
133-
]
127+
128+
if os.getenv("PYTHONNET_BUILD_NET46_SUPPORT"):
129+
csproj = "src/compat/Python.Runtime.Compat.csproj"
130+
else:
131+
csproj = "src/runtime/Python.Runtime.csproj"
132+
133+
dotnet_libs = [DotnetLib("python-runtime", csproj, output="pythonnet/runtime")]
134134

135135
setup(
136136
cmdclass=cmdclass,

0 commit comments

Comments
 (0)