From 4c3d33d0b107805f915d5838e50bfe12ebf92f6c Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 13 May 2020 13:19:16 -0700 Subject: [PATCH 01/13] ci: switch to GitHub Actions --- .../{Python_tests.yml => test-python.yml} | 29 ++++-- .github/workflows/test.yml | 51 ++++++++++ .travis.yml | 93 ------------------- 3 files changed, 70 insertions(+), 103 deletions(-) rename .github/workflows/{Python_tests.yml => test-python.yml} (74%) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/Python_tests.yml b/.github/workflows/test-python.yml similarity index 74% rename from .github/workflows/Python_tests.yml rename to .github/workflows/test-python.yml index 067294515d..3ed6d95272 100644 --- a/.github/workflows/Python_tests.yml +++ b/.github/workflows/test-python.yml @@ -1,17 +1,25 @@ # TODO: Line 15, enable python-version: 3.5 # TODO: Line 36, enable pytest --doctest-modules -name: Python_tests -on: [push, pull_request] +name: Python Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + jobs: - Python_tests: + test: runs-on: ${{ matrix.os }} strategy: fail-fast: false max-parallel: 15 matrix: os: [macos-latest, ubuntu-latest, windows-latest] - python-version: [2.7, 3.6, 3.7, 3.8] # 3.5, + python-version: [2.7, 3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -29,12 +37,13 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest (Linux and macOS) - if: matrix.os != 'windows-latest' - run: pytest - - name: Test with pytest (Windows) - if: matrix.os == 'windows-latest' + - name: Test with pytest shell: bash - run: GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" pytest + run: | + if [ "$RUNNER_OS" == "Windows" ]; then + GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest + else + python -m pytest + fi # - name: Run doctests with pytest # run: pytest --doctest-modules diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000000..f16670f285 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,51 @@ +name: Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + strategy: + fail-fast: false + matrix: + node: [10.x, 12.x, 14.x] + python: [2.7, 3.6, 3.7, 3.8] + os: [macos-latest, ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - name: Use Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + env: + PYTHON_VERSION: ${{ matrix.python }} + - name: Install Dependencies + run: | + python -m pip install --upgrade pip flake8 pytest==4.6.6 + npm install + - name: Lint Python + run: | + python -m flake8 --version + python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + python -m flake8 . --count --exit-zero --ignore=E111,E114,W503 --max-complexity=10 --max-line-length=127 --statistics + - name: Run Tests + shell: bash + run: | + echo "Testing with Python $(python --version 2>&1)" + npm test + if [ "$RUNNER_OS" == "Windows" ]; then + GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest + else + python -m pytest + fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ae691bed48..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,93 +0,0 @@ -dist: xenial -language: python -cache: pip -addons: - homebrew: - update: true - packages: - - npm - - pyenv -jobs: - include: - - name: "Python 2.7 on Linux" - env: NODE_GYP_FORCE_PYTHON=python2 - python: 2.7 - - - name: "Node.js 10 & Python 3.8 on Linux" - python: 3.8 - env: NODE_GYP_FORCE_PYTHON=python3 - before_install: nvm install 10 - - - name: "Node.js 12 & Python 3.5 on Linux" - python: 3.5 - env: NODE_GYP_FORCE_PYTHON=python3 - before_install: nvm install 12 - - name: "Node.js 12 & Python 3.6 on Linux" - python: 3.6 - env: NODE_GYP_FORCE_PYTHON=python3 - before_install: nvm install 12 - - name: "Node.js 12 & Python 3.7 on Linux" - python: 3.7 - env: NODE_GYP_FORCE_PYTHON=python3 - before_install: nvm install 12 - - name: "Node.js 12 & Python 3.8 on Linux" - python: 3.8 - env: NODE_GYP_FORCE_PYTHON=python3 - before_install: nvm install 12 - - - name: "Python 2.7 on macOS" - os: osx - osx_image: xcode11.2 - language: shell # 'language: python' is not yet supported on macOS - env: NODE_GYP_FORCE_PYTHON=python2 PATH=$HOME/.pyenv/shims:$PATH PYENV_VERSION=2.7.17 - before_install: pyenv install $PYENV_VERSION - - name: "Python 3.8 on macOS" - os: osx - osx_image: xcode11.2 - language: shell # 'language: python' is not yet supported on macOS - env: NODE_GYP_FORCE_PYTHON=python3 PATH=$HOME/.pyenv/shims:$PATH PYENV_VERSION=3.8.0 - before_install: pyenv install $PYENV_VERSION - - - name: "Node.js 12 & Python 2.7 on Windows" - os: windows - language: node_js - node_js: 12 # node - env: >- - PATH=/c/Python27:/c/Python27/Scripts:$PATH - NODE_GYP_FORCE_PYTHON=/c/Python27/python.exe - before_install: choco install python2 - - - name: "Node.js 12 & Python 3.7 on Windows" - os: windows - language: node_js - node_js: 12 # node - env: >- - PATH=/c/Python37:/c/Python37/Scripts:$PATH - NODE_GYP_FORCE_PYTHON=/c/Python37/python.exe - before_install: choco install python --version=3.7.4 - - name: "Node.js 12 & Python 3.8 on Windows" - os: windows - language: node_js - node_js: 12 # node - env: >- - PATH=/c/Python38:/c/Python38/Scripts:$PATH - NODE_GYP_FORCE_PYTHON=/c/Python38/python.exe - before_install: choco install python - -install: - - python -m pip install --upgrade flake8 pytest==4.6.6 # pytest 5 no longer supports legacy Python -before_script: - - python -m flake8 --version - # stop the build if there are Python syntax errors or undefined names - - python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. Two space indentation is OK. The GitHub editor is 127 chars wide - - python -m flake8 . --count --exit-zero --ignore=E111,E114,W503 --max-complexity=10 --max-line-length=127 --statistics - - npm install - - npm list -script: - - node -e 'require("npmlog").level="verbose"; require("./lib/find-python")(null,()=>{})' - - npm test - - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest -notifications: - on_success: change - on_failure: change # `always` will be the setting once code changes slow down From 3cedd7ebd14b0dcffa0c9c58de42435bc5dd5a08 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 15 May 2020 11:59:24 -0700 Subject: [PATCH 02/13] Use msbuild setup action --- .github/workflows/test-python.yml | 9 ++++----- .github/workflows/test.yml | 13 +++++-------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 3ed6d95272..421ebc33c8 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -26,6 +26,9 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} + - name: Add msbuild to PATH + if: matrix.os == 'windows-latest' + uses: microsoft/setup-msbuild@v1.0.0 - name: Install dependencies run: | python -m pip install --upgrade pip @@ -40,10 +43,6 @@ jobs: - name: Test with pytest shell: bash run: | - if [ "$RUNNER_OS" == "Windows" ]; then - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest - else - python -m pytest - fi + python -m pytest # - name: Run doctests with pytest # run: pytest --doctest-modules diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f16670f285..46ff00bd09 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,9 +30,12 @@ jobs: python-version: ${{ matrix.python }} env: PYTHON_VERSION: ${{ matrix.python }} + - name: Add msbuild to PATH + if: matrix.os == 'windows-latest' + uses: microsoft/setup-msbuild@v1.0.0 - name: Install Dependencies run: | - python -m pip install --upgrade pip flake8 pytest==4.6.6 + python -m pip install --upgrade pip flake8 pytest npm install - name: Lint Python run: | @@ -40,12 +43,6 @@ jobs: python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics python -m flake8 . --count --exit-zero --ignore=E111,E114,W503 --max-complexity=10 --max-line-length=127 --statistics - name: Run Tests - shell: bash run: | - echo "Testing with Python $(python --version 2>&1)" npm test - if [ "$RUNNER_OS" == "Windows" ]; then - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest - else - python -m pytest - fi + python -m pytest From 1f31e548ce49aa6b521c8f5d7c349641ec9eedfd Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Mon, 31 Aug 2020 19:51:56 -0400 Subject: [PATCH 03/13] simplify node tests --- .github/workflows/{test.yml => test-node.yml} | 15 ++++++--------- .github/workflows/test-python.yml | 2 +- package.json | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) rename .github/workflows/{test.yml => test-node.yml} (68%) diff --git a/.github/workflows/test.yml b/.github/workflows/test-node.yml similarity index 68% rename from .github/workflows/test.yml rename to .github/workflows/test-node.yml index 46ff00bd09..dfca31a50d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test-node.yml @@ -1,4 +1,4 @@ -name: Tests +name: Node Tests on: push: @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: node: [10.x, 12.x, 14.x] - python: [2.7, 3.6, 3.7, 3.8] + python: [3.6, 3.7, 3.8] os: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: @@ -35,14 +35,11 @@ jobs: uses: microsoft/setup-msbuild@v1.0.0 - name: Install Dependencies run: | - python -m pip install --upgrade pip flake8 pytest npm install - - name: Lint Python + - name: Lint JavaScript + if: matrix.os == 'ubuntu-latest' run: | - python -m flake8 --version - python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - python -m flake8 . --count --exit-zero --ignore=E111,E114,W503 --max-complexity=10 --max-line-length=127 --statistics - - name: Run Tests + npm run lint + - name: Run JavaScript Tests run: | npm test - python -m pytest diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 421ebc33c8..3fcb3f6e38 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -19,7 +19,7 @@ jobs: max-parallel: 15 matrix: os: [macos-latest, ubuntu-latest, windows-latest] - python-version: [2.7, 3.6, 3.7, 3.8] + python-version: [3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/package.json b/package.json index fd286374aa..33db701c7b 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,6 @@ }, "scripts": { "lint": "standard */*.js test/**/*.js", - "test": "npm run lint && tap --timeout=120 test/test-*" + "test": "tap --timeout=120 test/test-*" } } From 6d4b4ba9c7dff6bbc6c493ecdbd4275604ff4eb3 Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Mon, 31 Aug 2020 20:07:12 -0400 Subject: [PATCH 04/13] Revert msbuild action --- .github/workflows/test-node.yml | 15 +++++++++------ .github/workflows/test-python.yml | 17 ++++++++++------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index dfca31a50d..24f47cef8a 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -30,16 +30,19 @@ jobs: python-version: ${{ matrix.python }} env: PYTHON_VERSION: ${{ matrix.python }} - - name: Add msbuild to PATH - if: matrix.os == 'windows-latest' - uses: microsoft/setup-msbuild@v1.0.0 - name: Install Dependencies run: | - npm install - - name: Lint JavaScript + npm install --no-progress + - name: Lint with standard if: matrix.os == 'ubuntu-latest' run: | npm run lint - - name: Run JavaScript Tests + - name: Test with tap (Linux and macOS) + if: matrix.os != 'windows-latest' run: | npm test + - name: Test with tap (Windows) + if: matrix.os == 'windows-latest' + shell: bash + run: | + GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" npm test diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 3fcb3f6e38..8d25144f80 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -1,5 +1,5 @@ -# TODO: Line 15, enable python-version: 3.5 -# TODO: Line 36, enable pytest --doctest-modules +# TODO: Line 21, enable python-version: 3.5 +# TODO: Line 50, enable pytest --doctest-modules name: Python Tests @@ -18,17 +18,14 @@ jobs: fail-fast: false max-parallel: 15 matrix: + python-version: [3.6, 3.7, 3.8] os: [macos-latest, ubuntu-latest, windows-latest] - python-version: [3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - - name: Add msbuild to PATH - if: matrix.os == 'windows-latest' - uses: microsoft/setup-msbuild@v1.0.0 - name: Install dependencies run: | python -m pip install --upgrade pip @@ -40,9 +37,15 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + - name: Test with pytest (Linux and macOS) + if: matrix.os != 'windows-latest' shell: bash run: | python -m pytest + - name: Test with pytest (Windows) + if: matrix.os == 'windows-latest' + shell: bash + run: | + GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest # - name: Run doctests with pytest # run: pytest --doctest-modules From bf9918f7b66c99cdd62bccaeb831146dced9cf2f Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Mon, 31 Aug 2020 20:31:48 -0400 Subject: [PATCH 05/13] Reduce to single workflow to save nodes --- .github/workflows/test-python.yml | 51 ------------------- .../workflows/{test-node.yml => tests.yml} | 30 +++++++++-- 2 files changed, 26 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/test-python.yml rename .github/workflows/{test-node.yml => tests.yml} (50%) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml deleted file mode 100644 index 8d25144f80..0000000000 --- a/.github/workflows/test-python.yml +++ /dev/null @@ -1,51 +0,0 @@ -# TODO: Line 21, enable python-version: 3.5 -# TODO: Line 50, enable pytest --doctest-modules - -name: Python Tests - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - max-parallel: 15 - matrix: - python-version: [3.6, 3.7, 3.8] - os: [macos-latest, ubuntu-latest, windows-latest] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest # -r requirements.txt - - name: Lint with flake8 - if: matrix.os == 'ubuntu-latest' - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest (Linux and macOS) - if: matrix.os != 'windows-latest' - shell: bash - run: | - python -m pytest - - name: Test with pytest (Windows) - if: matrix.os == 'windows-latest' - shell: bash - run: | - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest - # - name: Run doctests with pytest - # run: pytest --doctest-modules diff --git a/.github/workflows/test-node.yml b/.github/workflows/tests.yml similarity index 50% rename from .github/workflows/test-node.yml rename to .github/workflows/tests.yml index 24f47cef8a..8ec75297b3 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,7 @@ -name: Node Tests +# TODO: Line 20, enable python-version: 3.5 +# TODO: Line 69, enable pytest --doctest-modules + +name: Tests on: push: @@ -33,16 +36,35 @@ jobs: - name: Install Dependencies run: | npm install --no-progress - - name: Lint with standard + pip install flake8 pytest + - name: Lint node if: matrix.os == 'ubuntu-latest' run: | npm run lint - - name: Test with tap (Linux and macOS) + - name: Lint python + if: matrix.os == 'ubuntu-latest' + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Run node tests (Linux and macOS) if: matrix.os != 'windows-latest' run: | npm test - - name: Test with tap (Windows) + - name: Run python tests (Linux and macOS) + if: matrix.os != 'windows-latest' + run: | + python -m pytest + - name: Run node tests (Windows) if: matrix.os == 'windows-latest' shell: bash run: | GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" npm test + - name: Run python tests (Windows) + if: matrix.os == 'windows-latest' + shell: bash + run: | + GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest + # - name: Run doctests with pytest + # run: pytest --doctest-modules From 112cff03427e71655b3ec6af12fdc6a80e5fc12d Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Tue, 1 Sep 2020 00:14:11 -0400 Subject: [PATCH 06/13] use test:ci --- .github/workflows/tests.yml | 4 ++-- package.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8ec75297b3..2c0caa5294 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: - name: Run node tests (Linux and macOS) if: matrix.os != 'windows-latest' run: | - npm test + npm run test:ci - name: Run python tests (Linux and macOS) if: matrix.os != 'windows-latest' run: | @@ -60,7 +60,7 @@ jobs: if: matrix.os == 'windows-latest' shell: bash run: | - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" npm test + GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" npm run test:ci - name: Run python tests (Windows) if: matrix.os == 'windows-latest' shell: bash diff --git a/package.json b/package.json index 33db701c7b..2d3c768a4d 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ }, "scripts": { "lint": "standard */*.js test/**/*.js", - "test": "tap --timeout=120 test/test-*" + "test": "npm run lint && npm run test:ci", + "test:ci": "tap --timeout=120 test/test-*" } } From 80aa6c42a0d729037e3577406802290f6ae95c02 Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Tue, 1 Sep 2020 00:35:01 -0400 Subject: [PATCH 07/13] Revert test:ci --- .github/workflows/tests.yml | 8 ++------ package.json | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2c0caa5294..da82911c61 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,10 +37,6 @@ jobs: run: | npm install --no-progress pip install flake8 pytest - - name: Lint node - if: matrix.os == 'ubuntu-latest' - run: | - npm run lint - name: Lint python if: matrix.os == 'ubuntu-latest' run: | @@ -51,7 +47,7 @@ jobs: - name: Run node tests (Linux and macOS) if: matrix.os != 'windows-latest' run: | - npm run test:ci + npm test - name: Run python tests (Linux and macOS) if: matrix.os != 'windows-latest' run: | @@ -60,7 +56,7 @@ jobs: if: matrix.os == 'windows-latest' shell: bash run: | - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" npm run test:ci + GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" npm test - name: Run python tests (Windows) if: matrix.os == 'windows-latest' shell: bash diff --git a/package.json b/package.json index 2d3c768a4d..fd286374aa 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ }, "scripts": { "lint": "standard */*.js test/**/*.js", - "test": "npm run lint && npm run test:ci", - "test:ci": "tap --timeout=120 test/test-*" + "test": "npm run lint && tap --timeout=120 test/test-*" } } From cc9942e90c703ec1b8725ad4e5c9b47f1dc5b5d7 Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Wed, 2 Sep 2020 16:43:53 -0400 Subject: [PATCH 08/13] reduce diff with python_tests --- .github/workflows/tests.yml | 51 +++++++++++++------------------------ 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index da82911c61..c027d9f65d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,23 +1,13 @@ -# TODO: Line 20, enable python-version: 3.5 -# TODO: Line 69, enable pytest --doctest-modules - name: Tests - -on: - push: - branches: - - master - pull_request: - branches: - - master - +on: [push, pull_request] jobs: - test: + Test: strategy: - fail-fast: false + fail-fast: false + max-parallel: 15 matrix: node: [10.x, 12.x, 14.x] - python: [3.6, 3.7, 3.8] + python: [3.6, 3.7, 3.8, 3.9.0-rc.1] os: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: @@ -37,30 +27,23 @@ jobs: run: | npm install --no-progress pip install flake8 pytest - - name: Lint python + - name: Set Windows environment + if: matrix.os == 'windows-latest' + run: + echo '::set-env name=GYP_MSVS_VERSION::2015' + echo '::set-env name=GYP_MSVS_OVERRIDE_PATH::C:\\Dummy' + - name: Run Node tests + run: | + npm test + - name: Lint Python if: matrix.os == 'ubuntu-latest' run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Run node tests (Linux and macOS) - if: matrix.os != 'windows-latest' - run: | - npm test - - name: Run python tests (Linux and macOS) - if: matrix.os != 'windows-latest' + - name: Run Python tests run: | python -m pytest - - name: Run node tests (Windows) - if: matrix.os == 'windows-latest' - shell: bash - run: | - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" npm test - - name: Run python tests (Windows) - if: matrix.os == 'windows-latest' - shell: bash - run: | - GYP_MSVS_VERSION=2015 GYP_MSVS_OVERRIDE_PATH="C:\\Dummy" python -m pytest - # - name: Run doctests with pytest - # run: pytest --doctest-modules + - name: Run doctests with pytest + run: python -m pytest --doctest-modules From 354c5696f5ab6cc127c211369230e0ffa486edec Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Wed, 2 Sep 2020 16:49:13 -0400 Subject: [PATCH 09/13] Revert docmodules, 3.9.0-rc.1 --- .github/workflows/tests.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c027d9f65d..bb02e6d78a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,3 +1,5 @@ +# TODO: Line 50, enable pytest --doctest-modules + name: Tests on: [push, pull_request] jobs: @@ -7,7 +9,7 @@ jobs: max-parallel: 15 matrix: node: [10.x, 12.x, 14.x] - python: [3.6, 3.7, 3.8, 3.9.0-rc.1] + python: [3.6, 3.7, 3.8] os: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: @@ -30,8 +32,8 @@ jobs: - name: Set Windows environment if: matrix.os == 'windows-latest' run: - echo '::set-env name=GYP_MSVS_VERSION::2015' - echo '::set-env name=GYP_MSVS_OVERRIDE_PATH::C:\\Dummy' + echo ::set-env name=GYP_MSVS_VERSION::2015 + echo ::set-env name=GYP_MSVS_OVERRIDE_PATH::C:\\Dummy - name: Run Node tests run: | npm test @@ -45,5 +47,5 @@ jobs: - name: Run Python tests run: | python -m pytest - - name: Run doctests with pytest - run: python -m pytest --doctest-modules + # - name: Run doctests with pytest + # run: python -m pytest --doctest-modules From a1ef994424d90bf507b22b2413873385532ef238 Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Wed, 2 Sep 2020 17:21:30 -0400 Subject: [PATCH 10/13] Run Node second --- .github/workflows/tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb02e6d78a..cc512b0916 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -# TODO: Line 50, enable pytest --doctest-modules +# TODO: Line 47, enable pytest --doctest-modules name: Tests on: [push, pull_request] @@ -32,11 +32,8 @@ jobs: - name: Set Windows environment if: matrix.os == 'windows-latest' run: - echo ::set-env name=GYP_MSVS_VERSION::2015 - echo ::set-env name=GYP_MSVS_OVERRIDE_PATH::C:\\Dummy - - name: Run Node tests - run: | - npm test + echo '::set-env name=GYP_MSVS_VERSION::2015' + echo '::set-env name=GYP_MSVS_OVERRIDE_PATH::C:\\Dummy' - name: Lint Python if: matrix.os == 'ubuntu-latest' run: | @@ -49,3 +46,6 @@ jobs: python -m pytest # - name: Run doctests with pytest # run: python -m pytest --doctest-modules + - name: Run Node tests + run: | + npm test From a79cac6514aa56de19a273e805b9747d8e2664e5 Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Mon, 7 Sep 2020 16:10:51 -0400 Subject: [PATCH 11/13] Update test-options.js --- test/test-options.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/test-options.js b/test/test-options.js index 252baa2035..9a72f760ac 100644 --- a/test/test-options.js +++ b/test/test-options.js @@ -3,13 +3,19 @@ const test = require('tap').test const gyp = require('../lib/node-gyp') -test('options in environment', function (t) { +test('options in environment', t => { t.plan(1) // `npm test` dumps a ton of npm_config_* variables in the environment. Object.keys(process.env) - .filter(function (key) { return /^npm_config_/.test(key) }) - .forEach(function (key) { delete process.env[key] }) + .filter(key => /^npm_config_/.test(key)) + .forEach(key => { delete process.env[key] }) + + // in some platforms, certain keys are stubborn and cannot be removed + const keys = Object.keys(process.env) + .filter(key => /^npm_config_/.test(key)) + .map(key => key.substring('npm_config_'.length)) + .concat('argv', 'x') // Zero-length keys should get filtered out. process.env.npm_config_ = '42' @@ -18,8 +24,8 @@ test('options in environment', function (t) { // Except loglevel. process.env.npm_config_loglevel = 'debug' - var g = gyp() + const g = gyp() g.parseArgv(['rebuild']) // Also sets opts.argv. - t.deepEqual(Object.keys(g.opts).sort(), ['argv', 'x']) + t.deepEqual(Object.keys(g.opts).sort(), keys.sort()) }) From c41be65602adb89cdfcee69a15a65eddab43040c Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Mon, 7 Sep 2020 23:50:58 -0400 Subject: [PATCH 12/13] style: always-parens --- test/test-options.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test-options.js b/test/test-options.js index 9a72f760ac..b2ac62c874 100644 --- a/test/test-options.js +++ b/test/test-options.js @@ -3,18 +3,18 @@ const test = require('tap').test const gyp = require('../lib/node-gyp') -test('options in environment', t => { +test('options in environment', (t) => { t.plan(1) // `npm test` dumps a ton of npm_config_* variables in the environment. Object.keys(process.env) - .filter(key => /^npm_config_/.test(key)) - .forEach(key => { delete process.env[key] }) + .filter((key) => /^npm_config_/.test(key)) + .forEach((key) => { delete process.env[key] }) // in some platforms, certain keys are stubborn and cannot be removed const keys = Object.keys(process.env) - .filter(key => /^npm_config_/.test(key)) - .map(key => key.substring('npm_config_'.length)) + .filter((key) => /^npm_config_/.test(key)) + .map((key) => key.substring('npm_config_'.length)) .concat('argv', 'x') // Zero-length keys should get filtered out. From ed2e0fdb316c1cf557a38a1310a280dc34c2c619 Mon Sep 17 00:00:00 2001 From: Matias Lopez Date: Tue, 8 Sep 2020 06:18:56 -0400 Subject: [PATCH 13/13] Update .github/workflows/tests.yml Co-authored-by: Christian Clauss --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cc512b0916..729a8f05e9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,7 +3,7 @@ name: Tests on: [push, pull_request] jobs: - Test: + Tests: strategy: fail-fast: false max-parallel: 15