Skip to content

Add references to new DSIronPython package version #14752

Merged
mjkkirschner merged 4 commits intoDynamoDS:masterfrom
mjkkirschner:newpypack
Dec 15, 2023
Merged

Add references to new DSIronPython package version #14752
mjkkirschner merged 4 commits intoDynamoDS:masterfrom
mjkkirschner:newpypack

Conversation

@mjkkirschner
Copy link
Member

@mjkkirschner mjkkirschner commented Dec 13, 2023

Purpose

When a user opens an old graph with IronPython nodes in it and no IronPython engine, we currently add a reference to DSIronPython2.7 version 2.4 - that package will no longer work in Dynamo 3.x

This PR does the following:

  • updates the version target to 3.0.0 - this package has not been published yet. ⚠️ ⚠️ ⚠️
  • no longer migrates the old target of 2.4 during preferences migration.

I am not really sure why this is in preferences at all...

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

(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

@mjkkirschner mjkkirschner added this to the 3.0 milestone Dec 13, 2023
{
//allows us to access some default pref values of current version before prefs are
//actually written to disk(firstRun).
var currentVersionTempPrefs = new PreferenceSettings();
Copy link
Member Author

Choose a reason for hiding this comment

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

I am not thrilled with this solution, but I am out of bandwidth to do any other refactoring, and this lets me add a test, the alternative is no test, and I can revert the version in DynamoModel.Start after the migrator has exited. (see the previous commit).

@saintentropy @pinzart90 do you see an issue with creating temp prefs like this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see... There is no good way to access the default. If you pull it out then we might forgot to sync them later correct?

Copy link
Member Author

@mjkkirschner mjkkirschner Dec 13, 2023

Choose a reason for hiding this comment

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

yeah, it's probably not a big deal to add 3.0.0 inline, but theres already 2 or 3 different ways we avoid migration in various places, I'd like to avoid yet another way with a random version number that we'll forget to update.

Longterm I think this class needs a refactor / improvement.

@github-actions
Copy link

UI Smoke Tests

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

@github-actions
Copy link

UI Smoke Tests

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

/// if found at deserialize time.
/// </summary>
internal static Version ironPythonResolveTargetVersion = new Version(2, 4, 0);
internal Version ironPythonResolveTargetVersion = new Version(3, 0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

And you don't want to leave this static because ...

Copy link
Member Author

@mjkkirschner mjkkirschner Dec 13, 2023

Choose a reason for hiding this comment

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

if it's static when the migrator loads the old preferences it modifies the new preferences and we never even have a chance of looking up the value in the current version prefs.

I don't think it makes sense for any preferences to be backed by static fields.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like the reason it was made static was about access (ie not having to pass it in). From Martins PR

In order to make system and user settings available on the node, and
avoiding further changes to the API, the properties were made static
and internal.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, it was already easily available in the extension where it was needed AFAIK.

Copy link
Contributor

Choose a reason for hiding this comment

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

But yes not having to read properties from the file and then deserialize this makes sence.

@github-actions
Copy link

UI Smoke Tests

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

@github-actions
Copy link

UI Smoke Tests

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

var ironPythonVersion = new Version(3, 0, 0);
if(LoadedParams.StartupParams.Preferences is PreferenceSettings prefs)
{
Version.TryParse(prefs.IronPythonResolveTargetVersion,out ironPythonVersion);
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we have Internal visible set for PythonMigrationViewExtension. Can you access the internal field?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big deal... This works too.

@github-actions
Copy link

UI Smoke Tests

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

@github-actions
Copy link

UI Smoke Tests

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

@mjkkirschner mjkkirschner merged commit 72492c6 into DynamoDS:master Dec 15, 2023
@mjkkirschner mjkkirschner deleted the newpypack branch December 15, 2023 21:33
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