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

[FIX] ImportError; [RFR] Apriori as json in upgrade_path #4

Conversation

StefanRijnhart
Copy link

No description provided.

Copy link

@yajo yajo left a comment

Choose a reason for hiding this comment

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

Would you consider supporting YAML instead? JSON is ugly to write and maintain for humans, as it requires very specific syntax and doesn't allow comments. If needed, later, converting from YAML to JSON is a piece of 🍰.

@@ -97,14 +126,34 @@ def analyze(self):
}
)

if not self.upgrade_path:
return (
"ERROR: no upgrade_path set when writing analysis of %s\n" % module_name
Copy link

Choose a reason for hiding this comment

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

Shouldn't this raise instead of returning?

Copy link
Owner

Choose a reason for hiding this comment

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

no, we don't want to have a blocking error here. if upgrade_path is not accessible, the analysis will be written in a data field (log). (same behaviour as before).


from .. import compare

_logger = logging.getLogger(__name__)
_IGNORE_MODULES = ["openupgrade_records", "upgrade_analysis"]


class Apriori(object):
Copy link

Choose a reason for hiding this comment

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

I'd use a dataclass here. Not very important though.

@legalsylvain
Copy link
Owner

Hi @StefanRijnhart. Thanks a lot for the fixes.
As the module debate is not finished (OCA#1941 (comment)), I kept all your improvment, without the apriori refactoring and made this PR. #5
Closing in the meantime. it will be possible to reapply the patch, if desired.

legalsylvain added a commit that referenced this pull request Dec 7, 2020
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