From 8de751c47f3e6e04d8502216b27852bf4cb4ea5c Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 09:53:22 -0700 Subject: [PATCH 01/30] added names-to-skip to conftest --- tests/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index f1f4570..0b2b0dd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4,10 +4,13 @@ def pytest_addoption(parser): parser.addoption("--package", action="store") + parser.addoption("--names-to-skip", action="store", default="") def pytest_generate_tests(metafunc): package_name = metafunc.config.getoption("--package") + names_to_skip = metafunc.config.getoption("--names-to-skip") + names_to_skip = names_to_skip.split(",") if names_to_skip else [] package = import_module(package_name) - objs = traverse_package(package, package_name) + objs = traverse_package(package, package_name, names_to_skip=names_to_skip) if "obj" in metafunc.fixturenames: metafunc.parametrize("obj", objs) \ No newline at end of file From 55c2daa73b440d5e1a3a9a2a8ab0e6a742e6f693 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 10:01:41 -0700 Subject: [PATCH 02/30] passed names-to-skip along through traversal methods --- tests/traverse.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/traverse.py b/tests/traverse.py index adbcc46..fca0b29 100644 --- a/tests/traverse.py +++ b/tests/traverse.py @@ -55,7 +55,7 @@ def traverse_module(module: ModuleType, parent: str, names_to_skip: Optional[Lis if isinstance(object_, type) and object_.__module__.startswith(parent): # class class_object = object_ - class_functions = traverse_class(class_object=class_object, parent=parent) + class_functions = traverse_class(class_object=class_object, parent=parent, names_to_skip=names_to_skip) local_classes_and_functions.append(class_object) local_classes_and_functions.extend(class_functions) @@ -97,13 +97,13 @@ def traverse_package(package: ModuleType, parent: str, names_to_skip: Optional[L and object_.__package__.startswith(parent) ): subpackage = object_ - subpackage_members = traverse_package(package=subpackage, parent=parent) + subpackage_members = traverse_package(package=subpackage, parent=parent, names_to_skip=names_to_skip) local_packages_and_modules.append(subpackage) local_packages_and_modules.extend(subpackage_members) elif isinstance(object_, ModuleType) and object_.__package__.startswith(parent): module = object_ - module_members = traverse_module(module=module, parent=parent) + module_members = traverse_module(module=module, parent=parent, names_to_skip=names_to_skip) local_packages_and_modules.append(module) local_packages_and_modules.extend(module_members) From f254dc8c1ca874926bf40d9f9ba5e0df2375a81d Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 10:09:35 -0700 Subject: [PATCH 03/30] added names-to-skip to workflows --- .github/workflows/call_check_docstrings.yaml | 5 +++-- .github/workflows/check_docstrings.yaml | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml index 556d9d6..5e7aa4f 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/call_check_docstrings.yaml @@ -4,8 +4,9 @@ on: jobs: check-docstrings: - uses: catalystneuro/.github/.github/workflows/check_docstrings.yaml@main + uses: catalystneuro/.github/.github/workflows/check_docstrings.yaml@test_check_docstrings with: python-version: '3.10' repository: 'catalystneuro/roiextractors' - package-name: 'roiextractors' \ No newline at end of file + package-name: 'roiextractors' + names-to-skip: 'skipped_fn' \ No newline at end of file diff --git a/.github/workflows/check_docstrings.yaml b/.github/workflows/check_docstrings.yaml index 93c574a..3bdd0e2 100644 --- a/.github/workflows/check_docstrings.yaml +++ b/.github/workflows/check_docstrings.yaml @@ -15,6 +15,11 @@ on: description: 'The name of the package to check the docstrings for.' required: True type: string + names-to-skip: + description: 'The names of the modules/classes/functions/methods to skip in the docstring check.' + required: false + type: string + default: '' jobs: run: @@ -49,4 +54,4 @@ jobs: repository: catalystneuro/.github - name: Run docstring check - run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} \ No newline at end of file + run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} \ No newline at end of file From be55af505c694ac688c1009888c5f154d94e2f37 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 10:12:31 -0700 Subject: [PATCH 04/30] corrected names --- .github/workflows/call_check_docstrings.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml index 5e7aa4f..9479bf5 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/call_check_docstrings.yaml @@ -4,9 +4,9 @@ on: jobs: check-docstrings: - uses: catalystneuro/.github/.github/workflows/check_docstrings.yaml@test_check_docstrings + uses: catalystneuro/.github/.github/workflows/check_docstrings.yaml@relax_docstrings with: python-version: '3.10' - repository: 'catalystneuro/roiextractors' + repository: 'catalystneuro/roiextractors@test_check_docstrings' package-name: 'roiextractors' names-to-skip: 'skipped_fn' \ No newline at end of file From 40a9b4b51b01387ce5cb6d602c4b17b7811b9b45 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 10:25:51 -0700 Subject: [PATCH 05/30] added branch option --- .github/workflows/call_check_docstrings.yaml | 3 ++- .github/workflows/check_docstrings.yaml | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml index 9479bf5..c4adf60 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/call_check_docstrings.yaml @@ -7,6 +7,7 @@ jobs: uses: catalystneuro/.github/.github/workflows/check_docstrings.yaml@relax_docstrings with: python-version: '3.10' - repository: 'catalystneuro/roiextractors@test_check_docstrings' + repository: 'catalystneuro/roiextractors' + branch: 'test_check_docstrings' package-name: 'roiextractors' names-to-skip: 'skipped_fn' \ No newline at end of file diff --git a/.github/workflows/check_docstrings.yaml b/.github/workflows/check_docstrings.yaml index 3bdd0e2..74fbbc9 100644 --- a/.github/workflows/check_docstrings.yaml +++ b/.github/workflows/check_docstrings.yaml @@ -11,6 +11,11 @@ on: description: 'The repository to check the docstrings for.' required: True type: string + branch: + description: 'The branch to check the docstrings for.' + required: false + type: string + default: '' package-name: description: 'The name of the package to check the docstrings for.' required: True @@ -44,6 +49,7 @@ jobs: uses: actions/checkout@v2 with: repository: ${{ inputs.repository }} + ref: ${{ inputs.branch }} - name: Install package run: pip install . From a4279f4074beb92ee890bc76bd2368b1f583a51f Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 10:44:55 -0700 Subject: [PATCH 06/30] converted check_docstrings.yaml to an action --- .github/actions/check_docstrings.yaml | 60 ++++++++++++++++++++ .github/workflows/call_check_docstrings.yaml | 2 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .github/actions/check_docstrings.yaml diff --git a/.github/actions/check_docstrings.yaml b/.github/actions/check_docstrings.yaml new file mode 100644 index 0000000..1b6bd37 --- /dev/null +++ b/.github/actions/check_docstrings.yaml @@ -0,0 +1,60 @@ +name: Check Docstrings +inputs: + python-version: + description: 'The version of Python to use for the workflow.' + default: '3.10' + required: false + type: string + repository: + description: 'The repository to check the docstrings for.' + required: True + type: string + branch: + description: 'The branch to check the docstrings for.' + required: false + type: string + default: '' + package-name: + description: 'The name of the package to check the docstrings for.' + required: True + type: string + names-to-skip: + description: 'The names of the modules/classes/functions/methods to skip in the docstring check.' + required: false + type: string + default: '' + +runs: + using: "composite" + steps: + - name: Setup Conda + uses: s-weigand/setup-conda@v1 + + - name: Setup Python ${{ inputs.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ inputs.python-version }} + + - name: Global Setup + run: | + pip install -U pip + pip install pytest-xdist + git config --global user.email "CI@example.com" + git config --global user.name "CI Almighty" + + - name: Checkout Repository to be tested + uses: actions/checkout@v2 + with: + repository: ${{ inputs.repository }} + ref: ${{ inputs.branch }} + + - name: Install package + run: pip install . + + - name: Checkout Home Repository + uses: actions/checkout@v2 + with: + repository: catalystneuro/.github + + - name: Run docstring check + run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} \ No newline at end of file diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml index c4adf60..c49a073 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/call_check_docstrings.yaml @@ -4,7 +4,7 @@ on: jobs: check-docstrings: - uses: catalystneuro/.github/.github/workflows/check_docstrings.yaml@relax_docstrings + uses: catalystneuro/.github/.github/actions/check_docstrings.yaml@relax_docstrings with: python-version: '3.10' repository: 'catalystneuro/roiextractors' From dc9976973a28b9a0dc454b83a412e15aa734a5d8 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 10:51:16 -0700 Subject: [PATCH 07/30] moved actions folder outside .github --- .github/workflows/call_check_docstrings.yaml | 2 +- {.github/actions => actions}/check_docstrings.yaml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {.github/actions => actions}/check_docstrings.yaml (100%) diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml index c49a073..dc67ed9 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/call_check_docstrings.yaml @@ -4,7 +4,7 @@ on: jobs: check-docstrings: - uses: catalystneuro/.github/.github/actions/check_docstrings.yaml@relax_docstrings + uses: catalystneuro/.github/actions/check_docstrings.yaml@relax_docstrings with: python-version: '3.10' repository: 'catalystneuro/roiextractors' diff --git a/.github/actions/check_docstrings.yaml b/actions/check_docstrings.yaml similarity index 100% rename from .github/actions/check_docstrings.yaml rename to actions/check_docstrings.yaml From 81cf696d30a203d02b143b843a20cc9bb179d285 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 14:31:22 -0700 Subject: [PATCH 08/30] testing actions.yaml --- .github/workflows/call_check_docstrings.yaml | 2 +- actions.yaml | 60 ++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 actions.yaml diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml index dc67ed9..08c0cdd 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/call_check_docstrings.yaml @@ -4,7 +4,7 @@ on: jobs: check-docstrings: - uses: catalystneuro/.github/actions/check_docstrings.yaml@relax_docstrings + uses: catalystneuro/.github@relax_docstrings with: python-version: '3.10' repository: 'catalystneuro/roiextractors' diff --git a/actions.yaml b/actions.yaml new file mode 100644 index 0000000..1b6bd37 --- /dev/null +++ b/actions.yaml @@ -0,0 +1,60 @@ +name: Check Docstrings +inputs: + python-version: + description: 'The version of Python to use for the workflow.' + default: '3.10' + required: false + type: string + repository: + description: 'The repository to check the docstrings for.' + required: True + type: string + branch: + description: 'The branch to check the docstrings for.' + required: false + type: string + default: '' + package-name: + description: 'The name of the package to check the docstrings for.' + required: True + type: string + names-to-skip: + description: 'The names of the modules/classes/functions/methods to skip in the docstring check.' + required: false + type: string + default: '' + +runs: + using: "composite" + steps: + - name: Setup Conda + uses: s-weigand/setup-conda@v1 + + - name: Setup Python ${{ inputs.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ inputs.python-version }} + + - name: Global Setup + run: | + pip install -U pip + pip install pytest-xdist + git config --global user.email "CI@example.com" + git config --global user.name "CI Almighty" + + - name: Checkout Repository to be tested + uses: actions/checkout@v2 + with: + repository: ${{ inputs.repository }} + ref: ${{ inputs.branch }} + + - name: Install package + run: pip install . + + - name: Checkout Home Repository + uses: actions/checkout@v2 + with: + repository: catalystneuro/.github + + - name: Run docstring check + run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} \ No newline at end of file From 70f03e2b875600593208b60ff135a3b5a54987e4 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 14:38:53 -0700 Subject: [PATCH 09/30] testing action.yml --- .github/workflows/call_check_docstrings.yaml | 18 +++--- actions.yaml | 60 -------------------- 2 files changed, 11 insertions(+), 67 deletions(-) delete mode 100644 actions.yaml diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml index 08c0cdd..f069215 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/call_check_docstrings.yaml @@ -4,10 +4,14 @@ on: jobs: check-docstrings: - uses: catalystneuro/.github@relax_docstrings - with: - python-version: '3.10' - repository: 'catalystneuro/roiextractors' - branch: 'test_check_docstrings' - package-name: 'roiextractors' - names-to-skip: 'skipped_fn' \ No newline at end of file + runs-on: ubuntu-latest + name: Check Docstrings + steps: + - id: check_docstrings + uses: catalystneuro/.github@relax_docstrings + with: + python-version: '3.10' + repository: 'catalystneuro/roiextractors' + branch: 'test_check_docstrings' + package-name: 'roiextractors' + names-to-skip: 'skipped_fn' \ No newline at end of file diff --git a/actions.yaml b/actions.yaml deleted file mode 100644 index 1b6bd37..0000000 --- a/actions.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: Check Docstrings -inputs: - python-version: - description: 'The version of Python to use for the workflow.' - default: '3.10' - required: false - type: string - repository: - description: 'The repository to check the docstrings for.' - required: True - type: string - branch: - description: 'The branch to check the docstrings for.' - required: false - type: string - default: '' - package-name: - description: 'The name of the package to check the docstrings for.' - required: True - type: string - names-to-skip: - description: 'The names of the modules/classes/functions/methods to skip in the docstring check.' - required: false - type: string - default: '' - -runs: - using: "composite" - steps: - - name: Setup Conda - uses: s-weigand/setup-conda@v1 - - - name: Setup Python ${{ inputs.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ inputs.python-version }} - - - name: Global Setup - run: | - pip install -U pip - pip install pytest-xdist - git config --global user.email "CI@example.com" - git config --global user.name "CI Almighty" - - - name: Checkout Repository to be tested - uses: actions/checkout@v2 - with: - repository: ${{ inputs.repository }} - ref: ${{ inputs.branch }} - - - name: Install package - run: pip install . - - - name: Checkout Home Repository - uses: actions/checkout@v2 - with: - repository: catalystneuro/.github - - - name: Run docstring check - run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} \ No newline at end of file From 224b081a3a9eadbac6a729ca6f7e60f0cafe8c98 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 14:40:46 -0700 Subject: [PATCH 10/30] testing action.yml --- action.yml | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..1b6bd37 --- /dev/null +++ b/action.yml @@ -0,0 +1,60 @@ +name: Check Docstrings +inputs: + python-version: + description: 'The version of Python to use for the workflow.' + default: '3.10' + required: false + type: string + repository: + description: 'The repository to check the docstrings for.' + required: True + type: string + branch: + description: 'The branch to check the docstrings for.' + required: false + type: string + default: '' + package-name: + description: 'The name of the package to check the docstrings for.' + required: True + type: string + names-to-skip: + description: 'The names of the modules/classes/functions/methods to skip in the docstring check.' + required: false + type: string + default: '' + +runs: + using: "composite" + steps: + - name: Setup Conda + uses: s-weigand/setup-conda@v1 + + - name: Setup Python ${{ inputs.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ inputs.python-version }} + + - name: Global Setup + run: | + pip install -U pip + pip install pytest-xdist + git config --global user.email "CI@example.com" + git config --global user.name "CI Almighty" + + - name: Checkout Repository to be tested + uses: actions/checkout@v2 + with: + repository: ${{ inputs.repository }} + ref: ${{ inputs.branch }} + + - name: Install package + run: pip install . + + - name: Checkout Home Repository + uses: actions/checkout@v2 + with: + repository: catalystneuro/.github + + - name: Run docstring check + run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} \ No newline at end of file From 624e2a3af743e2d4ccc0f7f06c528ce313995056 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 14:44:35 -0700 Subject: [PATCH 11/30] shell: bash --- action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 1b6bd37..6620ecf 100644 --- a/action.yml +++ b/action.yml @@ -41,6 +41,7 @@ runs: pip install pytest-xdist git config --global user.email "CI@example.com" git config --global user.name "CI Almighty" + shell: bash - name: Checkout Repository to be tested uses: actions/checkout@v2 @@ -50,6 +51,7 @@ runs: - name: Install package run: pip install . + shell: bash - name: Checkout Home Repository uses: actions/checkout@v2 @@ -57,4 +59,5 @@ runs: repository: catalystneuro/.github - name: Run docstring check - run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} \ No newline at end of file + run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} + shell: bash \ No newline at end of file From 87d976881cfccc73b1344e322ec30b69d6dd2623 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 14:51:36 -0700 Subject: [PATCH 12/30] moved to folder organization --- .github/workflows/call_check_docstrings.yaml | 2 +- action.yml | 63 -------------------- 2 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 action.yml diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml index f069215..98179a1 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/call_check_docstrings.yaml @@ -8,7 +8,7 @@ jobs: name: Check Docstrings steps: - id: check_docstrings - uses: catalystneuro/.github@relax_docstrings + uses: catalystneuro/.github/check_docstrings@relax_docstrings with: python-version: '3.10' repository: 'catalystneuro/roiextractors' diff --git a/action.yml b/action.yml deleted file mode 100644 index 6620ecf..0000000 --- a/action.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Check Docstrings -inputs: - python-version: - description: 'The version of Python to use for the workflow.' - default: '3.10' - required: false - type: string - repository: - description: 'The repository to check the docstrings for.' - required: True - type: string - branch: - description: 'The branch to check the docstrings for.' - required: false - type: string - default: '' - package-name: - description: 'The name of the package to check the docstrings for.' - required: True - type: string - names-to-skip: - description: 'The names of the modules/classes/functions/methods to skip in the docstring check.' - required: false - type: string - default: '' - -runs: - using: "composite" - steps: - - name: Setup Conda - uses: s-weigand/setup-conda@v1 - - - name: Setup Python ${{ inputs.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ inputs.python-version }} - - - name: Global Setup - run: | - pip install -U pip - pip install pytest-xdist - git config --global user.email "CI@example.com" - git config --global user.name "CI Almighty" - shell: bash - - - name: Checkout Repository to be tested - uses: actions/checkout@v2 - with: - repository: ${{ inputs.repository }} - ref: ${{ inputs.branch }} - - - name: Install package - run: pip install . - shell: bash - - - name: Checkout Home Repository - uses: actions/checkout@v2 - with: - repository: catalystneuro/.github - - - name: Run docstring check - run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} - shell: bash \ No newline at end of file From 21fe935a5251e039646e879de1b0e6b0ec43c9a9 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 15:04:49 -0700 Subject: [PATCH 13/30] moved to folder organization --- .github/actions/check_docstrings/action.yml | 63 ++++++++++++++++++++ .github/workflows/call_check_docstrings.yaml | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .github/actions/check_docstrings/action.yml diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml new file mode 100644 index 0000000..6620ecf --- /dev/null +++ b/.github/actions/check_docstrings/action.yml @@ -0,0 +1,63 @@ +name: Check Docstrings +inputs: + python-version: + description: 'The version of Python to use for the workflow.' + default: '3.10' + required: false + type: string + repository: + description: 'The repository to check the docstrings for.' + required: True + type: string + branch: + description: 'The branch to check the docstrings for.' + required: false + type: string + default: '' + package-name: + description: 'The name of the package to check the docstrings for.' + required: True + type: string + names-to-skip: + description: 'The names of the modules/classes/functions/methods to skip in the docstring check.' + required: false + type: string + default: '' + +runs: + using: "composite" + steps: + - name: Setup Conda + uses: s-weigand/setup-conda@v1 + + - name: Setup Python ${{ inputs.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ inputs.python-version }} + + - name: Global Setup + run: | + pip install -U pip + pip install pytest-xdist + git config --global user.email "CI@example.com" + git config --global user.name "CI Almighty" + shell: bash + + - name: Checkout Repository to be tested + uses: actions/checkout@v2 + with: + repository: ${{ inputs.repository }} + ref: ${{ inputs.branch }} + + - name: Install package + run: pip install . + shell: bash + + - name: Checkout Home Repository + uses: actions/checkout@v2 + with: + repository: catalystneuro/.github + + - name: Run docstring check + run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml index 98179a1..69d4139 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/call_check_docstrings.yaml @@ -8,7 +8,7 @@ jobs: name: Check Docstrings steps: - id: check_docstrings - uses: catalystneuro/.github/check_docstrings@relax_docstrings + uses: catalystneuro/.github/.github/actions/check_docstrings@relax_docstrings with: python-version: '3.10' repository: 'catalystneuro/roiextractors' From 52b3aa160e0b0db5c99f1d82bfe2696d87ca2cba Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 15:08:10 -0700 Subject: [PATCH 14/30] updated folder organization --- .github/workflows/check_docstrings.yaml | 63 ------------------- ...trings.yaml => test_check_docstrings.yaml} | 4 +- 2 files changed, 2 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/check_docstrings.yaml rename .github/workflows/{call_check_docstrings.yaml => test_check_docstrings.yaml} (86%) diff --git a/.github/workflows/check_docstrings.yaml b/.github/workflows/check_docstrings.yaml deleted file mode 100644 index 74fbbc9..0000000 --- a/.github/workflows/check_docstrings.yaml +++ /dev/null @@ -1,63 +0,0 @@ -name: Check Docstrings -on: - workflow_call: - inputs: - python-version: - description: 'The version of Python to use for the workflow.' - default: '3.10' - required: false - type: string - repository: - description: 'The repository to check the docstrings for.' - required: True - type: string - branch: - description: 'The branch to check the docstrings for.' - required: false - type: string - default: '' - package-name: - description: 'The name of the package to check the docstrings for.' - required: True - type: string - names-to-skip: - description: 'The names of the modules/classes/functions/methods to skip in the docstring check.' - required: false - type: string - default: '' - -jobs: - run: - runs-on: ubuntu-latest - steps: - - name: Setup Conda - uses: s-weigand/setup-conda@v1 - - - name: Setup Python ${{ inputs.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ inputs.python-version }} - - - name: Global Setup - run: | - pip install -U pip - pip install pytest-xdist - git config --global user.email "CI@example.com" - git config --global user.name "CI Almighty" - - - name: Checkout Repository to be tested - uses: actions/checkout@v2 - with: - repository: ${{ inputs.repository }} - ref: ${{ inputs.branch }} - - - name: Install package - run: pip install . - - - name: Checkout Home Repository - uses: actions/checkout@v2 - with: - repository: catalystneuro/.github - - - name: Run docstring check - run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} \ No newline at end of file diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/test_check_docstrings.yaml similarity index 86% rename from .github/workflows/call_check_docstrings.yaml rename to .github/workflows/test_check_docstrings.yaml index 69d4139..e175881 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/test_check_docstrings.yaml @@ -8,10 +8,10 @@ jobs: name: Check Docstrings steps: - id: check_docstrings - uses: catalystneuro/.github/.github/actions/check_docstrings@relax_docstrings + uses: catalystneuro/.github/.github/actions/check_docstrings@main with: python-version: '3.10' repository: 'catalystneuro/roiextractors' - branch: 'test_check_docstrings' + branch: 'main' package-name: 'roiextractors' names-to-skip: 'skipped_fn' \ No newline at end of file From 43029b5f03ea9b40d48ae57af6251842012f3035 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Fri, 23 Aug 2024 15:16:10 -0700 Subject: [PATCH 15/30] rm actions folder --- actions/check_docstrings.yaml | 60 ----------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 actions/check_docstrings.yaml diff --git a/actions/check_docstrings.yaml b/actions/check_docstrings.yaml deleted file mode 100644 index 1b6bd37..0000000 --- a/actions/check_docstrings.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: Check Docstrings -inputs: - python-version: - description: 'The version of Python to use for the workflow.' - default: '3.10' - required: false - type: string - repository: - description: 'The repository to check the docstrings for.' - required: True - type: string - branch: - description: 'The branch to check the docstrings for.' - required: false - type: string - default: '' - package-name: - description: 'The name of the package to check the docstrings for.' - required: True - type: string - names-to-skip: - description: 'The names of the modules/classes/functions/methods to skip in the docstring check.' - required: false - type: string - default: '' - -runs: - using: "composite" - steps: - - name: Setup Conda - uses: s-weigand/setup-conda@v1 - - - name: Setup Python ${{ inputs.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ inputs.python-version }} - - - name: Global Setup - run: | - pip install -U pip - pip install pytest-xdist - git config --global user.email "CI@example.com" - git config --global user.name "CI Almighty" - - - name: Checkout Repository to be tested - uses: actions/checkout@v2 - with: - repository: ${{ inputs.repository }} - ref: ${{ inputs.branch }} - - - name: Install package - run: pip install . - - - name: Checkout Home Repository - uses: actions/checkout@v2 - with: - repository: catalystneuro/.github - - - name: Run docstring check - run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} \ No newline at end of file From 12e9d5b4a760e99d84da8febbdd5f461a5198249 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 09:22:32 -0700 Subject: [PATCH 16/30] added explicit condition for names_to_skip --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0b2b0dd..410e753 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,7 +9,7 @@ def pytest_addoption(parser): def pytest_generate_tests(metafunc): package_name = metafunc.config.getoption("--package") names_to_skip = metafunc.config.getoption("--names-to-skip") - names_to_skip = names_to_skip.split(",") if names_to_skip else [] + names_to_skip = names_to_skip.split(",") if names_to_skip != "" else [] package = import_module(package_name) objs = traverse_package(package, package_name, names_to_skip=names_to_skip) if "obj" in metafunc.fixturenames: From f1c2fa97c22fbb6ad68de6b30408e132b82622ff Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 12:09:27 -0700 Subject: [PATCH 17/30] removed setup conda --- .github/actions/check_docstrings/action.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml index 6620ecf..a714e50 100644 --- a/.github/actions/check_docstrings/action.yml +++ b/.github/actions/check_docstrings/action.yml @@ -27,9 +27,6 @@ inputs: runs: using: "composite" steps: - - name: Setup Conda - uses: s-weigand/setup-conda@v1 - - name: Setup Python ${{ inputs.python-version }} uses: actions/setup-python@v2 with: From 2a4b0bf6244ed491937e631d6833c85ae01713a4 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 12:11:42 -0700 Subject: [PATCH 18/30] added call_check_docstrings back for testing (dont forget to remove before merging!) --- .github/workflows/call_check_docstrings.yaml | 17 +++++++++++++++++ .github/workflows/test_check_docstrings.yaml | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/call_check_docstrings.yaml diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml new file mode 100644 index 0000000..e175881 --- /dev/null +++ b/.github/workflows/call_check_docstrings.yaml @@ -0,0 +1,17 @@ +name: Call Check Docstrings +on: + workflow_dispatch: + +jobs: + check-docstrings: + runs-on: ubuntu-latest + name: Check Docstrings + steps: + - id: check_docstrings + uses: catalystneuro/.github/.github/actions/check_docstrings@main + with: + python-version: '3.10' + repository: 'catalystneuro/roiextractors' + branch: 'main' + package-name: 'roiextractors' + names-to-skip: 'skipped_fn' \ No newline at end of file diff --git a/.github/workflows/test_check_docstrings.yaml b/.github/workflows/test_check_docstrings.yaml index e175881..21d44f6 100644 --- a/.github/workflows/test_check_docstrings.yaml +++ b/.github/workflows/test_check_docstrings.yaml @@ -1,4 +1,4 @@ -name: Call Check Docstrings +name: Test Check Docstrings on: workflow_dispatch: From 7c292718451e6839b776ce60b0d9235089363ca2 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 12:15:16 -0700 Subject: [PATCH 19/30] @relax_docstrings --- .github/workflows/call_check_docstrings.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml index e175881..6dadfe0 100644 --- a/.github/workflows/call_check_docstrings.yaml +++ b/.github/workflows/call_check_docstrings.yaml @@ -8,7 +8,7 @@ jobs: name: Check Docstrings steps: - id: check_docstrings - uses: catalystneuro/.github/.github/actions/check_docstrings@main + uses: catalystneuro/.github/.github/actions/check_docstrings@relax_docstrings with: python-version: '3.10' repository: 'catalystneuro/roiextractors' From 2806653ca309a60011e108542ecf6aca06a8f690 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 12:18:22 -0700 Subject: [PATCH 20/30] removed checkout home repo --- .github/actions/check_docstrings/action.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml index a714e50..080a01d 100644 --- a/.github/actions/check_docstrings/action.yml +++ b/.github/actions/check_docstrings/action.yml @@ -50,11 +50,6 @@ runs: run: pip install . shell: bash - - name: Checkout Home Repository - uses: actions/checkout@v2 - with: - repository: catalystneuro/.github - - name: Run docstring check run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} shell: bash \ No newline at end of file From a5d9eccb99a2484064aab346c02d4f06d43629e0 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 12:20:38 -0700 Subject: [PATCH 21/30] readded checkout home repo --- .github/actions/check_docstrings/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml index 080a01d..360b682 100644 --- a/.github/actions/check_docstrings/action.yml +++ b/.github/actions/check_docstrings/action.yml @@ -49,6 +49,11 @@ runs: - name: Install package run: pip install . shell: bash + + - name: Checkout Home Repository + uses: actions/checkout@v2 + with: + repository: catalystneuro/.github - name: Run docstring check run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} From 2c627e82263968b4a19dcafa3bafa3e5bd3a6818 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 14:45:03 -0700 Subject: [PATCH 22/30] reorganized tests inside action directory --- .github/actions/check_docstrings/action.yml | 2 +- {tests => .github/actions/check_docstrings/tests}/__init__.py | 0 {tests => .github/actions/check_docstrings/tests}/conftest.py | 0 .../actions/check_docstrings/tests}/test_docstrings.py | 0 {tests => .github/actions/check_docstrings/tests}/traverse.py | 0 5 files changed, 1 insertion(+), 1 deletion(-) rename {tests => .github/actions/check_docstrings/tests}/__init__.py (100%) rename {tests => .github/actions/check_docstrings/tests}/conftest.py (100%) rename {tests => .github/actions/check_docstrings/tests}/test_docstrings.py (100%) rename {tests => .github/actions/check_docstrings/tests}/traverse.py (100%) diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml index 360b682..2c88c21 100644 --- a/.github/actions/check_docstrings/action.yml +++ b/.github/actions/check_docstrings/action.yml @@ -56,5 +56,5 @@ runs: repository: catalystneuro/.github - name: Run docstring check - run: pytest tests/test_docstrings.py --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} + run: pytest .github/actions/check_docstrings/tests --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} shell: bash \ No newline at end of file diff --git a/tests/__init__.py b/.github/actions/check_docstrings/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to .github/actions/check_docstrings/tests/__init__.py diff --git a/tests/conftest.py b/.github/actions/check_docstrings/tests/conftest.py similarity index 100% rename from tests/conftest.py rename to .github/actions/check_docstrings/tests/conftest.py diff --git a/tests/test_docstrings.py b/.github/actions/check_docstrings/tests/test_docstrings.py similarity index 100% rename from tests/test_docstrings.py rename to .github/actions/check_docstrings/tests/test_docstrings.py diff --git a/tests/traverse.py b/.github/actions/check_docstrings/tests/traverse.py similarity index 100% rename from tests/traverse.py rename to .github/actions/check_docstrings/tests/traverse.py From d19f0b16bd2e3f0bc4278937e897dabe615ebe0f Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 15:04:28 -0700 Subject: [PATCH 23/30] added path to checkout --- .github/actions/check_docstrings/action.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml index 2c88c21..61b251c 100644 --- a/.github/actions/check_docstrings/action.yml +++ b/.github/actions/check_docstrings/action.yml @@ -45,16 +45,12 @@ runs: with: repository: ${{ inputs.repository }} ref: ${{ inputs.branch }} + path: repo_to_test - name: Install package - run: pip install . + run: python -m pip install ./repo_to_test/${{ inputs.repository }} shell: bash - - - name: Checkout Home Repository - uses: actions/checkout@v2 - with: - repository: catalystneuro/.github - name: Run docstring check - run: pytest .github/actions/check_docstrings/tests --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} + run: pytest tests --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} shell: bash \ No newline at end of file From 406559d522385ad26ddf623b78b7131ee19ef168 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 15:09:41 -0700 Subject: [PATCH 24/30] added path to checkout --- .github/actions/check_docstrings/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml index 61b251c..437f606 100644 --- a/.github/actions/check_docstrings/action.yml +++ b/.github/actions/check_docstrings/action.yml @@ -48,7 +48,7 @@ runs: path: repo_to_test - name: Install package - run: python -m pip install ./repo_to_test/${{ inputs.repository }} + run: python -m pip install ./repo_to_test/${{ inputs.package-name }} shell: bash - name: Run docstring check From 94279500309d225d7313c40ac0b20e11751e6636 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 15:12:10 -0700 Subject: [PATCH 25/30] added path to checkout --- .github/actions/check_docstrings/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml index 437f606..bb9fe56 100644 --- a/.github/actions/check_docstrings/action.yml +++ b/.github/actions/check_docstrings/action.yml @@ -48,7 +48,9 @@ runs: path: repo_to_test - name: Install package - run: python -m pip install ./repo_to_test/${{ inputs.package-name }} + run: | + ls + python -m pip install ./repo_to_test shell: bash - name: Run docstring check From b430c600c0789639ced035890c1e5713ff765aa0 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 15:16:33 -0700 Subject: [PATCH 26/30] added path to checkout --- .github/actions/check_docstrings/action.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml index bb9fe56..9b929d1 100644 --- a/.github/actions/check_docstrings/action.yml +++ b/.github/actions/check_docstrings/action.yml @@ -48,11 +48,9 @@ runs: path: repo_to_test - name: Install package - run: | - ls - python -m pip install ./repo_to_test + run: python -m pip install ./repo_to_test shell: bash - name: Run docstring check - run: pytest tests --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} + run: pytest .github/actions/check_docstrings/tests --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} shell: bash \ No newline at end of file From f8df9c36c33bbf9d73044acd1b00b5cb8ae0a4ab Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 16:50:21 -0700 Subject: [PATCH 27/30] added path to checkout --- .github/actions/check_docstrings/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml index 9b929d1..2325121 100644 --- a/.github/actions/check_docstrings/action.yml +++ b/.github/actions/check_docstrings/action.yml @@ -52,5 +52,5 @@ runs: shell: bash - name: Run docstring check - run: pytest .github/actions/check_docstrings/tests --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} + run: pytest ${{ github.action_path }}/tests --package=${{ inputs.package-name }} --names-to-skip=${{ inputs.names-to-skip }} shell: bash \ No newline at end of file From 092d3e90bb5e72272ad7d9dfbe1b4009bb95e1f1 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Mon, 26 Aug 2024 16:54:56 -0700 Subject: [PATCH 28/30] renamed call_check_docstrings to test_check_docstrings --- .github/workflows/call_check_docstrings.yaml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/call_check_docstrings.yaml diff --git a/.github/workflows/call_check_docstrings.yaml b/.github/workflows/call_check_docstrings.yaml deleted file mode 100644 index 6dadfe0..0000000 --- a/.github/workflows/call_check_docstrings.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Call Check Docstrings -on: - workflow_dispatch: - -jobs: - check-docstrings: - runs-on: ubuntu-latest - name: Check Docstrings - steps: - - id: check_docstrings - uses: catalystneuro/.github/.github/actions/check_docstrings@relax_docstrings - with: - python-version: '3.10' - repository: 'catalystneuro/roiextractors' - branch: 'main' - package-name: 'roiextractors' - names-to-skip: 'skipped_fn' \ No newline at end of file From 06751b4f6bdf2c57286c6a9bc23651d9727a1242 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Tue, 27 Aug 2024 10:01:25 -0700 Subject: [PATCH 29/30] updated versions and added examples --- .github/actions/check_docstrings/action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/check_docstrings/action.yml b/.github/actions/check_docstrings/action.yml index 2325121..39ad5c0 100644 --- a/.github/actions/check_docstrings/action.yml +++ b/.github/actions/check_docstrings/action.yml @@ -2,11 +2,11 @@ name: Check Docstrings inputs: python-version: description: 'The version of Python to use for the workflow.' - default: '3.10' + default: '3.11' required: false type: string repository: - description: 'The repository to check the docstrings for.' + description: 'The repository to check the docstrings for. For example, repository: "catalystneuro/roiextractors"' required: True type: string branch: @@ -19,7 +19,7 @@ inputs: required: True type: string names-to-skip: - description: 'The names of the modules/classes/functions/methods to skip in the docstring check.' + description: 'The names of the modules/classes/functions/methods to skip in the docstring check. For example names-to-skip: "module_name1,class_name2"' required: false type: string default: '' @@ -28,7 +28,7 @@ runs: using: "composite" steps: - name: Setup Python ${{ inputs.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} @@ -41,7 +41,7 @@ runs: shell: bash - name: Checkout Repository to be tested - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: ${{ inputs.repository }} ref: ${{ inputs.branch }} From e69bcf3c092e051c3026574219cbdc5523eb5d6c Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Tue, 27 Aug 2024 10:03:00 -0700 Subject: [PATCH 30/30] switched to local action --- .github/workflows/test_check_docstrings.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_check_docstrings.yaml b/.github/workflows/test_check_docstrings.yaml index 21d44f6..89c448b 100644 --- a/.github/workflows/test_check_docstrings.yaml +++ b/.github/workflows/test_check_docstrings.yaml @@ -8,9 +8,9 @@ jobs: name: Check Docstrings steps: - id: check_docstrings - uses: catalystneuro/.github/.github/actions/check_docstrings@main + uses: ./.github/actions/check_docstrings with: - python-version: '3.10' + python-version: '3.11' repository: 'catalystneuro/roiextractors' branch: 'main' package-name: 'roiextractors'