Skip to content

Commit

Permalink
Merge branch 'master' into stringlistmodel
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 authored Jan 2, 2017
2 parents 189f819 + ef3b32b commit 16e965e
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 24 deletions.
107 changes: 107 additions & 0 deletions .ciocheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# -----------------------------------------------------------------------------
# ciocheck
# https://github.com/ContinuumIO/ciocheck
# -----------------------------------------------------------------------------
[ciocheck]
branch = origin/master
diff_mode = commited
file_mode = all
check = pep8,pydocstyle,flake8,pylint

# Python (pyformat)
add_copyright = true
add_header = true
add_init = true

# -----------------------------------------------------------------------------
# pep8
# http://pep8.readthedocs.io/en/latest/intro.html#configuration
# -----------------------------------------------------------------------------
[pep8]
exclude = */tests/*
ignore = E126
max-line-length = 79

# -----------------------------------------------------------------------------
# pydocstyle
# http://www.pydocstyle.org/en/latest/usage.html#example
# -----------------------------------------------------------------------------
[pydocstyle]
add-ignore = D203
inherit = false

# -----------------------------------------------------------------------------
# Flake 8
# http://flake8.readthedocs.io/en/latest/config.html
# -----------------------------------------------------------------------------
[flake8]
exclude = */tests/*
ignore = E126,F401
max-line-length = 79
max-complexity = 64

# -----------------------------------------------------------------------------
# pylint
# https://pylint.readthedocs.io/en/latest/
# -----------------------------------------------------------------------------
[pylint:messages]
disable=unused-import

# -----------------------------------------------------------------------------
# isort
# https://github.com/timothycrosley/isort/wiki/isort-Settings
# -----------------------------------------------------------------------------
[isort]
from_first = true
import_heading_stdlib = Standard library imports
import_heading_firstparty = Local imports
import_heading_thirdparty = Third party imports
indent = ' '
known_first_party = qtpy
known_third_party = PySide, PyQt4, PyQt5
line_length = 79
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER

# -----------------------------------------------------------------------------
# yapf
# https://github.com/google/yapf#formatting-style
# -----------------------------------------------------------------------------
[yapf:style]
based_on_style = pep8
column_limit = 79
spaces_before_comment = 2

# -----------------------------------------------------------------------------
# autopep8
# http://pep8.readthedocs.io/en/latest/intro.html#configuration
# -----------------------------------------------------------------------------
[autopep8]
exclude = */tests/*
ignore = E126,
max-line-length = 79

# -----------------------------------------------------------------------------
# Coverage
# http://coverage.readthedocs.io/en/latest/config.html
# -----------------------------------------------------------------------------
[coverage:run]
omit =
*/tests/*
*/build/*

[coverage:report]
fail_under = 0
show_missing = true
skip_covered = true
exclude_lines =
pragma: no cover
def test():
if __name__ == .__main__.:

# -----------------------------------------------------------------------------
# pytest
# http://doc.pytest.org/en/latest/usage.html
# -----------------------------------------------------------------------------
[pytest]
addopts = -rfew --durations=10
python_functions = test_*
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ branches:
- master

os:
- linux
- osx

env:
global:
- SETUP_XVFB=True
- CONDA_CHANNELS="qttesting"
- CONDA_CHANNELS="conda-forge"
- CONDA_DEPENDENCIES="pytest pytest-cov"
- PIP_DEPENDENCIES="coveralls"

Expand All @@ -43,11 +42,10 @@ before_install:
install:
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh
- python setup.py install
- python setup.py develop

script:
- python qtpy/tests/runtests.py

after_success:
- coveralls

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Gonzalo Peña-Castellanos
Copyright (c) The Spyder Development Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include AUTHORS.md
include CHANGELOG.md
include LICENSE.txt
include README.md
10 changes: 9 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ platform:
-x64

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." }
- "git clone git://github.com/astropy/ci-helpers.git"
- "powershell ci-helpers/appveyor/install-miniconda.ps1"
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
Expand All @@ -45,4 +54,3 @@ build: false

test_script:
- "%CMD_IN_ENV% python qtpy/tests/runtests.py"

32 changes: 20 additions & 12 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
# https://circleci.com/gh/spyder-ide/qtpy/

machine:
environment:
# Used by test scripts
TEST_CI: "True"
PYTHON_TEST: "$HOME/miniconda/envs/test/bin/python"
PYTEST: "$HOME/miniconda/envs/test/bin/py.test"
PATH: "$HOME/miniconda/bin:$PATH" # To avoid prepending this to the commands on circle-ci
# Python versions to test (Maximum of 4 different versions for now)
PY_VERSIONS: "2.7 3.4 3.5"
PY_VERSIONS: "3.5 3.4 2.7"
# Used by astropy-ci helpers
TRAVIS_OS_NAME: "linux"
CONDA_CHANNELS: "qttesting"
CONDA_DEPENDENCIES: "pyqt pytest pytest-cov qt"
PIP_DEPENDENCIES: "coveralls"

dependencies:
override:
# First convert PY_VERSIONS to an array and then select the Python version based on the
# CIRCLE_NODE_INDEX
# First convert PY_VERSIONS to an array and then select the Python version
# based on the CIRCLE_NODE_INDEX
- PY_VERSIONS=($PY_VERSIONS) &&
TRAVIS_PYTHON_VERSION=${PY_VERSIONS[$CIRCLE_NODE_INDEX]} &&
echo -e "PYTHON = $TRAVIS_PYTHON_VERSION \n============" &&
git clone git://github.com/astropy/ci-helpers.git &&
source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh &&
"$PYTHON_TEST" setup.py install;
export PATH="$HOME/miniconda/bin:$PATH" &&
source activate test &&
conda install -q ciocheck -c spyder-ide &&
python setup.py develop;

test:
override:
- conda info --json: # note the colon
# Check style
- export PATH="$HOME/miniconda/bin:$PATH" && source activate test && ciocheck qtpy: # note the colon
parallel: true
# Check PyQt5
- export PATH="$HOME/miniconda/bin:$PATH" && source activate test && conda install -q qt=5.* pyqt=5.* && python qtpy/tests/runtests.py: # note the colon
parallel: true
- "$PYTHON_TEST qtpy/tests/runtests.py": # note the colon
# Check PySide2
# - export PATH="$HOME/miniconda/bin:$PATH" && source activate test && conda install -q qt=5.* pyside2 && python qtpy/tests/runtests.py: # note the colon
# parallel: true
# Check PyQt4
- export PATH="$HOME/miniconda/bin:$PATH" && source activate test && conda install -q qt=4.* pyqt=4.* && python qtpy/tests/runtests.py: # note the colon
parallel: true
# Check Pyside
#- export PATH="$HOME/miniconda/bin:$PATH" && source activate test && conda remove -q qt pyqt && conda install -c conda-forge qt=4.* pyside && python qtpy/tests/runtests.py: # note the colon
# parallel: true
9 changes: 3 additions & 6 deletions qtpy/QtSvg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@
from . import PYQT4, PYQT5, PYSIDE, PythonQtError

if PYQT5:
from PyQt5.QtSvg import (QGraphicsSvgItem, QSvgGenerator, QSvgRenderer,
QSvgWidget)
from PyQt5.QtSvg import *
elif PYQT4:
from PyQt4.QtSvg import (QGraphicsSvgItem, QSvgGenerator, QSvgRenderer,
QSvgWidget)
from PyQt4.QtSvg import *
elif PYSIDE:
from PySide.QtSvg import (QGraphicsSvgItem, QSvgGenerator, QSvgRenderer,
QSvgWidget)
from PySide.QtSvg import *
else:
raise PythonQtError('No Qt bindings could be found')

Expand Down
7 changes: 7 additions & 0 deletions qtpy/_patch/qheaderview.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# -*- coding: utf-8 -*-
#
# Copyright © The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)

def introduce_renamed_methods_qheaderview(QHeaderView):

_isClickable = QHeaderView.isClickable
Expand Down

0 comments on commit 16e965e

Please sign in to comment.