From 3952ea5d83b4b6bcf036a3296611acfdd98238ad Mon Sep 17 00:00:00 2001 From: Jair Henrique Date: Thu, 3 Nov 2022 11:56:20 -0300 Subject: [PATCH] move ci to gh-actions --- .github/workflows/ci.yml | 76 ++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + .travis.yml | 54 ---------------------------- setup.py | 9 ++--- tox.ini | 2 +- 5 files changed, 81 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5f9aa05 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +name: Tests + +on: + push: + branches: + - main + pull_request: + branches: + - "*" + +jobs: + tests: + name: ${{ matrix.os }} - ${{ matrix.python-version }} + + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "pypy-3.7" + - "pypy-3.8" + - "pypy-3.9" + + os: + - ubuntu-latest + - windows-latest + + exclude: + - python-version: "pypy-3.7" + os: windows-latest + - python-version: "pypy-3.8" + os: windows-latest + - python-version: "pypy-3.9" + os: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + pip install -U pip + pip install pytest pytest-cov + pip install -e . + + - name: Test + run: | + pytest --cov pid --cov-report term-missing --cov-report lcov + + - name: Coveralls Parallel + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: run-${{ matrix.os }}-${{ matrix.python-version }} + parallel: true + path-to-lcov: coverage.lcov + + finish: + needs: tests + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true + path-to-lcov: coverage.lcov diff --git a/.gitignore b/.gitignore index 47c84c6..e9bcfae 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ dist/ .idea .eggs venv +*.lcov diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2d34630..0000000 --- a/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -language: python - -# Explicitly specifying default OS for clarity -os: linux - -matrix: - include: - - python: 2.7 - - python: 3.7 - - python: 3.8 - - python: pypy2.7-6.0 - - python: pypy3.5-6.0 - - # Python is not natively supported in windows yet, have to install it through shell script - # https://github.com/WeblateOrg/translation-finder/blob/master/.travis.yml#L20-L33 - - os: windows - language: sh - python: 2.7 - env: - - PY_VERSION_BASE=2 PY_VERSION=2.7.15 PY_VERSION_PATH=27 - - os: windows - language: sh - python: 3.7 - env: - - PY_VERSION_BASE=3 PY_VERSION=3.7.2 PY_VERSION_PATH=37 - - os: windows - language: sh - python: 3.8 - env: - - PY_VERSION_BASE=3 PY_VERSION=3.8.1 PY_VERSION_PATH=38 - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - sudo chmod 0777 /var/run; - fi - -install: - # Install python on windows machine, environment variables should be set in the matrix above - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then - choco install python${PY_VERSION_BASE} --version ${PY_VERSION}; - export PATH="/c/Python${PY_VERSION_PATH}:/c/Python${PY_VERSION_PATH}/Scripts:$PATH"; - python -m pip install --upgrade pip wheel; - fi - - pip install -U flake8 pytest pytest-cov - - dpkg --compare-versions $TRAVIS_PYTHON_VERSION ge 3.3 || pip install "mock>=2.0.0" - - pip install -e . - -script: - - echo $TRAVIS_PYTHON_VERSION - - flake8 --show-source --ignore=E501,W391 . - - PYTHONPATH=. pytest -v -x --cov=pid - -after_success: - - coveralls diff --git a/setup.py b/setup.py index 0aa3a37..d78c140 100644 --- a/setup.py +++ b/setup.py @@ -41,14 +41,12 @@ def find_version(*file_paths): 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: Implementation :: PyPy', ], keywords='pid pidfile context manager decorator', @@ -58,7 +56,6 @@ def find_version(*file_paths): ], extras_require={ 'tests': [ - 'mock ; python_version < "3"', 'pytest', ] }, diff --git a/tox.ini b/tox.ini index 6692092..6229f09 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py36,py37,py38,py39,pypy,pypy3 +envlist = py37,py38,py39,py310,py311,pypy,pypy3 [testenv] extras =