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

8150: DYN-8176: Fixes from PythonNet3 #15774

Merged
merged 4 commits into from
Jan 23, 2025
Merged

Conversation

twastvedt
Copy link
Contributor

@twastvedt twastvedt commented Jan 22, 2025

Purpose

Apply a few fixes from PythonNet3 work to CPython3:

  • Improve path handling. Currently we just chop off all but the first three path entries. This PR caches the path before all Python nodes run and uses the cached path for each run. This will fix, for example, the issue where site-packages isn't on the path (If site-packages folder is present the default Python path has 4 items).
  • Prevent unwrap marshaler from looping infinitely (no known cases of this with CPython3, but seems like a good safety)

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
  • This PR contains no files larger than 50 MB

Release Notes

Preserve full original Python path on each Python node run.

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

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8150

@twastvedt twastvedt changed the title DYN-8150: Fixes from PythonNet3 DYN-8176: Fixes from PythonNet3 Jan 22, 2025
@github-actions github-actions bot changed the title DYN-8176: Fixes from PythonNet3 8150: DYN-8176: Fixes from PythonNet3 Jan 22, 2025
@@ -642,7 +641,6 @@ public void VerifySysPathValueForCPythonEngine()
var pynode = nodeModel as PythonNode;
UpdatePythonEngineAndRun(pynode, PythonEngineManager.CPython3EngineName);
sysPathList = GetFlattenedPreviewValues(secondPythonNodeGUID);
Assert.AreEqual(sysPathList.Count(), 3);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We now can't be certain of the exact number of paths. But it should be enough (as we are doing) to check that the custom path is visible in the first node and not in the second.

Copy link

github-actions bot commented Jan 22, 2025

UI Smoke Tests

Test: success. 11 passed, 0 failed.
TestComplete Test Result
Workflow Run: UI Smoke Tests
Check: UI Smoke Tests

@twastvedt twastvedt merged commit e14e089 into master Jan 23, 2025
24 checks passed
@twastvedt twastvedt deleted the DYN-8150-pythonnet3-fixes branch January 23, 2025 20:41
@twastvedt twastvedt changed the title 8150: DYN-8176: Fixes from PythonNet3 DYN-8176: Fixes from PythonNet3 Jan 23, 2025
@github-actions github-actions bot changed the title DYN-8176: Fixes from PythonNet3 8150: DYN-8176: Fixes from PythonNet3 Jan 23, 2025
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.

2 participants