Skip to content

Update documentation to reflect API changes #2439

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

TheJanzap
Copy link

@TheJanzap TheJanzap commented Aug 22, 2024

What does this implement/fix? Explain your changes.

Adds the now mandatory use of setting the Python DLL in C# to the README and documentation

Does this close any currently open issues?

Fixes #2433

Any other comments?

Also updated the use of PyModule.Import in the wiki with https://github.com/pythonnet/pythonnet/wiki/Threading/aee4b778efd079911d1b771c8b59ba5bd7dd156d

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

@@ -15,7 +15,9 @@ These classes include PyObject, PyList, PyDict, PyTuple, etc.
At a very high level, to embed Python in your application one will need
to:

- Reference ``Python.Runtime.dll`` (e.g. via a ``PackageReference``)
- Reference ``Python.Runtime.dll`` (e.g. via a ``PackageReference``,
the ``Runtime.PythonDLL`` property or the ``PYTHONNET_PYDLL``
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong. The Runtime.PythonDLL and PYTHONNET_PYDLL reference libpython*.so/dylib or python*.dll.

Copy link
Author

Choose a reason for hiding this comment

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

Ah, I didn't know that there's a difference. But since it's now mandatory to reference a Python DLL, I think it's a good idea to mention it here. Maybe as a separate bullet point?

@@ -85,6 +85,7 @@ Example

static void Main(string[] args)
{
Runtime.PythonDLL = "python38.dll";
Copy link
Member

Choose a reason for hiding this comment

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

I really don't want to give people the idea that this is the way to go. Maybe we can point them toward (or include) https://github.com/losttech/WhichPython? Maybe give a note above to set the PYTHONNET_PYDLL environment variable?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I wasn't really keen on this either, but I figured since this was one of the examples given in the paragraph above it that this would be at least acceptable.
I also thought about mentioning the env var, but I didn't want to clutter this example with a comment (at least not without the permisson of you guys)

@TheJanzap
Copy link
Author

I've noticed that Runtime.PythonDLL is also absent in the C# reference. Would it be enough to just remove the comment from

.. doxygennamespace:: Python::Runtime
       :members:
       :outline:

to enable it? Apologies, I'm new to RST and I get errors about missing index.xml files, so I can't compile it myself.

@TheJanzap TheJanzap requested a review from filmor September 2, 2024 09:39
@TheJanzap
Copy link
Author

@filmor Is this PR still relevant?

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.

Update documentation to reflect API changes
2 participants