From d7a34f588c8895cc48b1db6ad6e442e6fa4fc065 Mon Sep 17 00:00:00 2001 From: Ashish Nayan Date: Tue, 27 Jun 2023 02:32:52 +0530 Subject: [PATCH 1/8] commented out pip install requirement.txt --- action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 45b0638..ba3e75d 100644 --- a/action.yml +++ b/action.yml @@ -90,12 +90,12 @@ runs: - run: python --version shell: bash - - name: Windows install dependencies - if: ${{ runner.os == 'Windows' }} - run: | - pip install -r ${{ github.action_path }}\requirements.txt - echo "path_sep=" >> $GITHUB_ENV - shell: pwsh + # - name: Windows install dependencies + # if: ${{ runner.os == 'Windows' }} + # run: | + # pip install -r ${{ github.action_path }}\requirements.txt + # echo "path_sep=" >> $GITHUB_ENV + # shell: pwsh # - name: Posix install dependencies # if: ${{ runner.os != 'Windows' }} From 9650f4d121af56d2a68e9ed466615a72cbddb8b7 Mon Sep 17 00:00:00 2001 From: Ashish Nayan Date: Tue, 27 Jun 2023 02:42:07 +0530 Subject: [PATCH 2/8] setup python using poetry --- action.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/action.yml b/action.yml index ba3e75d..28351f4 100644 --- a/action.yml +++ b/action.yml @@ -81,26 +81,26 @@ runs: using: "composite" steps: - name: Setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ inputs.python-version }} architecture: x64 - cache: pip + cache: poetry - run: python --version shell: bash - # - name: Windows install dependencies - # if: ${{ runner.os == 'Windows' }} - # run: | - # pip install -r ${{ github.action_path }}\requirements.txt - # echo "path_sep=" >> $GITHUB_ENV - # shell: pwsh + - name: Windows install dependencies + if: ${{ runner.os == 'Windows' }} + run: | + pip install -r ${{ github.action_path }}\requirements.txt + echo "path_sep=" >> $GITHUB_ENV + shell: pwsh - # - name: Posix install dependencies - # if: ${{ runner.os != 'Windows' }} - # run: pip install -r ${{ github.action_path }}/requirements.txt - # shell: bash + - name: Posix install dependencies + if: ${{ runner.os != 'Windows' }} + run: pip install -r ${{ github.action_path }}/requirements.txt + shell: bash - name: Lint on Windows if: ${{ runner.os == 'Windows' }} From b97a678eff4c087f62afbbee5919bedb6d1e4f8a Mon Sep 17 00:00:00 2001 From: Ashish Nayan Date: Tue, 27 Jun 2023 02:56:45 +0530 Subject: [PATCH 3/8] disabled package --- requirements.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 73b61ff..b508a9c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ -black==21.11b1 +# black==21.11b1 flake8==4.0.1 isort==5.10.1 mypy~=0.961 -pycodestyle==2.8.0 -pydocstyle==6.1.1 -pylint==2.12.1 -vulture==2.3 \ No newline at end of file +# pycodestyle==2.8.0 +# pydocstyle==6.1.1 +# pylint==2.12.1 +# vulture==2.3 From e43943920cd7d1021c3a2f41a9abecf292ceccc5 Mon Sep 17 00:00:00 2001 From: Ashish Nayan Date: Tue, 27 Jun 2023 13:30:13 +0530 Subject: [PATCH 4/8] testing poetry --- action.yml | 46 ++++++++++++++++++++++++++-------------------- entrypoint.sh | 17 +++++++++-------- requirements.txt | 2 +- 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/action.yml b/action.yml index 28351f4..c43ae29 100644 --- a/action.yml +++ b/action.yml @@ -8,38 +8,42 @@ inputs: description: "A list of all paths to test" required: false default: "." + command: + description: "Initial command specially for poetry" + required: false + default: "" use-pylint: description: "Use Pylint" required: false - default: true + default: false use-pycodestyle: description: "Use pycodestyle" required: false - default: true + default: false use-flake8: description: "Use Flake8" required: false - default: true + default: false use-black: description: "Use Black" required: false - default: true + default: false use-mypy: description: "Use mypy" required: false - default: true + default: false use-isort: description: "Use isort" required: false - default: true + default: false use-vulture: description: "Use vulture" required: false - default: true + default: false use-pydocstyle: description: "Use pydocstyle" required: false - default: true + default: false extra-pylint-options: description: "Extra options: pylint $(extra-pylint-options) $(python-root-list)" required: false @@ -85,22 +89,22 @@ runs: with: python-version: ${{ inputs.python-version }} architecture: x64 - cache: poetry + cache: ${{ inputs.cache-type }} - run: python --version shell: bash - - name: Windows install dependencies - if: ${{ runner.os == 'Windows' }} - run: | - pip install -r ${{ github.action_path }}\requirements.txt - echo "path_sep=" >> $GITHUB_ENV - shell: pwsh - - - name: Posix install dependencies - if: ${{ runner.os != 'Windows' }} - run: pip install -r ${{ github.action_path }}/requirements.txt - shell: bash + # - name: Windows install dependencies + # if: ${{ runner.os == 'Windows' }} + # run: | + # pip install -r ${{ github.action_path }}\requirements.txt + # echo "path_sep=" >> $GITHUB_ENV + # shell: pwsh + # + # - name: Posix install dependencies + # if: ${{ runner.os != 'Windows' }} + # run: pip install -r ${{ github.action_path }}/requirements.txt + # shell: bash - name: Lint on Windows if: ${{ runner.os == 'Windows' }} @@ -123,6 +127,7 @@ runs: '${{ inputs.extra-isort-options }}' '${{ inputs.extra-vulture-options }}' '${{ inputs.extra-pydocstyle-options }}' + ${{ inputs.command }} shell: pwsh - name: Lint on Linux @@ -146,4 +151,5 @@ runs: '${{ inputs.extra-isort-options }}' '${{ inputs.extra-vulture-options }}' '${{ inputs.extra-pydocstyle-options }}' + ${{ inputs.command }} shell: bash diff --git a/entrypoint.sh b/entrypoint.sh index 0e84798..3ca71d9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -35,6 +35,7 @@ echo extra-mypy-options: ${14} echo extra-isort-options: ${15} echo extra-vulture-options: ${16} echo extra-pydocstyle-options: ${17} +echo command: ${18} # actions path has the copy of this actions repo echo $RUNNER_OS @@ -58,7 +59,7 @@ if [ "$2" = true ] ; then echo Running: pylint ${10} $1 - pylint --output-format="colorized" ${10} $1 + ${18} pylint --output-format="colorized" ${10} $1 exit_code=$? if [ "$exit_code" = "0" ]; then @@ -73,7 +74,7 @@ if [ "$3" = true ] ; then echo Running: pycodestyle ${11} $1 - pycodestyle ${11} $1 + ${18} pycodestyle ${11} $1 exit_code=$? if [ "$exit_code" = "0" ]; then @@ -88,7 +89,7 @@ if [ "$4" = true ] ; then echo Running: flake8 ${12} $1 - flake8 ${12} $1 + ${18} flake8 ${12} $1 exit_code=$? if [ "$exit_code" = "0" ]; then @@ -103,7 +104,7 @@ if [ "$5" = true ] ; then echo Running: black --check ${13} $1 - black --check ${13} $1 + ${18} black --check ${13} $1 exit_code=$? if [ "$exit_code" = "0" ]; then @@ -118,7 +119,7 @@ if [ "$6" = true ] ; then echo Running: mypy --install-types --non-interactive --ignore-missing-imports --follow-imports=silent --show-column-numbers ${14} $1 - mypy \ + ${18} mypy \ --install-types --non-interactive \ --ignore-missing-imports \ --follow-imports=silent \ @@ -137,7 +138,7 @@ if [ "$7" = true ] ; then echo Running: isort ${15} $1 -c --diff - isort ${15} $1 -c --diff + ${18} isort ${15} $1 -c --diff exit_code=$? if [ "$exit_code" = "0" ]; then @@ -152,7 +153,7 @@ if [ "$8" = true ] ; then echo Running: vulture ${16} $1 - vulture ${16} $1 + ${18} vulture ${16} $1 exit_code=$? if [ "$exit_code" = "0" ]; then @@ -167,7 +168,7 @@ if [ "$9" = true ] ; then echo Running: pydocstyle ${17} $1 - pydocstyle ${17} $1 + ${18} pydocstyle ${17} $1 exit_code=$? if [ "$exit_code" = "0" ]; then diff --git a/requirements.txt b/requirements.txt index b508a9c..0585199 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # black==21.11b1 -flake8==4.0.1 +flake8==6.0.0 isort==5.10.1 mypy~=0.961 # pycodestyle==2.8.0 From cc169da20346d0dac7a997eec8b5178b4387991d Mon Sep 17 00:00:00 2001 From: Ashish Nayan Date: Tue, 27 Jun 2023 13:57:15 +0530 Subject: [PATCH 5/8] testing github action --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index c43ae29..c1d489c 100644 --- a/action.yml +++ b/action.yml @@ -127,7 +127,7 @@ runs: '${{ inputs.extra-isort-options }}' '${{ inputs.extra-vulture-options }}' '${{ inputs.extra-pydocstyle-options }}' - ${{ inputs.command }} + '${{ inputs.command }}' shell: pwsh - name: Lint on Linux @@ -151,5 +151,5 @@ runs: '${{ inputs.extra-isort-options }}' '${{ inputs.extra-vulture-options }}' '${{ inputs.extra-pydocstyle-options }}' - ${{ inputs.command }} + '${{ inputs.command }}' shell: bash From 473d3d6cf819c53a267d430c1058601e92db753c Mon Sep 17 00:00:00 2001 From: Ashish Nayan Date: Tue, 27 Jun 2023 14:06:57 +0530 Subject: [PATCH 6/8] testing github action --- entrypoint.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3ca71d9..b026e43 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -57,7 +57,7 @@ export TERM=xterm if [ "$2" = true ] ; then - echo Running: pylint ${10} $1 + echo Running: ${18} pylint ${10} $1 ${18} pylint --output-format="colorized" ${10} $1 exit_code=$? @@ -72,7 +72,7 @@ fi if [ "$3" = true ] ; then - echo Running: pycodestyle ${11} $1 + echo Running: ${18} pycodestyle ${11} $1 ${18} pycodestyle ${11} $1 exit_code=$? @@ -87,7 +87,7 @@ fi if [ "$4" = true ] ; then - echo Running: flake8 ${12} $1 + echo Running: ${18} flake8 ${12} $1 ${18} flake8 ${12} $1 exit_code=$? @@ -102,7 +102,7 @@ fi if [ "$5" = true ] ; then - echo Running: black --check ${13} $1 + echo Running: ${18} black --check ${13} $1 ${18} black --check ${13} $1 exit_code=$? @@ -117,7 +117,7 @@ fi if [ "$6" = true ] ; then - echo Running: mypy --install-types --non-interactive --ignore-missing-imports --follow-imports=silent --show-column-numbers ${14} $1 + echo Running: ${18} mypy --install-types --non-interactive --ignore-missing-imports --follow-imports=silent --show-column-numbers ${14} $1 ${18} mypy \ --install-types --non-interactive \ @@ -136,7 +136,7 @@ fi if [ "$7" = true ] ; then - echo Running: isort ${15} $1 -c --diff + echo Running: ${18} isort ${15} $1 -c --diff ${18} isort ${15} $1 -c --diff exit_code=$? @@ -151,7 +151,7 @@ fi if [ "$8" = true ] ; then - echo Running: vulture ${16} $1 + echo Running: ${18} vulture ${16} $1 ${18} vulture ${16} $1 exit_code=$? @@ -166,7 +166,7 @@ fi if [ "$9" = true ] ; then - echo Running: pydocstyle ${17} $1 + echo Running: ${18} pydocstyle ${17} $1 ${18} pydocstyle ${17} $1 exit_code=$? From 5c773caab781518e6938123c2b0abeac1be59194 Mon Sep 17 00:00:00 2001 From: Ashish Nayan Date: Tue, 27 Jun 2023 14:56:58 +0530 Subject: [PATCH 7/8] testing github action --- action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index c1d489c..821f8b0 100644 --- a/action.yml +++ b/action.yml @@ -84,15 +84,15 @@ inputs: runs: using: "composite" steps: - - name: Setup python - uses: actions/setup-python@v4 - with: - python-version: ${{ inputs.python-version }} - architecture: x64 - cache: ${{ inputs.cache-type }} - - - run: python --version - shell: bash + # - name: Setup python + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ inputs.python-version }} + # architecture: x64 + # cache: ${{ inputs.cache-type }} + # + # - run: python --version + # shell: bash # - name: Windows install dependencies # if: ${{ runner.os == 'Windows' }} From 2adbf38a960b2d8ce185a7ddd1998f4804a95d64 Mon Sep 17 00:00:00 2001 From: Ashish Nayan Date: Tue, 27 Jun 2023 15:03:03 +0530 Subject: [PATCH 8/8] testing github action --- action.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 821f8b0..01485c9 100644 --- a/action.yml +++ b/action.yml @@ -80,19 +80,23 @@ inputs: description: "Set desired python version with this keyword" required: false default: "3.8" + cache-type: + description: "Set cache for setup python" + required: true + default: "poetry" runs: using: "composite" steps: - # - name: Setup python - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ inputs.python-version }} - # architecture: x64 - # cache: ${{ inputs.cache-type }} - # - # - run: python --version - # shell: bash + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python-version }} + architecture: x64 + cache: ${{ inputs.cache-type }} + + - run: python --version + shell: bash # - name: Windows install dependencies # if: ${{ runner.os == 'Windows' }}