Closed
Description
Environment
- Pythonnet version: master bc5b084
- Python version: 3.8
- Operating System: Windows 10
- .NET Runtime: N/A
Details
- Describe what you were trying to get done.
I was trying to track down a bug in my code by breaking into pythonnet in Visual Studio. This necessitated a debug build. The setup.py appears to provide this option in the build_dotnet step through the --dotnet-config option. Unfortunately, this option is broken as currently implemented.
- What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
$ python setup.py build_dotnet --dotnet-config=debug
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --dotnet-config must not have an argument
- If there was a crash, please include the traceback here.
See above.
- Solution
I was able to fix this by modifying setup.py:24-36 to
class build_dotnet(Command):
"""Build command for dotnet-cli based builds"""
description = "Build DLLs with dotnet-cli"
user_options = [
("dotnet-config=", None, "dotnet build configuration"),
(
"inplace",
"i",
"ignore build-lib and put compiled extensions into the source "
+ "directory alongside your pure Python modules",
),
]
The key is the = sign after the dotnet-config option.
With this change, the debug build proceeded correctly.
$ python setup.py build_dotnet --dotnet-config=debug
running build_dotnet
Running dotnet build...
C:\Program Files\dotnet\dotnet.exe build src/runtime/Python.Runtime.csproj --configuration debug --output C:\Code\pythonnet\build\lib\pythonnet/runtime
Metadata
Metadata
Assignees
Labels
No labels