-
-
Notifications
You must be signed in to change notification settings - Fork 746
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
Remove --python3 option #5100
Remove --python3 option #5100
Conversation
Waiting for U16 to move to python3, and is also dependant on fixes in progress for cryptography and using python3 on ST tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep backwards compatibility for the CLI, since we haven't been emitting deprecation warnings for that. We can emit a warning when it is passed in, but we don't need to pass it to the ST2 API.
@blag We announced that we're removing python2 completely and users had that notice and time to migrate. This means we're removing all the python2-related functionality. I don't think keeping that old flag would help anymore, considering this behavior doesn't work and would just provide erroneous results. I think that'll bring confusion and false sense of a working feature. We had enough deprecation Warnings about full Python2 removal via:
This includes entire platform python2 feature set. |
The cli did have a warning. St2 pack install had a warning in 3.3 if you installed a python 2 pack. |
If my understanding is correct, then there's two warnings that should have been generated:
We definitely warned about Python 2 packs, but did we also warn about the removal of the Consider what people would have done in the past to ensure that their packs were always Python 3:
So now their pack still has to be installed with the Since we defaulted to installing packs as Python 2 for so long, people who are trying to do things right have been forced into using the If we up and remove this flag, the CLI will no longer recognize the flag and throw an error. That will cause those people's deployment scripts or whatever to immediately break. That's pretty rude of us - we are effectively penalizing people who have been doing things "right" and trying to switch to Python 3 for awhile. Instead, we should at least allow a grace period where we still accept that (now superfluous) If I have been operating under a misconception please correct me, but as I understand it, we should not break things for our best users. |
I think your understanding is correct, and I get your point as to why we should allow them to still use --python3 option with a warning. |
@amanda11 Per https://stackstorm-community.slack.com/archives/CSBELJ78A/p1608157605269500 discussion, I'm 👍 fine with @blag plan to keep the flag for one more release if there are concerns that python 2 removal/deprecation communication wasn't enough for this change. |
Conflicts: CHANGELOG.rst
@blag @armab I've kept in the --python3 option in the CLI, but I only kept it in the commands/pack.py. I didn't see any other print etc being done in the manager files, so I wasn't sure why we wanted to pass the argument through to the manager and do the prints in there, as all the other printing seems to be done in the commands/*.py files. Feedback appreciated on the code and warning text. Example output:
|
st2client/st2client/commands/pack.py
Outdated
@@ -210,7 +210,10 @@ def run(self, args, **kwargs): | |||
if not is_structured_output: | |||
self._get_content_counts_for_pack(args, **kwargs) | |||
|
|||
return self.manager.install(args.packs, python3=args.python3, force=args.force, | |||
if args.python3: | |||
print('\nDEPRECATION WARNING: --python3 flag will be ignored, as ST2 now runs with python3 as the default on all OS\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something along the lines would be more precise?
DEPRECATION WARNING: --python3 flag is ignored and will be removed in v3.5.0 as StackStorm now runs with python3 only
st2client/st2client/commands/pack.py
Outdated
@@ -210,7 +210,10 @@ def run(self, args, **kwargs): | |||
if not is_structured_output: | |||
self._get_content_counts_for_pack(args, **kwargs) | |||
|
|||
return self.manager.install(args.packs, python3=args.python3, force=args.force, | |||
if args.python3: | |||
print('\nDEPRECATION WARNING: --python3 flag is ignored and will be removed in v3.5.0 as StackStorm now runs with python3 only\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not use warnings.warn
here?
Rerunning end-to-end tests with this to ensure that StackStorm/st2tests#196 didn't break anything. |
@blag I fixed the lint problem as it also needed an import of warnings. Output using warnings is as follows:
|
Remove the --python3 option and associated python3_... config items.