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

make Py11 compliant #298

Merged
merged 13 commits into from
Jun 1, 2024
Merged

make Py11 compliant #298

merged 13 commits into from
Jun 1, 2024

Conversation

SpheMakh
Copy link
Collaborator

  • Add basetypes.EmptyClassDefault() method because dataclasses in python 3.11 cannot have mutable (classes in this case) as default values. Updated all the class defaults I could fine. It may be worth considering a
def __default__(self): 
    return dataclass.field(default_factory=self)

method to our dataclasses then using foo: Bar = Bar.__default__() when setting defaults.

  • Save CASA code in a tempfile instead of parsing a multi-line code string; this did not work for me.

Copy link
Member

@o-smirnov o-smirnov left a comment

Choose a reason for hiding this comment

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

One last thing @SpheMakh -- have you tried this with CASA<6 (i.e. python2 based)? Just to make sure that code still runs.

@o-smirnov
Copy link
Member

Reminder @SpheMakh -- could you please check this implementation works with CASA5?

@SpheMakh
Copy link
Collaborator Author

SpheMakh commented Jun 1, 2024

Reminder @SpheMakh -- could you please check this implementation works with CASA5?

It creates even more parsing problems. But this latest solution works for CASA >=4.7, 5, and 6

@o-smirnov
Copy link
Member

Ha, so simple in the end! All right, let's merge.

Copy link
Member

@o-smirnov o-smirnov left a comment

Choose a reason for hiding this comment

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

LGTM.

@o-smirnov o-smirnov merged commit 9448658 into master Jun 1, 2024
4 checks passed
@o-smirnov o-smirnov deleted the py11 branch June 1, 2024 11:29
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