From 07a73facb27e1657b3333b092e3a6bf8ef241941 Mon Sep 17 00:00:00 2001 From: Edward Hartnett <38856240+edwardhartnett@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:35:09 -0600 Subject: [PATCH] fixed PEP8 F633, and PEP8 problems in the documentation build (#501) * fixed PEP8 F633 * ignore emacs backup files * fixed PEP8 warnings in documentation conf.py --- .github/workflows/pytest_flake8.yml | 2 +- .gitignore | 2 ++ doc/UsersGuide/source/conf.py | 15 +++++++-------- ush/rocoto/rocoto_viewer.py | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pytest_flake8.yml b/.github/workflows/pytest_flake8.yml index 528e79ee0..e06119046 100644 --- a/.github/workflows/pytest_flake8.yml +++ b/.github/workflows/pytest_flake8.yml @@ -32,7 +32,7 @@ jobs: - name: Lint with flake8 run: | # stop the build if there are Python syntax errors - flake8 . --count --select=E9,F7 --show-source --statistics + flake8 . --count --select=E9,F7,F6 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide #flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: pytest diff --git a/.gitignore b/.gitignore index ef1a9a627..33d8500f2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ ush/python_utils/__pycache__/ __pycache__ *.swp +.venv +*~ diff --git a/doc/UsersGuide/source/conf.py b/doc/UsersGuide/source/conf.py index 921014a0f..13131a2f6 100644 --- a/doc/UsersGuide/source/conf.py +++ b/doc/UsersGuide/source/conf.py @@ -16,8 +16,6 @@ import sys sys.path.insert(0, os.path.abspath('.')) - - # -- Project information ----------------------------------------------------- project = 'RRFS-Workflow Users Guide' @@ -56,7 +54,7 @@ ] bibtex_bibfiles = ['references.bib'] -#bibtex_bibfiles = ['refs.bib'] +# bibtex_bibfiles = ['refs.bib'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -104,10 +102,11 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -#html_static_path = [] +# html_static_path = [] html_static_path = ['_static'] html_context = {} + def setup(app): app.add_css_file('custom.css') # may also be an URL app.add_css_file('theme_overrides.css') # may also be a URL @@ -134,19 +133,19 @@ def setup(app): latex_engine = 'pdflatex' latex_elements = { # The paper size ('letterpaper' or 'a4paper'). - 'papersize': 'letterpaper', + 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). - 'pointsize': '11pt', + 'pointsize': '11pt', # Additional stuff for the LaTeX preamble. - 'preamble': r''' + 'preamble': r''' \usepackage{charter} \usepackage[defaultsans]{lato} \usepackage{inconsolata} ''', # Release name prefix - 'releasename': ' ', + 'releasename': ' ', # Latex figure (float) alignment # diff --git a/ush/rocoto/rocoto_viewer.py b/ush/rocoto/rocoto_viewer.py index 24269f986..cedbb1ee7 100755 --- a/ush/rocoto/rocoto_viewer.py +++ b/ush/rocoto/rocoto_viewer.py @@ -118,7 +118,7 @@ def sigwinch_handler(signum, frame): def usage(message=None): curses.endwin() - print>>sys.stderr, ''' + print(''' Usage: rocoto_status_viewer.py -w workflow.xml -d database.db [--listtasks]\n [--html=filename.html]\n [--perfmetrics={True,False}] Mandatory arguments: @@ -128,10 +128,10 @@ def usage(message=None): --listtasks --- print out a list of all tasks --html=filename.html --- creates an HTML document of status --perfmetrics=True --- turn on/off extra columns for performance metrics - --help --- print this usage message''' + --help --- print this usage message''', file=sys.stderr) if message is not None: - print>>sys.stderr,'\n'+str(message).rstrip()+'\n' + print('\n'+str(message).rstrip()+'\n', file=sys.stderr) sys.exit(-1) def augment_SQLite3(filename):