Skip to content

Commit

Permalink
Move to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca committed Mar 18, 2020
1 parent 132651a commit 386b0c2
Show file tree
Hide file tree
Showing 9 changed files with 214 additions and 60 deletions.
178 changes: 178 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: Tests

on:
# This avoids having duplicate builds for a pull request
push:
branches:
- master
pull_request:
branches:
- master

jobs:
smoke:
name: Linux smoke test Py${{ matrix.PYTHON_VERSION }}
runs-on: ubuntu-latest
env:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
QT_DEBUG_PLUGINS: 1
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['2.7', '3.5', '3.8']
steps:
- name: Checkout branch
uses: actions/checkout@v1
- name: Install Conda
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: test
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Install Dependencies
shell: bash -l {0}
run: pip install -r requirements/install.txt
- name: Install Test Dependencies
shell: bash -l {0}
run: pip install -r requirements/dev.txt
- name: Install Package
shell: bash -l {0}
run: python setup.py develop
- name: Show Environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Format
if: matrix.PYTHON_VERSION == '2.7'
shell: bash -l {0}
run: python run_checks_and_format.py
- name: Run tests
shell: bash -l {0}
run: xvfb-run --auto-servernum pytest tests --cov=qtsass --cov-report=term-missing -x -vv
- name: Upload coverage to Codecov
shell: bash -l {0}
run: codecov -t 74b56e56-6c81-4b43-b830-c46638da84a7

linux:
name: Linux Py${{ matrix.PYTHON_VERSION }}
needs: smoke
runs-on: ubuntu-latest
env:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
QT_DEBUG_PLUGINS: 1
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.6', '3.7']
steps:
- name: Checkout branch
uses: actions/checkout@v1
- name: Install Conda
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: test
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Install Dependencies
shell: bash -l {0}
run: pip install -r requirements/install.txt
- name: Install Test Dependencies
shell: bash -l {0}
run: pip install -r requirements/dev.txt
- name: Install Package
shell: bash -l {0}
run: python setup.py develop
- name: Show Environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Run tests
shell: bash -l {0}
run: xvfb-run --auto-servernum pytest tests --cov=qtsass --cov-report=term-missing -x -vv
- name: Upload coverage to Codecov
shell: bash -l {0}
run: codecov -t 74b56e56-6c81-4b43-b830-c46638da84a7

macos:
name: Mac Py${{ matrix.PYTHON_VERSION }}
needs: smoke
runs-on: macos-latest
env:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
QT_DEBUG_PLUGINS: 1
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['2.7', '3.5', '3.6', '3.7', '3.8']
steps:
- name: Checkout branch
uses: actions/checkout@v1
- name: Install Conda
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: test
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Install Dependencies
shell: bash -l {0}
run: pip install -r requirements/install.txt
- name: Install Test Dependencies
shell: bash -l {0}
run: pip install -r requirements/dev.txt
- name: Install Package
shell: bash -l {0}
run: python setup.py develop
- name: Show Environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Run tests
shell: bash -l {0}
run: pytest tests --cov=qtsass --cov-report=term-missing -x -vv
- name: Upload coverage to Codecov
shell: bash -l {0}
run: codecov -t 74b56e56-6c81-4b43-b830-c46638da84a7

windows:
name: Windows Py${{ matrix.PYTHON_VERSION }}
needs: smoke
runs-on: windows-latest
env:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
QT_DEBUG_PLUGINS: 1
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['2.7', '3.5', '3.6', '3.7', '3.8']
steps:
- name: Checkout branch
uses: actions/checkout@v1
- name: Install Conda
uses: goanpeca/setup-miniconda@v1
with:
activate-environment: test
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Install Dependencies
shell: bash -l {0}
run: pip install -r requirements/install.txt
- name: Install Test Dependencies
shell: bash -l {0}
run: pip install -r requirements/dev.txt
- name: Install Package
shell: bash -l {0}
run: python setup.py develop
- name: Show Environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Run tests
shell: bash -l {0}
run: pytest tests --cov=qtsass --cov-report=term-missing -x -vv
- name: Upload coverage to Codecov
shell: bash -l {0}
run: codecov -t 74b56e56-6c81-4b43-b830-c46638da84a7
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![OpenCollective Backers](https://opencollective.com/spyder/backers/badge.svg?color=blue)](#backers)
[![Join the chat at https://gitter.im/spyder-ide/public](https://badges.gitter.im/spyder-ide/spyder.svg)](https://gitter.im/spyder-ide/public)<br>
[![Travis build status](https://img.shields.io/travis/spyder-ide/qtsass/master.svg)](https://travis-ci.org/spyder-ide/qtsass)
[![AppVeyor build status](https://img.shields.io/appveyor/ci/spyder-ide/qtsass/master.svg)](https://ci.appveyor.com/project/spyder-ide/qtsass)
[![Github build status](https://github.com/spyder-ide/qtsass/workflows/Tests/badge.svg)](https://github.com/spyder-ide/qtsass/actions)
[![Codecov coverage](https://img.shields.io/codecov/c/github/spyder-ide/qtsass/master.svg)](https://codecov.io/gh/spyder-ide/qtsass)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spyder-ide/qtsass/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/spyder-ide/qtsass/?branch=master)

Expand Down
16 changes: 0 additions & 16 deletions appveyor.yml

This file was deleted.

20 changes: 18 additions & 2 deletions qtsass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,21 @@
enable_logging()

# Constants
VERSION_INFO = (0, 1, 2, 'dev0')
__version__ = '.'.join(map(str, VERSION_INFO))
__version__ = '0.2.2.dev0'


def _to_version_info(version):
"""Convert a version string to a number and string tuple."""
parts = []
for part in version.split('.'):
try:
part = int(part)
except ValueError:
pass

parts.append(part)

return tuple(parts)


VERSION_INFO = _to_version_info(__version__)
7 changes: 3 additions & 4 deletions requirements-dev.txt → requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
codecov
coverage==4.5.3
isort==4.3.15
pycodestyle==2.5.0
pydocstyle==3.0.0
pytest==4.4.1
pytest-cov==2.6.1
yapf==0.26
PySide2; python_version=="3.6"
pytest
pytest-cov
yapf==0.26
File renamed without changes.
15 changes: 11 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@ def get_version(module='qtsass'):
"""Get version."""
with open(os.path.join(HERE, module, '__init__.py'), 'r') as f:
data = f.read()

lines = data.split('\n')
for line in lines:
if line.startswith('VERSION_INFO'):
version_tuple = ast.literal_eval(line.split('=')[-1].strip())
version = '.'.join(map(str, version_tuple))
if line.startswith('__version__'):
version = ast.literal_eval(line.split('=')[-1].strip())
break

return version


def get_description():
"""Get long description."""
with open(os.path.join(HERE, 'README.md'), 'r', encoding='utf-8') as f:
data = f.read()

return data


Expand Down Expand Up @@ -66,12 +68,17 @@ def get_description():
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development :: Build Tools',
'Topic :: Software Development :: Libraries :: Python Modules',
),
install_requires=[
'libsass',
],
keywords='qt sass qtsass scss css stylesheets',
keywords='qt sass qtsass scss css qss stylesheets',
)
9 changes: 3 additions & 6 deletions tests/test_watchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,10 @@ def test_watchers(Watcher, tmpdir):
assert c.count == 2


@pytest.mark.skipif(sys.platform.startswith('linux') or not QtWatcher,
reason="Fails on linux")
def test_qtwatcher(tmpdir):
"""Test QtWatcher implementation"""

# Skip when QtWatcher is None - When Qt is not installed
if not QtWatcher:
return

"""Test QtWatcher implementation."""
# Constructing a QApplication will cause the QtWatcher constructed
# below to use a Signal to dispatch callbacks.
from qtsass.watchers.qt import QApplication
Expand Down

0 comments on commit 386b0c2

Please sign in to comment.