From d8b41be7b7fa6bc83177f85e091c51356ec42780 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Tue, 12 Dec 2023 14:42:17 -0500 Subject: [PATCH 01/39] update pypi action to use OIDC trusted publisher mgmt --- .github/workflows/publish_to_pypi.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml index e36a321d5..26d6d01cd 100644 --- a/.github/workflows/publish_to_pypi.yml +++ b/.github/workflows/publish_to_pypi.yml @@ -51,12 +51,13 @@ jobs: - name: Publish to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 + permissions: + id-token: write with: - password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ - name: Publish to PyPI if: startsWith(github.ref, 'refs/tags') + permissions: + id-token: write uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} From 9945fe5ee6f00800cffcab60603c802a9f20c8ef Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 13 Dec 2023 17:05:10 -0500 Subject: [PATCH 02/39] run pre-commit autoupdate (updated black hook) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74a6e3028..86504bda0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 23.12.0 hooks: - id: black \ No newline at end of file From 9c4391133936d40259ab12ed3998dc0467056df6 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 13 Dec 2023 17:06:31 -0500 Subject: [PATCH 03/39] add note on how to autoupdate hooks --- .pre-commit-config.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 86504bda0..57a5b81bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,4 +2,6 @@ repos: - repo: https://github.com/psf/black rev: 23.12.0 hooks: - - id: black \ No newline at end of file + - id: black + +# you can run `pre-commit autoupdate` to automatically update to the latest version of hooks! \ No newline at end of file From 4e317ff91d8591dca0f39774aadb108fcdbb7ad1 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 13 Dec 2023 17:13:35 -0500 Subject: [PATCH 04/39] update flake8 action --- .github/workflows/flake8_action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flake8_action.yml b/.github/workflows/flake8_action.yml index 2e754ad33..c9b847d12 100644 --- a/.github/workflows/flake8_action.yml +++ b/.github/workflows/flake8_action.yml @@ -1,17 +1,17 @@ # use the flake8 linter to annotate improperly formatted code -# from: https://github.com/marketplace/actions/run-flake8-on-your-pr-with-annotations name: Run flake8 linter on PRs on: pull_request: branches: - development - - master + - main jobs: build: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Annotate PR after running flake8 - uses: TrueBrain/actions-flake8@master + uses: TrueBrain/actions-flake8@v2 with: max_line_length: 88 From cfc9a6774980105310b6dc415c424bd0ded9731d Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 13 Dec 2023 17:20:56 -0500 Subject: [PATCH 05/39] add black to linter action --- .../workflows/{flake8_action.yml => linter_actions.yml} | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename .github/workflows/{flake8_action.yml => linter_actions.yml} (62%) diff --git a/.github/workflows/flake8_action.yml b/.github/workflows/linter_actions.yml similarity index 62% rename from .github/workflows/flake8_action.yml rename to .github/workflows/linter_actions.yml index c9b847d12..2bc91db4a 100644 --- a/.github/workflows/flake8_action.yml +++ b/.github/workflows/linter_actions.yml @@ -1,5 +1,4 @@ -# use the flake8 linter to annotate improperly formatted code -name: Run flake8 linter on PRs +name: Run linters on PRs on: pull_request: @@ -7,10 +6,13 @@ on: - development - main jobs: - build: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Run black linter + uses: psf/black@stable + # use the flake8 linter to annotate improperly formatted code - name: Annotate PR after running flake8 uses: TrueBrain/actions-flake8@v2 with: From c1ddd08dda6a7d893e6f0f2931306e813fe43f27 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 13 Dec 2023 17:39:32 -0500 Subject: [PATCH 06/39] add dev branch tag for uml diagrams --- .github/workflows/uml_action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/uml_action.yml b/.github/workflows/uml_action.yml index ba893e5e9..db0a59fa6 100644 --- a/.github/workflows/uml_action.yml +++ b/.github/workflows/uml_action.yml @@ -2,6 +2,7 @@ name: Update UML diagrams on: pull_request_review: types: [submitted] + branches: development jobs: diagrams: From a689312981ce92c2f815bfbcbb4e5e0b08a430bc Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Wed, 13 Dec 2023 17:49:01 -0500 Subject: [PATCH 07/39] run black on docs --- doc/sphinxext/announce.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/sphinxext/announce.py b/doc/sphinxext/announce.py index 21bf7a69e..6a4264349 100644 --- a/doc/sphinxext/announce.py +++ b/doc/sphinxext/announce.py @@ -76,7 +76,6 @@ def get_authors(revision_range): # "Co-authored by" commits, which come from backports by the bot, # and one for regular commits. if ".mailmap" in os.listdir(this_repo.git.working_dir): - xpr = re.compile(r"Co-authored-by: (?P[^<]+) ") gitcur = list(os.popen("git shortlog -s " + revision_range).readlines()) @@ -94,7 +93,6 @@ def get_authors(revision_range): pre = set(pre) else: - xpr = re.compile(r"Co-authored-by: (?P[^<]+) ") cur = set( xpr.findall( From cc5c08408e6d597a5dcec692e3311abb0701978d Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 11:04:45 -0500 Subject: [PATCH 08/39] ignore init module unused error in flake8 linting --- .github/workflows/linter_actions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 2bc91db4a..6b2a2dece 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -17,3 +17,5 @@ jobs: uses: TrueBrain/actions-flake8@v2 with: max_line_length: 88 + per-file-ignores: + icepyx/*/__init__.py:F401 From 752b6837612f41353189e22b7014e6a0a11b4271 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 11:26:53 -0500 Subject: [PATCH 09/39] fix syntax --- .github/workflows/linter_actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 6b2a2dece..66014e28e 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -17,5 +17,5 @@ jobs: uses: TrueBrain/actions-flake8@v2 with: max_line_length: 88 - per-file-ignores: - icepyx/*/__init__.py:F401 + extra_arguments: + "per-file-ignores icepyx/*/__init__.py:F401" From 901d73ec7432c936a69b201c5b9c0d5c9ef96081 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 11:28:56 -0500 Subject: [PATCH 10/39] fix syntax again --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 66014e28e..ac4cd8428 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - "per-file-ignores icepyx/*/__init__.py:F401" + "--per-file-ignores='icepyx/*/__init__.py:F401'" From 36b33dce69768f84f4d5a15ea82d4c435e7954cc Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 11:57:23 -0500 Subject: [PATCH 11/39] try changing path syntax --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index ac4cd8428..55e27f5ce 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - "--per-file-ignores='icepyx/*/__init__.py:F401'" + "--per-file-ignores='../*/__init__.py:F401'" From 233b7abb44a92c04ddcca3c58a4bea8077cd6728 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 12:01:58 -0500 Subject: [PATCH 12/39] try another glob pattern --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 55e27f5ce..2cd976416 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - "--per-file-ignores='../*/__init__.py:F401'" + "--per-file-ignores='*/__init__.py:F401'" From bdf35133f3849721c5c4cfbe2aaffee1484a1c25 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 12:41:20 -0500 Subject: [PATCH 13/39] try a different grep path --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 2cd976416..3073c976c 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - "--per-file-ignores='*/__init__.py:F401'" + "--per-file-ignores='../**/__init__.py:F401'" From 69643dc865f6acaa3ced18f7766cdac90d9fbb32 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 13:02:58 -0500 Subject: [PATCH 14/39] fix directory level relative path --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 3073c976c..3fa3ef34f 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - "--per-file-ignores='../**/__init__.py:F401'" + "--per-file-ignores='../../*/__init__.py:F401'" From 847fc34229a2cb316cb91b8786b4f114847036b2 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 13:12:30 -0500 Subject: [PATCH 15/39] try with no path --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 3fa3ef34f..9afd13f9e 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - "--per-file-ignores='../../*/__init__.py:F401'" + "--per-file-ignores='__init__.py:F401'" From 6fc265c093b9076862ec612ea45255ad4de06239 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 13:20:05 -0500 Subject: [PATCH 16/39] try without quotes --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 9afd13f9e..bc5a88392 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - "--per-file-ignores='__init__.py:F401'" + - --per-file-ignores='__init__.py:F401' From 18145859635980349772143941a322a6f90e9b50 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 13:21:50 -0500 Subject: [PATCH 17/39] try with no quotes whatsoever --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index bc5a88392..2424b14be 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - - --per-file-ignores='__init__.py:F401' + - --per-file-ignores=__init__.py:F401 From c4ddb79009d1f638768444bca93e6b30b838594e Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 13:22:50 -0500 Subject: [PATCH 18/39] and now also without the dash --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 2424b14be..8f612a365 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - - --per-file-ignores=__init__.py:F401 + --per-file-ignores=__init__.py:F401 From a67dae278fac738d892a23c811f041176311a44f Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 14 Dec 2023 16:50:13 -0500 Subject: [PATCH 19/39] add exception for long lines in test_granules --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 8f612a365..a5d69bee6 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - --per-file-ignores=__init__.py:F401 + --per-file-ignores=__init__.py:F401 test_granules.py:E501 From 0e32170c68d6add55012a188db39130051dde862 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 15 Dec 2023 15:47:59 -0500 Subject: [PATCH 20/39] try different syntax for multiple per-file-ignores --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index a5d69bee6..7f6469427 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - --per-file-ignores=__init__.py:F401 test_granules.py:E501 + --per-file-ignores='__init__.py:F401 test_granules.py:E501' From 21ba0069a899c849eb29fab6ae7359744d1d4331 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 15 Dec 2023 15:50:25 -0500 Subject: [PATCH 21/39] try with just granules file --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 7f6469427..faf5024c2 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - --per-file-ignores='__init__.py:F401 test_granules.py:E501' + --per-file-ignores=test_granules.py:E501 From 8696e96c50fccffa95ece8788589d044c16a70ff Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 15 Dec 2023 15:51:53 -0500 Subject: [PATCH 22/39] use argument for both sets of files --- .github/workflows/linter_actions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index faf5024c2..c7e028db4 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,5 @@ jobs: with: max_line_length: 88 extra_arguments: + --per-file-ignores=__init__.py:F401 --per-file-ignores=test_granules.py:E501 From aa1ed8e60264668b1debe90a3c2bedf5182cfa77 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 15 Dec 2023 15:54:05 -0500 Subject: [PATCH 23/39] try to capture all init files --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index c7e028db4..b74b25ab1 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,5 +18,5 @@ jobs: with: max_line_length: 88 extra_arguments: - --per-file-ignores=__init__.py:F401 + --per-file-ignores=*/__init__.py:F401 --per-file-ignores=test_granules.py:E501 From 6e165f9aeacaa7792a0018d999db009e2d976c0a Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 15 Dec 2023 15:55:22 -0500 Subject: [PATCH 24/39] see if it catches all init files without second argument --- .github/workflows/linter_actions.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index b74b25ab1..8f612a365 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,5 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - --per-file-ignores=*/__init__.py:F401 - --per-file-ignores=test_granules.py:E501 + --per-file-ignores=__init__.py:F401 From 30bd7922c21ceaacc3869793cb0c734887510437 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 15 Dec 2023 16:00:09 -0500 Subject: [PATCH 25/39] make whole extra argument that works locally a string --- .github/workflows/linter_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 8f612a365..fe5c2364d 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - --per-file-ignores=__init__.py:F401 + "--per-file-ignores=__init__.py:F401 test_granules.py:E501" From e96d820d0055173eba36cb5d73758e1ba7e88509 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 15 Dec 2023 16:05:56 -0500 Subject: [PATCH 26/39] try with each per file ignores on newline --- .github/workflows/linter_actions.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index fe5c2364d..0b30e5fb7 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,4 +18,6 @@ jobs: with: max_line_length: 88 extra_arguments: - "--per-file-ignores=__init__.py:F401 test_granules.py:E501" + --per-file-ignores= + __init__.py:F401 + test_granules.py:E501 From 0cc13ee3f6e098d73ced6ad40235b7f9cee3ee5f Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 15 Dec 2023 16:07:28 -0500 Subject: [PATCH 27/39] try adding quotes to newlined version --- .github/workflows/linter_actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index 0b30e5fb7..cc14ad903 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -19,5 +19,5 @@ jobs: max_line_length: 88 extra_arguments: --per-file-ignores= - __init__.py:F401 - test_granules.py:E501 + '__init__.py:F401 + test_granules.py:E501' From ffe638002c4f0cb197d7dc00eeffeb3daec1141f Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Fri, 15 Dec 2023 16:21:06 -0500 Subject: [PATCH 28/39] comment out second ignore specification for now --- .github/workflows/linter_actions.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index cc14ad903..c1f46dac6 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -18,6 +18,4 @@ jobs: with: max_line_length: 88 extra_arguments: - --per-file-ignores= - '__init__.py:F401 - test_granules.py:E501' + --per-file-ignores=__init__.py:F401 #test_granules.py:E501 From 3b17b84f7a27b655f464332cd369a761481093fd Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Mon, 18 Dec 2023 15:44:46 -0500 Subject: [PATCH 29/39] switch to using .flake8 config file --- .flake8 | 9 +++++++++ .github/workflows/linter_actions.yml | 6 ++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..3cf4ef838 --- /dev/null +++ b/.flake8 @@ -0,0 +1,9 @@ +[flake8] +max_line_length = 88 +per-file-ignores = + # too many leading '#' for block comment + test/*:E266 + # line too long (several test strs) + test_granules.py:E501 + # imported but unused + __init__.py:F401 \ No newline at end of file diff --git a/.github/workflows/linter_actions.yml b/.github/workflows/linter_actions.yml index c1f46dac6..dc3836536 100644 --- a/.github/workflows/linter_actions.yml +++ b/.github/workflows/linter_actions.yml @@ -13,9 +13,7 @@ jobs: - name: Run black linter uses: psf/black@stable # use the flake8 linter to annotate improperly formatted code + # note linter arguments are supplied via the .flake8 config file - name: Annotate PR after running flake8 uses: TrueBrain/actions-flake8@v2 - with: - max_line_length: 88 - extra_arguments: - --per-file-ignores=__init__.py:F401 #test_granules.py:E501 + From e4c847323ce937c571e04d072e5e7f0fbc591413 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Mon, 18 Dec 2023 15:48:39 -0500 Subject: [PATCH 30/39] fix tests dir typo --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 3cf4ef838..c175e2e83 100644 --- a/.flake8 +++ b/.flake8 @@ -2,7 +2,7 @@ max_line_length = 88 per-file-ignores = # too many leading '#' for block comment - test/*:E266 + tests/*:E266 # line too long (several test strs) test_granules.py:E501 # imported but unused From 5e97518e2da7d7a5d44ef2d5c979f38082d21dfe Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Mon, 18 Dec 2023 15:50:27 -0500 Subject: [PATCH 31/39] fix tests path --- .flake8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index c175e2e83..56b31e85f 100644 --- a/.flake8 +++ b/.flake8 @@ -2,7 +2,7 @@ max_line_length = 88 per-file-ignores = # too many leading '#' for block comment - tests/*:E266 + */tests/*:E266 # line too long (several test strs) test_granules.py:E501 # imported but unused From 6bf17aa43b4ca1ebf7eb942d0b27f2502bb3d7f9 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 11:25:22 -0500 Subject: [PATCH 32/39] update flake8 settings to be more lenient --- .flake8 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index 56b31e85f..92e9fa421 100644 --- a/.flake8 +++ b/.flake8 @@ -1,9 +1,14 @@ [flake8] -max_line_length = 88 +#GOAL: max_line_length = 79 or 99 +max_line_length = 150 per-file-ignores = # too many leading '#' for block comment */tests/*:E266 # line too long (several test strs) test_granules.py:E501 # imported but unused - __init__.py:F401 \ No newline at end of file + __init__.py:F401 + + # GOAL: + # syntax check doctests in docstrings + # doctests = True \ No newline at end of file From 0b2306dabd8253c47cd8f5d3c06b1e78a362afa1 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 13:47:39 -0500 Subject: [PATCH 33/39] update a few doc config files to remove more linting errors --- doc/source/conf.py | 5 +++-- doc/sphinxext/announce.py | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 0bc0003a6..a77670850 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -10,12 +10,12 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # +import datetime import os import sys sys.path.insert(0, os.path.abspath("../..")) sys.path.insert(0, os.path.abspath("../sphinxext")) -import datetime import icepyx @@ -121,7 +121,8 @@ def setup(app): # this should possibly be moved to the sphinxext directory as a standalone .py file # -- custom style for pybtex output ------------------------------------------- from pybtex.style.formatting.unsrt import Style as UnsrtStyle -from pybtex.style.labels.alpha import LabelStyle as AlphaLabelStyle + +# from pybtex.style.labels.alpha import LabelStyle as AlphaLabelStyle from pybtex.plugin import register_plugin # I seem to be unable to figure out how to control what is used for the label. It would diff --git a/doc/sphinxext/announce.py b/doc/sphinxext/announce.py index 6a4264349..db6858678 100644 --- a/doc/sphinxext/announce.py +++ b/doc/sphinxext/announce.py @@ -17,9 +17,20 @@ The output is utf8 rst. -Custom extension from the Pandas library: https://github.com/pandas-dev/pandas/blob/1.1.x/doc/sphinxext/announce.py +Custom extension from the Pandas library: +https://github.com/pandas-dev/pandas/blob/1.1.x/doc/sphinxext/announce.py Copied 10 August 2020 and subsequently modified. -Specifically, get_authors was adjusted to check for a .mailmap file and use the git through the command line in order to utilize it if present. Using a mailmap file is currently not possible in gitpython (from git import Repo), and the recommended solution is to bring in the mailmap file yourself and use it to modify the author list (i.e. replicate the functionality that already exists in git). This felt a bit out of time-scope for right now. Alternatively, the git-fame library (imported as gitfame) uses the mailmap file and compiles statistics, but the python wrapper for this command line tool was taking forever. So, I've reverted to using os.system to use git behind the scenes instead. +Specifically, get_authors was adjusted to check for a .mailmap file +and use the git through the command line in order to utilize it if present. +Using a mailmap file is currently not possible in gitpython +(from git import Repo), and the recommended solution is to +bring in the mailmap file yourself and use it to modify the author list +(i.e. replicate the functionality that already exists in git). +This felt a bit out of time-scope for right now. +Alternatively, the git-fame library (imported as gitfame) +uses the mailmap file and compiles statistics, +but the python wrapper for this command line tool was taking forever. +So, I've reverted to using os.system to use git behind the scenes instead. Dependencies ------------ From df1fc71b9b5df958e0e21700ffb59c82a001b91e Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 13:48:05 -0500 Subject: [PATCH 34/39] reduce max line length and add ignore for failing codes --- .flake8 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 92e9fa421..e0336a16d 100644 --- a/.flake8 +++ b/.flake8 @@ -1,6 +1,6 @@ [flake8] #GOAL: max_line_length = 79 or 99 -max_line_length = 150 +max_line_length = 99 per-file-ignores = # too many leading '#' for block comment */tests/*:E266 @@ -8,6 +8,18 @@ per-file-ignores = test_granules.py:E501 # imported but unused __init__.py:F401 + # import not at top of file + doc/source/conf.py:E402 + +# GOAL: remove these ignores +ignore = + E501 # line too long + E711 # comparison syntax + E712 # comparison syntax + E714 # comparison syntax in tests + E722 # bare except + F401 # imported but unused + F841 # assigned and unused (in tests) # GOAL: # syntax check doctests in docstrings From 752328eaa78ba70d02d09eddc967caf240ad793a Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 13:50:40 -0500 Subject: [PATCH 35/39] add extra line --- .flake8 | 1 + 1 file changed, 1 insertion(+) diff --git a/.flake8 b/.flake8 index e0336a16d..8d4752f70 100644 --- a/.flake8 +++ b/.flake8 @@ -21,6 +21,7 @@ ignore = F401 # imported but unused F841 # assigned and unused (in tests) + # GOAL: # syntax check doctests in docstrings # doctests = True \ No newline at end of file From 1ddcf9af2e00a79a438bbda469a90b44c8ff7a6f Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 13:51:34 -0500 Subject: [PATCH 36/39] unindent comment --- .flake8 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.flake8 b/.flake8 index 8d4752f70..99718034d 100644 --- a/.flake8 +++ b/.flake8 @@ -21,7 +21,6 @@ ignore = F401 # imported but unused F841 # assigned and unused (in tests) - - # GOAL: - # syntax check doctests in docstrings - # doctests = True \ No newline at end of file +# GOAL: +# syntax check doctests in docstrings +# doctests = True \ No newline at end of file From 00b0784468873c6458bbbfb71572dda1ee547a28 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 13:53:10 -0500 Subject: [PATCH 37/39] move goal comment --- .flake8 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.flake8 b/.flake8 index 99718034d..2820cd8e6 100644 --- a/.flake8 +++ b/.flake8 @@ -11,6 +11,10 @@ per-file-ignores = # import not at top of file doc/source/conf.py:E402 + # GOAL: + # syntax check doctests in docstrings + # doctests = True + # GOAL: remove these ignores ignore = E501 # line too long @@ -19,8 +23,4 @@ ignore = E714 # comparison syntax in tests E722 # bare except F401 # imported but unused - F841 # assigned and unused (in tests) - -# GOAL: -# syntax check doctests in docstrings -# doctests = True \ No newline at end of file + F841 # assigned and unused (in tests) \ No newline at end of file From 45e6c675a58b24006dc5d446263c5f9abae15d69 Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 13:55:50 -0500 Subject: [PATCH 38/39] put comments on separate lines --- .flake8 | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.flake8 b/.flake8 index 2820cd8e6..4c151d41e 100644 --- a/.flake8 +++ b/.flake8 @@ -11,16 +11,23 @@ per-file-ignores = # import not at top of file doc/source/conf.py:E402 - # GOAL: - # syntax check doctests in docstrings - # doctests = True - # GOAL: remove these ignores ignore = - E501 # line too long - E711 # comparison syntax - E712 # comparison syntax - E714 # comparison syntax in tests - E722 # bare except - F401 # imported but unused - F841 # assigned and unused (in tests) \ No newline at end of file + # line too long + E501 + # comparison syntax + E711 + # comparison syntax + E712 + # comparison syntax in tests + E714 + # bare except + E722 + # imported but unused + F401 + # assigned and unused (in tests) + F841 + + # GOAL: + # syntax check doctests in docstrings + # doctests = True \ No newline at end of file From 6e74f0d434298120ebeae4d0d0ef28955f60d13c Mon Sep 17 00:00:00 2001 From: Jessica Scheick Date: Thu, 4 Jan 2024 13:58:21 -0500 Subject: [PATCH 39/39] add more tests to ignore --- .flake8 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.flake8 b/.flake8 index 4c151d41e..16b39f3fe 100644 --- a/.flake8 +++ b/.flake8 @@ -21,12 +21,20 @@ ignore = E712 # comparison syntax in tests E714 + # comparison syntax in tests + E721 # bare except E722 + # ambiguous var name + E741 # imported but unused F401 + # unable to detect undefined names + F403 # assigned and unused (in tests) F841 + # line break before binary operator + W503 # GOAL: # syntax check doctests in docstrings