From 744393a8c680a9ed72ed5fe14699479a5bf8cd63 Mon Sep 17 00:00:00 2001 From: "Afshin T. Darian" Date: Tue, 16 Mar 2021 15:27:20 +0000 Subject: [PATCH] Switch to GitHub Actions --- .github/workflows/test.yml | 56 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 20 -------------- README.rst | 7 ++++- appveyor.yml | 28 ------------------- setup.py | 1 + 5 files changed, 63 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f6830fc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,56 @@ +name: Tests +on: + push: + branches: "*" + pull_request: + branches: "*" +jobs: + test: + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu, windows] + python-version: ["3.6", "3.8", "3.9"] + exclude: + # https://github.com/spyder-ide/pywinpty/issues/134 + - os: windows + python-version: "3.9" + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Install Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + architecture: "x64" + - name: Upgrade packaging dependencies + run: | + pip install --upgrade pip setuptools wheel --user + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + - name: Cache pip + uses: actions/cache@v1 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.cfg') }} + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.python-version }}- + ${{ runner.os }}-pip- + - name: Install the Python dependencies + run: | + pip install -e .[test] + - name: List installed packages + run: | + pip freeze + pip check + - name: Run the tests + if: ${{ matrix.os != 'windows' }} + run: | + pytest -vv + - name: Run basic test on Windows + if: ${{ matrix.os == 'windows' }} + run: | + pytest terminado/tests/basic_test.py::CommonTests::test_basic diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9566c47..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -os: linux -arch: - - amd64 - - ppc64le -dist: focal -language: python -python: - - "3.6" - - "3.7" - - "3.8" - -# Install dependencies -install: - - pip install tornado ptyprocess - -# command to run tests -script: py.test - -# Enable new Travis stack, should speed up builds -sudo: false diff --git a/README.rst b/README.rst index e2c1a92..4803b8c 100644 --- a/README.rst +++ b/README.rst @@ -22,6 +22,11 @@ JS: * ``terminado/_static/terminado.js``: A lightweight wrapper to set up a term.js terminal with a websocket. +Local Installation: + + $ pip install -e .[test] + + Usage example: .. code:: python @@ -66,4 +71,4 @@ for more examples. This is a simplified version of the ``single.py`` demo. Run the unit tests with: - $ nosetests + $ pytest diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index ded15f4..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Do not build feature branch with open Pull Requests -skip_branch_with_pr: true - -# environment variables -environment: - matrix: - - PYTHON: "C:\\Python36-x64" - - PYTHON: "C:\\Python38-x64" - -build: off - -# scripts that run after cloning repository -install: - # If there is a newer build queued for the same PR, cancel this one. - # The AppVeyor 'rollout builds' option is supposed to serve the same - # purpose but it is problematic because it tends to cancel builds pushed - # directly to master instead of just PR builds (or the converse). - # credits: JuliaLang developers. - - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` - https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` - Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` - throw "There are newer queued builds for this pull request, failing early." } - # Install dependencies - # update path to use installed pip and py.test - - set PATH=%PYTHON%\\scripts;%PATH% - - 'pip install tornado pywinpty pytest' -test_script: - - 'py.test terminado/tests/basic_test.py::CommonTests::test_basic' diff --git a/setup.py b/setup.py index c307a80..76084a1 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,7 @@ "pywinpty (>=0.5);os_name=='nt'", "tornado (>=4)", ], + extras_require = dict(test=['pytest']), python_requires=">=3.6", classifiers=[ "Environment :: Web Environment",