--- /dev/null
+name: Run tests
+
+on: [push, pull_request]
+
+jobs:
+ run-tests:
+
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, windows-latest]
+ python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 'pypy-2.7']
+ include:
+ - os: ubuntu-latest
+ os-name: Linux
+ pip-cache-path: ~/.cache/pip
+ - os: windows-latest
+ os-name: w32
+ pip-cache-path: ~\AppData\Local\pip\Cache
+
+ name: Python ${{ matrix.python-version }} @ ${{ matrix.os-name }}
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Cache pip
+ uses: actions/cache@v2
+ with:
+ path: ${{ matrix.pip-cache-path }}
+ key: ${{ runner.os }}-pip
+ - name: Install dependencies
+ run: |
+ python --version
+ python -m pip install --upgrade "pip<21.0" "setuptools<45" wheel
+ pip --version
+ pip install --upgrade virtualenv tox
+ - name: Set TOXENV
+ run: |
+ import os, sys
+ if hasattr(sys, 'pypy_version_info'):
+ toxenv = 'pypy'
+ else:
+ pyver = '%d%d' % tuple(sys.version_info[:2])
+ toxenv = 'py%s' % pyver
+ if os.name == 'posix':
+ toxenv += ',py%s-flake8' % pyver
+ with open(os.environ['GITHUB_ENV'], 'a') as f:
+ f.write('TOXENV=' + toxenv + '\n')
+ shell: python
+ - name: Run tox
+ run: |
+ python -c "import os; print(os.environ['TOXENV'])"
+ tox
+++ /dev/null
-os: linux
-
-dist: xenial
-
-language: python
-
-python:
- - "2.7"
-
-cache: pip
-
-matrix:
- include:
- - python: "2.7"
- env: TOXENV=py27
- - python: "3.5"
- env: TOXENV=py35
- - python: "3.6"
- env: TOXENV=py36
- - python: "3.7"
- env: TOXENV=py37
- - python: "3.8"
- env: TOXENV=py38
- - python: "3.9"
- env: TOXENV=py39
- - python: "2.7"
- env: TOXENV=py27-flake8
- - python: "3.9"
- env: TOXENV=py39-flake8
-
-install:
- - travis_retry pip install --upgrade "pip<21" "setuptools<44" "tox>=3.15"
-
-script:
- - tox
-
-before_cache:
- - scripts/remove-old-files.py -o 180 ~/.cache/pip
+++ /dev/null
-# Test on windows
-# Heavily inspired by Oliver Grisel's appveyor-demo (https://github.com/ogrisel/python-appveyor-demo)
-version: '{branch}-{build}'
-
-cache:
- - '%LOCALAPPDATA%\pip\Cache'
-
-# Match travis
-clone_depth: 50
-
-environment:
- matrix:
- - TOXENV: "py27"
- PYTHON_VERSION: "2.7"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python27"
- - TOXENV: "py36"
- PYTHON_VERSION: "3.6"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python36"
- - TOXENV: "py36"
- PYTHON_VERSION: "3.6"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python36-x64"
- - TOXENV: "py37"
- PYTHON_VERSION: "3.7"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python37"
- - TOXENV: "py37"
- PYTHON_VERSION: "3.7"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python37-x64"
- - TOXENV: "py38"
- PYTHON_VERSION: "3.8"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python38"
- - TOXENV: "py38"
- PYTHON_VERSION: "3.8"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python38-x64"
- - TOXENV: "py39"
- PYTHON_VERSION: "3.9"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python39"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- - TOXENV: "py39"
- PYTHON_VERSION: "3.9"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python39-x64"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- - TOXENV: "py27-flake8"
- PYTHON_VERSION: "2.7"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python27"
- - TOXENV: "py39-flake8"
- PYTHON_VERSION: "3.9"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python39-x64"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
-
-install:
- # Ensure we use the right python version
- - "SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\\Scripts;%PATH%"
- - "SET TOXPYTHON=%PYTHON_HOME%\\python.exe"
- - "python --version"
- - "python -c \"import struct; print(struct.calcsize('P') * 8)\""
- - "python -m pip install --upgrade \"pip<21\" \"setuptools<44\""
- - "pip install --upgrade \"tox>=3.15\" ppu"
- - "pip --version"
-
-# No build step - we don't have C extensions
-build: false
-
-test_script:
- - "tox"
-
-after_test:
- - "scripts\\remove-old-files.py -o 180 %LOCALAPPDATA%\\pip\\Cache"
* Python 3.8, Python 3.9.
+* GitHub Actions.
+
+* Stop testing at Travis CI.
+
+* Stop testing at AppVeyor.
+
Version 0.7.0 (2019-02-01)
--------------------------
#! /usr/bin/env python
+import os
import subprocess
import sys
from ppu_tu import setup, teardown, find_in_path # noqa
test_prog_path = find_in_path('which.py')
+if sys.platform == 'win32':
+ os_env_pathext = os.environ['PATHEXT']
+ pathext = os_env_pathext.lower().split(os.pathsep)
+ if '.py' not in pathext:
+ os_env_pathext += ';.py'
+ os.environ['PATHEXT'] = os_env_pathext
+
def test_which():
assert subprocess.check_output(