Skip to content
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

support serializing dynamic python engines #13841

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

mjkkirschner
Copy link
Member

@mjkkirschner mjkkirschner commented Mar 21, 2023

Purpose

while working on IronPython3 package recharge project I noticed that dynamic engine names were not serializing correctly because of an obsolete public API that requires returning an enum.. This PR works around that.

Screen Shot 2023-03-21 at 3 21 18 PM

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Release Notes

(FILL ME IN) Brief description of the fix / enhancement. Mandatory section

Reviewers

(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)

(FILL ME IN, optional) Any additional notes to reviewers or testers.

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

@QilongTang QilongTang added this to the 2.18.0 milestone Mar 22, 2023
//if this is a valid dynamically loaded engine, return unknown, and serialize the name.
if (PythonEngineManager.Instance.AvailableEngines.Any(x=>x.Name == engine))
{
return PythonEngineVersion.Unknown;
Copy link
Contributor

Choose a reason for hiding this comment

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

why isn't PythonEngineVersion.Unspecified good enough to be returned ?

Copy link
Member Author

@mjkkirschner mjkkirschner Mar 22, 2023

Choose a reason for hiding this comment

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

@pinzart90 - two reasons IMO:

  1. If the version is unspecified it makes sense to me that the default version should kick in.
  2. Logically Unspecified is not the same as Unknown. In this case the version is definitely specified, it's just not a valid value in the enum.

Copy link
Contributor

Choose a reason for hiding this comment

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

So all this is to enhance the user experience for an obsoleted API? Is it still used by our integrators ?

Copy link
Member Author

Choose a reason for hiding this comment

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

hah, not quite, I don't know who uses it, and I don't know when it will disappear, and IMO it is about enhancing correctness not user experience - not collapsing two different states into one.

Let us remove this enum and never mention it again, but until then, I don't want to break python node initialization and I also want dynamic engines to serialize correctly.

@mjkkirschner mjkkirschner merged commit b7cc746 into DynamoDS:master Mar 23, 2023
@mjkkirschner mjkkirschner deleted the dynpython branch March 23, 2023 20:49
sm6srw pushed a commit to sm6srw/Dynamo that referenced this pull request Mar 29, 2023
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.

3 participants