-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
argparse migration for cmsDriver and FWCore #43042
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43042/37228
|
A new Pull Request was created by @kpedro88 (Kevin Pedro) for master. It involves the following packages:
@makortel, @antoniovilela, @smuzaffar, @davidlange6, @fabiocos, @cmsbuild, @Dr15Jones, @rappoccio can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
from Configuration.Applications.Options import parser | ||
|
||
options = parser.parse_args(items) | ||
print(options) |
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.
was this just for debugging?
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.
yes, let me just rebase that right out of there...
fa5a1e4
to
19102b3
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43042/37231
|
Pull request #43042 was updated. @antoniovilela, @davidlange6, @Dr15Jones, @fabiocos, @makortel, @rappoccio, @smuzaffar, @cmsbuild can you please check and sign again. |
@@ -4,15 +4,18 @@ | |||
# dictionaries or escape characters | |||
|
|||
from __future__ import print_function |
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.
could this line go away?
@@ -2,54 +2,55 @@ | |||
|
|||
from __future__ import print_function |
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.
obsolete?
@@ -2,30 +2,27 @@ | |||
|
|||
from __future__ import print_function |
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.
obsolete?
@@ -2,34 +2,34 @@ | |||
|
|||
from __future__ import print_function |
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.
obsolete?
@@ -2,27 +2,25 @@ | |||
|
|||
from __future__ import print_function |
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.
obsolete?
@@ -14,17 +13,6 @@ def run(): | |||
# after cleanup of all config parameters pass it to the ConfigBuilder | |||
configBuilder = ConfigBuilder(options, with_output = True, with_input = True) | |||
|
|||
# Switch on any eras that have been specified. This is not required to create |
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.
Where did the era handling go? Or was this not actually needed?
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.
It was obsoleted by #39127.
@@ -2,21 +2,18 @@ | |||
|
|||
from __future__ import print_function |
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.
obsolete?
@@ -2,11 +2,10 @@ | |||
|
|||
from __future__ import print_function |
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.
obsolete?
@@ -1,6 +1,5 @@ | |||
#! /usr/bin/env python3 | |||
from __future__ import print_function |
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.
obsolete?
I wouldn't have commented about the |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43042/37238
|
Pull request #43042 was updated. @makortel, @smuzaffar, @Dr15Jones, @rappoccio, @davidlange6, @antoniovilela, @cmsbuild, @fabiocos can you please check and sign again. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-84c5f6/35274/summary.html Comparison SummarySummary:
|
+core |
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will be automatically merged. |
PR description:
See #29338.
optparse
has been deprecated for many years.argparse
offers many functionality improvements, including (relevant to this PR in particular):While I cannot personally take on migrating every script in CMSSW, at least our most-used common tools should reflect best practices.
In addition, in the course of doing this migration, I fixed various typos and a few stray python3 migration issues.
PR validation:
Ran each script to ensure it still works. Unit tests pass.
If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:
Unlikely to be backported.