From d426f75ebf0d0c593eef0c5ea9f6c193e6135b6b Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Fri, 25 Oct 2024 15:17:41 +0100 Subject: [PATCH 1/4] install all optional packages --- .github/workflows/python-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 7b27dda..083cbb2 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -80,8 +80,8 @@ jobs: python -m pip install --upgrade pip pip install pytest-xdist if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - if [ -f "setup.py" ]; then pip install -e .; else export PYTHONPATH=$PYTHONPATH:./src; fi - if [ -f "pyproject.toml" ]; then pip install -e .[docs]; fi + if [ -f "setup.py" ]; then pip install -e .[all]; else export PYTHONPATH=$PYTHONPATH:./src; fi + if [ -f "pyproject.toml" ]; then pip install -e .[all]; fi echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV - name: Setup with pytest-xdist run: | From 42f4cb83a90d2577c69e8f843ec46fe22e3769fb Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Mon, 18 Nov 2024 21:02:06 +0000 Subject: [PATCH 2/4] use [[ ]] --- .github/workflows/python-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 083cbb2..b3386bf 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -90,7 +90,7 @@ jobs: # # make PYTESTXDIST export PYTESTXDIST="-n ${{ inputs.pytest_numcpus }}" - if [ ${{ inputs.pytest_numcpus }} -gt 0 ]; then export PYTESTXDIST="$PYTESTXDIST --dist=loadfile"; fi + if [[ ${{ inputs.pytest_numcpus }} -gt 0 ]]; then export PYTESTXDIST="$PYTESTXDIST --dist=loadfile"; fi # # echo results and save env var for other jobs echo "pytest-xdist options that will be used are: $PYTESTXDIST" @@ -106,7 +106,7 @@ jobs: # # make PYTESTCOV export PYTESTCOV="--cov=${{ inputs.pytest_cov_dir }} --cov-report=xml" - if [ ${{ inputs.pytest_cov_dir }} == "unassigned" ]; then export PYTESTCOV=""; fi + if [[ ${{ inputs.pytest_cov_dir }} == "unassigned" ]]; then export PYTESTCOV=""; fi # # echo results and save env var for other jobs echo "pytest-cov options that will be used are: $PYTESTCOV" @@ -116,11 +116,11 @@ jobs: export PYTHONPATH=${PYTHONPATH}:${{ inputs.python_path }} export PYTEST_COMMAND="pytest $PYTESTCOV $PYTESTXDIST -s" echo "Will be running this command: $PYTEST_COMMAND" - if [ ${{ inputs.test_dir }} != '' ]; then cd ${{ inputs.test_dir }}; fi + if [[ ${{ inputs.test_dir }} != '' ]]; then cd ${{ inputs.test_dir }}; fi eval $PYTEST_COMMAND - name: Show coverage run: | - if [ ${{ inputs.test_dir }} != '' ]; then cd ${{ inputs.test_dir }}; fi + if [[ ${{ inputs.test_dir }} != '' ]]; then cd ${{ inputs.test_dir }}; fi coverage report -m - name: "Upload coverage to Codecov" uses: codecov/codecov-action@v2 From 0f48cb38670854d5d6ad9eab9cf56f63e52698c8 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 19 Nov 2024 09:45:45 +0000 Subject: [PATCH 3/4] use " --- .github/workflows/python-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index b3386bf..3238017 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -116,11 +116,11 @@ jobs: export PYTHONPATH=${PYTHONPATH}:${{ inputs.python_path }} export PYTEST_COMMAND="pytest $PYTESTCOV $PYTESTXDIST -s" echo "Will be running this command: $PYTEST_COMMAND" - if [[ ${{ inputs.test_dir }} != '' ]]; then cd ${{ inputs.test_dir }}; fi + if [[ "${{ inputs.test_dir }}" != "" ]]; then cd ${{ inputs.test_dir }}; fi eval $PYTEST_COMMAND - name: Show coverage run: | - if [[ ${{ inputs.test_dir }} != '' ]]; then cd ${{ inputs.test_dir }}; fi + if [[ "${{ inputs.test_dir }"} != "" ]]; then cd ${{ inputs.test_dir }}; fi coverage report -m - name: "Upload coverage to Codecov" uses: codecov/codecov-action@v2 From b2f73389bb4de906c5e05f957cdac8e68dadfde9 Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 19 Nov 2024 09:49:50 +0000 Subject: [PATCH 4/4] fix --- .github/workflows/python-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 3238017..3e37cf3 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -120,7 +120,7 @@ jobs: eval $PYTEST_COMMAND - name: Show coverage run: | - if [[ "${{ inputs.test_dir }"} != "" ]]; then cd ${{ inputs.test_dir }}; fi + if [[ "${{ inputs.test_dir }}" != "" ]]; then cd ${{ inputs.test_dir }}; fi coverage report -m - name: "Upload coverage to Codecov" uses: codecov/codecov-action@v2