From 957e0022283caeefcf872ecd77172989384b0028 Mon Sep 17 00:00:00 2001 From: numirias Date: Tue, 9 Jul 2019 16:38:17 +0200 Subject: [PATCH] Switch testing to tox + compatibility with qtile 0.14 --- .coveragerc | 8 + .gitignore | 1 + .travis.yml | 12 +- Makefile | 19 --- Pipfile | 23 --- Pipfile.lock | 346 ------------------------------------------- lib/qtile | 2 +- plasma/layout.py | 2 +- setup.py | 2 +- tests/conftest.py | 8 + tests/test_layout.py | 82 +++++----- tox.ini | 51 +++++++ 12 files changed, 120 insertions(+), 436 deletions(-) create mode 100644 .coveragerc delete mode 100644 Makefile delete mode 100644 Pipfile delete mode 100644 Pipfile.lock create mode 100644 tox.ini diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..21b37a8 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,8 @@ +[run] +branch = True +source = plasma + +[paths] +source = + plasma + .tox/*/lib/python*/site-packages/plasma diff --git a/.gitignore b/.gitignore index 6645d54..11034d6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__/ *$py.class *.egg-info/ .coverage +.coverage.* .cache/ build/ dist/ diff --git a/.travis.yml b/.travis.yml index d232558..3144535 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,13 @@ addons: apt: packages: - xserver-xephyr +jobs: + include: + - python: 3.6 + env: TOXENV=lint install: - - make + - pip install tox-travis codecov script: - - make test - - make lint - - make codecov + - tox +after_success: + - codecov diff --git a/Makefile b/Makefile deleted file mode 100644 index 982822c..0000000 --- a/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -init: - pip install pipenv --upgrade - # We need to install xcffib first - pipenv install --skip-lock "xcffib>=0.5.0" - pipenv install --verbose --sequential --dev --skip-lock - cd lib/qtile/ && python ./libqtile/ffi_build.py -test: - pipenv run pytest -v --cov plasma --cov-report term-missing:skip-covered tests/ -lint: - pipenv run flake8 - pipenv run pylint --rcfile setup.cfg plasma/ -codecov: - pipenv run codecov -publish: - python setup.py bdist_wheel sdist - twine upload -r pypi dist/* - rm -rf *.egg-info build/ dist/ -readme: - python tools/make_readme.py diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 9b6d047..0000000 --- a/Pipfile +++ /dev/null @@ -1,23 +0,0 @@ -[[source]] - -url = "https://pypi.python.org/simple" -verify_ssl = true -name = "pypi" - - -[packages] - -xcffib = ">=0.5.0" -cffi = "*" -cairocffi = "*" -qtile = "*" -"flake8" = "*" - - -[dev-packages] - -pytest = "*" -pytest-cov = "*" -codecov = "*" -pylint = "*" -xvfbwrapper = "*" diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index a182d61..0000000 --- a/Pipfile.lock +++ /dev/null @@ -1,346 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "82cd4e3ce5b23c3ec3fa4d2955795ad66cb1d1ec13cd92792629b2a4796ea6de" - }, - "pipfile-spec": 6, - "requires": {}, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.python.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "cairocffi": { - "extras": [ - "xcb" - ], - "hashes": [ - "sha256:15386c3a9e08823d6826c4491eaccc7b7254b1dc587a3b9ce60c350c3f990337" - ], - "index": "pypi", - "version": "==0.9.0" - }, - "cffi": { - "hashes": [ - "sha256:151b7eefd035c56b2b2e1eb9963c90c6302dc15fbd8c1c0a83a163ff2c7d7743", - "sha256:1553d1e99f035ace1c0544050622b7bc963374a00c467edafac50ad7bd276aef", - "sha256:1b0493c091a1898f1136e3f4f991a784437fac3673780ff9de3bcf46c80b6b50", - "sha256:2ba8a45822b7aee805ab49abfe7eec16b90587f7f26df20c71dd89e45a97076f", - "sha256:3bb6bd7266598f318063e584378b8e27c67de998a43362e8fce664c54ee52d30", - "sha256:3c85641778460581c42924384f5e68076d724ceac0f267d66c757f7535069c93", - "sha256:3eb6434197633b7748cea30bf0ba9f66727cdce45117a712b29a443943733257", - "sha256:495c5c2d43bf6cebe0178eb3e88f9c4aa48d8934aa6e3cddb865c058da76756b", - "sha256:4c91af6e967c2015729d3e69c2e51d92f9898c330d6a851bf8f121236f3defd3", - "sha256:57b2533356cb2d8fac1555815929f7f5f14d68ac77b085d2326b571310f34f6e", - "sha256:770f3782b31f50b68627e22f91cb182c48c47c02eb405fd689472aa7b7aa16dc", - "sha256:79f9b6f7c46ae1f8ded75f68cf8ad50e5729ed4d590c74840471fc2823457d04", - "sha256:7a33145e04d44ce95bcd71e522b478d282ad0eafaf34fe1ec5bbd73e662f22b6", - "sha256:857959354ae3a6fa3da6651b966d13b0a8bed6bbc87a0de7b38a549db1d2a359", - "sha256:87f37fe5130574ff76c17cab61e7d2538a16f843bb7bca8ebbc4b12de3078596", - "sha256:95d5251e4b5ca00061f9d9f3d6fe537247e145a8524ae9fd30a2f8fbce993b5b", - "sha256:9d1d3e63a4afdc29bd76ce6aa9d58c771cd1599fbba8cf5057e7860b203710dd", - "sha256:a36c5c154f9d42ec176e6e620cb0dd275744aa1d804786a71ac37dc3661a5e95", - "sha256:a6a5cb8809091ec9ac03edde9304b3ad82ad4466333432b16d78ef40e0cce0d5", - "sha256:ae5e35a2c189d397b91034642cb0eab0e346f776ec2eb44a49a459e6615d6e2e", - "sha256:b0f7d4a3df8f06cf49f9f121bead236e328074de6449866515cea4907bbc63d6", - "sha256:b75110fb114fa366b29a027d0c9be3709579602ae111ff61674d28c93606acca", - "sha256:ba5e697569f84b13640c9e193170e89c13c6244c24400fc57e88724ef610cd31", - "sha256:be2a9b390f77fd7676d80bc3cdc4f8edb940d8c198ed2d8c0be1319018c778e1", - "sha256:ca1bd81f40adc59011f58159e4aa6445fc585a32bb8ac9badf7a2c1aa23822f2", - "sha256:d5d8555d9bfc3f02385c1c37e9f998e2011f0db4f90e250e5bc0c0a85a813085", - "sha256:e55e22ac0a30023426564b1059b035973ec82186ddddbac867078435801c7801", - "sha256:e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4", - "sha256:ecbb7b01409e9b782df5ded849c178a0aa7c906cf8c5a67368047daab282b184", - "sha256:ed01918d545a38998bfa5902c7c00e0fee90e957ce036a4000a88e3fe2264917", - "sha256:edabd457cd23a02965166026fd9bfd196f4324fe6032e866d0f3bd0301cd486f", - "sha256:fdf1c1dc5bafc32bc5d08b054f94d659422b05aba244d6be4ddc1c72d9aa70fb" - ], - "index": "pypi", - "version": "==1.11.5" - }, - "entrypoints": { - "hashes": [ - "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", - "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451" - ], - "version": "==0.3" - }, - "flake8": { - "hashes": [ - "sha256:c3ba1e130c813191db95c431a18cb4d20a468e98af7a77e2181b68574481ad36", - "sha256:fd9ddf503110bf3d8b1d270e8c673aab29ccb3dd6abf29bae1f54e5116ab4a91" - ], - "index": "pypi", - "version": "==3.7.5" - }, - "mccabe": { - "hashes": [ - "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", - "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" - ], - "version": "==0.6.1" - }, - "pycodestyle": { - "hashes": [ - "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", - "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c" - ], - "version": "==2.5.0" - }, - "pycparser": { - "hashes": [ - "sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3" - ], - "version": "==2.19" - }, - "pyflakes": { - "hashes": [ - "sha256:5e8c00e30c464c99e0b501dc160b13a14af7f27d4dffb529c556e30a159e231d", - "sha256:f277f9ca3e55de669fba45b7393a1449009cff5a37d1af10ebb76c52765269cd" - ], - "version": "==2.1.0" - }, - "qtile": { - "hashes": [ - "sha256:d1873f7cf3c77df27d3a6486fb76f9feb8b504530468a073c2d432136521e150" - ], - "index": "pypi", - "version": "==0.13.0" - }, - "six": { - "hashes": [ - "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", - "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" - ], - "version": "==1.12.0" - }, - "xcffib": { - "hashes": [ - "sha256:36142cb72535933e8e1ed39ff2c45559fa7038823bd6be6961ef8ee5bb0f6912" - ], - "index": "pypi", - "version": "==0.6.0" - } - }, - "develop": { - "astroid": { - "hashes": [ - "sha256:35b032003d6a863f5dcd7ec11abd5cd5893428beaa31ab164982403bcb311f22", - "sha256:6a5d668d7dc69110de01cdf7aeec69a679ef486862a0850cc0fd5571505b6b7e" - ], - "version": "==2.1.0" - }, - "atomicwrites": { - "hashes": [ - "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", - "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6" - ], - "version": "==1.3.0" - }, - "attrs": { - "hashes": [ - "sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69", - "sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb" - ], - "version": "==18.2.0" - }, - "certifi": { - "hashes": [ - "sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7", - "sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033" - ], - "version": "==2018.11.29" - }, - "chardet": { - "hashes": [ - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" - ], - "version": "==3.0.4" - }, - "codecov": { - "hashes": [ - "sha256:8ed8b7c6791010d359baed66f84f061bba5bd41174bf324c31311e8737602788", - "sha256:ae00d68e18d8a20e9c3288ba3875ae03db3a8e892115bf9b83ef20507732bed4" - ], - "index": "pypi", - "version": "==2.0.15" - }, - "coverage": { - "hashes": [ - "sha256:09e47c529ff77bf042ecfe858fb55c3e3eb97aac2c87f0349ab5a7efd6b3939f", - "sha256:0a1f9b0eb3aa15c990c328535655847b3420231af299386cfe5efc98f9c250fe", - "sha256:0cc941b37b8c2ececfed341444a456912e740ecf515d560de58b9a76562d966d", - "sha256:10e8af18d1315de936d67775d3a814cc81d0747a1a0312d84e27ae5610e313b0", - "sha256:1b4276550b86caa60606bd3572b52769860a81a70754a54acc8ba789ce74d607", - "sha256:1e8a2627c48266c7b813975335cfdea58c706fe36f607c97d9392e61502dc79d", - "sha256:2b224052bfd801beb7478b03e8a66f3f25ea56ea488922e98903914ac9ac930b", - "sha256:447c450a093766744ab53bf1e7063ec82866f27bcb4f4c907da25ad293bba7e3", - "sha256:46101fc20c6f6568561cdd15a54018bb42980954b79aa46da8ae6f008066a30e", - "sha256:4710dc676bb4b779c4361b54eb308bc84d64a2fa3d78e5f7228921eccce5d815", - "sha256:510986f9a280cd05189b42eee2b69fecdf5bf9651d4cd315ea21d24a964a3c36", - "sha256:5535dda5739257effef56e49a1c51c71f1d37a6e5607bb25a5eee507c59580d1", - "sha256:5a7524042014642b39b1fcae85fb37556c200e64ec90824ae9ecf7b667ccfc14", - "sha256:5f55028169ef85e1fa8e4b8b1b91c0b3b0fa3297c4fb22990d46ff01d22c2d6c", - "sha256:6694d5573e7790a0e8d3d177d7a416ca5f5c150742ee703f3c18df76260de794", - "sha256:6831e1ac20ac52634da606b658b0b2712d26984999c9d93f0c6e59fe62ca741b", - "sha256:77f0d9fa5e10d03aa4528436e33423bfa3718b86c646615f04616294c935f840", - "sha256:828ad813c7cdc2e71dcf141912c685bfe4b548c0e6d9540db6418b807c345ddd", - "sha256:85a06c61598b14b015d4df233d249cd5abfa61084ef5b9f64a48e997fd829a82", - "sha256:8cb4febad0f0b26c6f62e1628f2053954ad2c555d67660f28dfb1b0496711952", - "sha256:a5c58664b23b248b16b96253880b2868fb34358911400a7ba39d7f6399935389", - "sha256:aaa0f296e503cda4bc07566f592cd7a28779d433f3a23c48082af425d6d5a78f", - "sha256:ab235d9fe64833f12d1334d29b558aacedfbca2356dfb9691f2d0d38a8a7bfb4", - "sha256:b3b0c8f660fae65eac74fbf003f3103769b90012ae7a460863010539bb7a80da", - "sha256:bab8e6d510d2ea0f1d14f12642e3f35cefa47a9b2e4c7cea1852b52bc9c49647", - "sha256:c45297bbdbc8bb79b02cf41417d63352b70bcb76f1bbb1ee7d47b3e89e42f95d", - "sha256:d19bca47c8a01b92640c614a9147b081a1974f69168ecd494687c827109e8f42", - "sha256:d64b4340a0c488a9e79b66ec9f9d77d02b99b772c8b8afd46c1294c1d39ca478", - "sha256:da969da069a82bbb5300b59161d8d7c8d423bc4ccd3b410a9b4d8932aeefc14b", - "sha256:ed02c7539705696ecb7dc9d476d861f3904a8d2b7e894bd418994920935d36bb", - "sha256:ee5b8abc35b549012e03a7b1e86c09491457dba6c94112a2482b18589cc2bdb9" - ], - "version": "==4.5.2" - }, - "idna": { - "hashes": [ - "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", - "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c" - ], - "version": "==2.8" - }, - "isort": { - "hashes": [ - "sha256:1153601da39a25b14ddc54955dbbacbb6b2d19135386699e2ad58517953b34af", - "sha256:b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8", - "sha256:ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497" - ], - "version": "==4.3.4" - }, - "lazy-object-proxy": { - "hashes": [ - "sha256:0ce34342b419bd8f018e6666bfef729aec3edf62345a53b537a4dcc115746a33", - "sha256:1b668120716eb7ee21d8a38815e5eb3bb8211117d9a90b0f8e21722c0758cc39", - "sha256:209615b0fe4624d79e50220ce3310ca1a9445fd8e6d3572a896e7f9146bbf019", - "sha256:27bf62cb2b1a2068d443ff7097ee33393f8483b570b475db8ebf7e1cba64f088", - "sha256:27ea6fd1c02dcc78172a82fc37fcc0992a94e4cecf53cb6d73f11749825bd98b", - "sha256:2c1b21b44ac9beb0fc848d3993924147ba45c4ebc24be19825e57aabbe74a99e", - "sha256:2df72ab12046a3496a92476020a1a0abf78b2a7db9ff4dc2036b8dd980203ae6", - "sha256:320ffd3de9699d3892048baee45ebfbbf9388a7d65d832d7e580243ade426d2b", - "sha256:50e3b9a464d5d08cc5227413db0d1c4707b6172e4d4d915c1c70e4de0bbff1f5", - "sha256:5276db7ff62bb7b52f77f1f51ed58850e315154249aceb42e7f4c611f0f847ff", - "sha256:61a6cf00dcb1a7f0c773ed4acc509cb636af2d6337a08f362413c76b2b47a8dd", - "sha256:6ae6c4cb59f199d8827c5a07546b2ab7e85d262acaccaacd49b62f53f7c456f7", - "sha256:7661d401d60d8bf15bb5da39e4dd72f5d764c5aff5a86ef52a042506e3e970ff", - "sha256:7bd527f36a605c914efca5d3d014170b2cb184723e423d26b1fb2fd9108e264d", - "sha256:7cb54db3535c8686ea12e9535eb087d32421184eacc6939ef15ef50f83a5e7e2", - "sha256:7f3a2d740291f7f2c111d86a1c4851b70fb000a6c8883a59660d95ad57b9df35", - "sha256:81304b7d8e9c824d058087dcb89144842c8e0dea6d281c031f59f0acf66963d4", - "sha256:933947e8b4fbe617a51528b09851685138b49d511af0b6c0da2539115d6d4514", - "sha256:94223d7f060301b3a8c09c9b3bc3294b56b2188e7d8179c762a1cda72c979252", - "sha256:ab3ca49afcb47058393b0122428358d2fbe0408cf99f1b58b295cfeb4ed39109", - "sha256:bd6292f565ca46dee4e737ebcc20742e3b5be2b01556dafe169f6c65d088875f", - "sha256:cb924aa3e4a3fb644d0c463cad5bc2572649a6a3f68a7f8e4fbe44aaa6d77e4c", - "sha256:d0fc7a286feac9077ec52a927fc9fe8fe2fabab95426722be4c953c9a8bede92", - "sha256:ddc34786490a6e4ec0a855d401034cbd1242ef186c20d79d2166d6a4bd449577", - "sha256:e34b155e36fa9da7e1b7c738ed7767fc9491a62ec6af70fe9da4a057759edc2d", - "sha256:e5b9e8f6bda48460b7b143c3821b21b452cb3a835e6bbd5dd33aa0c8d3f5137d", - "sha256:e81ebf6c5ee9684be8f2c87563880f93eedd56dd2b6146d8a725b50b7e5adb0f", - "sha256:eb91be369f945f10d3a49f5f9be8b3d0b93a4c2be8f8a5b83b0571b8123e0a7a", - "sha256:f460d1ceb0e4a5dcb2a652db0904224f367c9b3c1470d5a7683c0480e582468b" - ], - "version": "==1.3.1" - }, - "mccabe": { - "hashes": [ - "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", - "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" - ], - "version": "==0.6.1" - }, - "more-itertools": { - "hashes": [ - "sha256:38a936c0a6d98a38bcc2d03fdaaedaba9f412879461dd2ceff8d37564d6522e4", - "sha256:c0a5785b1109a6bd7fac76d6837fd1feca158e54e521ccd2ae8bfe393cc9d4fc", - "sha256:fe7a7cae1ccb57d33952113ff4fa1bc5f879963600ed74918f1236e212ee50b9" - ], - "version": "==5.0.0" - }, - "pluggy": { - "hashes": [ - "sha256:8ddc32f03971bfdf900a81961a48ccf2fb677cf7715108f85295c67405798616", - "sha256:980710797ff6a041e9a73a5787804f848996ecaa6f8a1b1e08224a5894f2074a" - ], - "version": "==0.8.1" - }, - "py": { - "hashes": [ - "sha256:bf92637198836372b520efcba9e020c330123be8ce527e535d185ed4b6f45694", - "sha256:e76826342cefe3c3d5f7e8ee4316b80d1dd8a300781612ddbc765c17ba25a6c6" - ], - "version": "==1.7.0" - }, - "pylint": { - "hashes": [ - "sha256:689de29ae747642ab230c6d37be2b969bf75663176658851f456619aacf27492", - "sha256:771467c434d0d9f081741fec1d64dfb011ed26e65e12a28fe06ca2f61c4d556c" - ], - "index": "pypi", - "version": "==2.2.2" - }, - "pytest": { - "hashes": [ - "sha256:65aeaa77ae87c7fc95de56285282546cfa9c886dc8e5dc78313db1c25e21bc07", - "sha256:6ac6d467d9f053e95aaacd79f831dbecfe730f419c6c7022cb316b365cd9199d" - ], - "index": "pypi", - "version": "==4.2.0" - }, - "pytest-cov": { - "hashes": [ - "sha256:0ab664b25c6aa9716cbf203b17ddb301932383046082c081b9848a0edf5add33", - "sha256:230ef817450ab0699c6cc3c9c8f7a829c34674456f2ed8df1fe1d39780f7c87f" - ], - "index": "pypi", - "version": "==2.6.1" - }, - "requests": { - "hashes": [ - "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e", - "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b" - ], - "version": "==2.21.0" - }, - "six": { - "hashes": [ - "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", - "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" - ], - "version": "==1.12.0" - }, - "urllib3": { - "hashes": [ - "sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39", - "sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22" - ], - "version": "==1.24.1" - }, - "wrapt": { - "hashes": [ - "sha256:4aea003270831cceb8a90ff27c4031da6ead7ec1886023b80ce0dfe0adf61533" - ], - "version": "==1.11.1" - }, - "xvfbwrapper": { - "hashes": [ - "sha256:bcf4ae571941b40254faf7a73432dfc119ad21ce688f1fdec533067037ecfc24" - ], - "index": "pypi", - "version": "==0.2.9" - } - } -} diff --git a/lib/qtile b/lib/qtile index ca27e5f..0d68191 160000 --- a/lib/qtile +++ b/lib/qtile @@ -1 +1 @@ -Subproject commit ca27e5fa2fb8a199097777e21b2d349f89bfc03e +Subproject commit 0d6819181632df8ba13d8468530ad9c628142dcc diff --git a/plasma/layout.py b/plasma/layout.py index ec25d3c..842920a 100644 --- a/plasma/layout.py +++ b/plasma/layout.py @@ -90,7 +90,7 @@ def configure(self, client, screen): width-2*border_width, height-2*border_width, border_width, - self.group.qtile.colorPixel(border_color), + self.group.qtile.color_pixel(border_color), margin=self.margin, ) # Always keep tiles below floating windows diff --git a/setup.py b/setup.py index 7bc0d1c..412e8d1 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ url='https://github.com/numirias/qtile-plasma', license='MIT', python_requires='>=3', - install_requires=['xcffib', 'qtile'], + install_requires=['xcffib>=0.5.0', 'qtile>=0.14.2'], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT License', diff --git a/tests/conftest.py b/tests/conftest.py index 4885f99..4975daa 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,15 @@ +from pathlib import Path +import sys + from pytest import fixture from plasma.node import Node +# We borrow Qtile's testing framework. That's not elegant but the best option. +sys.path.insert(0, str(Path(__file__).parents[1] / 'lib')) # noqa: E402 +from qtile.test.conftest import pytest_addoption + + Node.min_size_default = 10 diff --git a/tests/test_layout.py b/tests/test_layout.py index f1975f8..2a068da 100644 --- a/tests/test_layout.py +++ b/tests/test_layout.py @@ -11,19 +11,19 @@ from qtile.libqtile import config from qtile.libqtile.layout import Floating from qtile.test.conftest import no_xinerama, qtile, xephyr, xvfb # noqa: F401 -from qtile.test.layouts.layout_utils import assertFocused +from qtile.test.layouts.layout_utils import assert_focused @fixture def grid(qtile): - qtile.testWindow('a') - qtile.testWindow('b') + qtile.test_window('a') + qtile.test_window('b') qtile.c.layout.previous() qtile.c.layout.mode_vertical() - qtile.testWindow('c') + qtile.test_window('c') qtile.c.layout.right() qtile.c.layout.mode_vertical() - qtile.testWindow('d') + qtile.test_window('d') class Config: @@ -81,44 +81,44 @@ def test_access(self, root): @plasma_config def test_info(self, qtile): - qtile.testWindow('a') - qtile.testWindow('b') + qtile.test_window('a') + qtile.test_window('b') assert qtile.c.layout.info()['tree'] == ['a', 'b'] @plasma_config def test_windows(self, qtile): - qtile.testWindow('a') - qtile.testWindow('b') - qtile.testWindow('c') - assertFocused(qtile, 'c') + qtile.test_window('a') + qtile.test_window('b') + qtile.test_window('c') + assert_focused(qtile, 'c') assert tree(qtile) == ['a', 'b', 'c'] @plasma_config def test_split_directions(self, qtile): - qtile.testWindow('a') + qtile.test_window('a') qtile.c.layout.mode_horizontal() - qtile.testWindow('b') + qtile.test_window('b') qtile.c.layout.mode_vertical() - qtile.testWindow('c') + qtile.test_window('c') assert tree(qtile) == ['a', ['b', 'c']] @plasma_config def test_directions(self, qtile, grid): - assertFocused(qtile, 'd') + assert_focused(qtile, 'd') qtile.c.layout.left() - assertFocused(qtile, 'c') + assert_focused(qtile, 'c') qtile.c.layout.up() - assertFocused(qtile, 'a') + assert_focused(qtile, 'a') qtile.c.layout.right() - assertFocused(qtile, 'b') + assert_focused(qtile, 'b') qtile.c.layout.down() - assertFocused(qtile, 'd') + assert_focused(qtile, 'd') qtile.c.layout.down() - assertFocused(qtile, 'd') + assert_focused(qtile, 'd') qtile.c.layout.previous() - assertFocused(qtile, 'b') + assert_focused(qtile, 'b') qtile.c.layout.next() - assertFocused(qtile, 'd') + assert_focused(qtile, 'd') @plasma_config def test_move(self, qtile, grid): @@ -146,10 +146,10 @@ def test_integrate(self, qtile, grid): @plasma_config def test_sizes(self, qtile): - qtile.testWindow('a') - qtile.testWindow('b') + qtile.test_window('a') + qtile.test_window('b') qtile.c.layout.mode_vertical() - qtile.testWindow('c') + qtile.test_window('c') info = qtile.c.window.info() assert info['x'] == 400 assert info['y'] == 300 @@ -179,8 +179,8 @@ def test_sizes(self, qtile): @plasma_config def test_remove(self, qtile): - a = qtile.testWindow('a') - b = qtile.testWindow('b') + a = qtile.test_window('a') + b = qtile.test_window('b') assert tree(qtile) == ['a', 'b'] qtile.kill_window(a) assert tree(qtile) == ['b'] @@ -189,34 +189,34 @@ def test_remove(self, qtile): @plasma_config def test_split_mode(self, qtile): - qtile.testWindow('a') - qtile.testWindow('b') + qtile.test_window('a') + qtile.test_window('b') qtile.c.layout.mode_horizontal_split() - qtile.testWindow('c') + qtile.test_window('c') assert qtile.c.window.info()['width'] == 200 - 2 qtile.c.layout.mode_vertical() - qtile.testWindow('d') + qtile.test_window('d') assert qtile.c.window.info()['height'] == 300 - 2 - qtile.testWindow('e') + qtile.test_window('e') assert qtile.c.window.info()['height'] == 200 - 2 qtile.c.layout.mode_vertical_split() - qtile.testWindow('f') + qtile.test_window('f') assert qtile.c.window.info()['height'] == 100 - 2 @plasma_config def test_recent(self, qtile): - qtile.testWindow('a') - qtile.testWindow('b') - qtile.testWindow('c') - assertFocused(qtile, 'c') + qtile.test_window('a') + qtile.test_window('b') + qtile.test_window('c') + assert_focused(qtile, 'c') qtile.c.layout.recent() - assertFocused(qtile, 'b') + assert_focused(qtile, 'b') qtile.c.layout.recent() - assertFocused(qtile, 'c') + assert_focused(qtile, 'c') qtile.c.layout.next() - assertFocused(qtile, 'a') + assert_focused(qtile, 'a') qtile.c.layout.recent() - assertFocused(qtile, 'c') + assert_focused(qtile, 'c') def test_bug_10(self): """Adding nodes when the correct root dimensions are still unknown diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..3ca7173 --- /dev/null +++ b/tox.ini @@ -0,0 +1,51 @@ +[tox] +envlist = py35,py36,py37,lint,coverage-report + +[testenv] +deps = + setuptools>=41 + xcffib + coverage + pytest<5.0.0 + pytest-xdist +commands = + coverage run --parallel -m pytest -v {posargs} tests/ + +[testenv:coverage-report] +basepython = python3.7 +skip_install = true +deps = coverage +commands = + coverage combine + coverage report + +[testenv:lint] +deps = + xcffib + flake8 + pylint +commands = + flake8 plasma/ + pylint --rcfile setup.cfg plasma/ + +[testenv:release] +deps = + wheel + twine +commands = + rm -rf *.egg-info build/ dist/ + python setup.py bdist_wheel sdist + twine upload -r pypi dist/* + rm -rf *.egg-info build/ dist/ + +[pylint] +disable = + missing-docstring, + invalid-name, + unused-argument, + too-few-public-methods, + too-many-public-methods, + protected-access, + no-self-use, + too-many-instance-attributes, + fixme,