[Pkg-bitcoin-commits] [python-quamash] 185/269: Updated README, setup.py & Testing Configuration

Jonas Smedegaard dr at jones.dk
Fri Nov 24 11:26:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository python-quamash.

commit c9b5e6ef13a823c43733c5662054d3a7dbaa1ff6
Author: Mark Harviston <mark.harviston at gmail.com>
Date:   Fri Jan 9 14:02:42 2015 -0800

    Updated README, setup.py & Testing Configuration
    
    setup.py now more closely resembles PyPA sample setup.py
    README is better, tox configuration is better.
---
 README              | 76 ------------------------------------------
 README.rst          | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 coveragerc          |  2 +-
 quamash/__init__.py |  1 +
 setup.py            | 17 ++++++++--
 tox.ini             | 49 ++++++++++++++++-----------
 6 files changed, 141 insertions(+), 99 deletions(-)

diff --git a/README b/README
deleted file mode 100644
index 1fdca06..0000000
--- a/README
+++ /dev/null
@@ -1,76 +0,0 @@
-=======
-Quamash
-=======
-Implementation of the `PEP 3156`_ Event-Loop with Qt
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-:author: Mark Harviston <mark.harviston at gmail.com>, Arve Knudsen <arve.knudsen at gmail.com>
-
-.. image:: https://travis-ci.org/harvimt/quamash.png?branch=master
-    :target: https://travis-ci.org/harvimt/quamash
-
-Requirements
-============
-Quamash requires Python 3.4 and either PyQt 5 or PySide.
-
-Installation
-============
-pip install quamash
-
-Usage
-=====
-
-.. code:: python
-
-    import sys
-    import asyncio
-    import time
-
-    from PyQt5.QtWidgets import QApplication, QProgressBar
-    from quamash import QEventLoop, QThreadExecutor
-
-    app = QApplication(sys.argv)
-    progress = QProgressBar()
-    loop = QEventLoop(app)
-
-    progress.setRange(0, 99)
-    progress.show()
-
-    @asyncio.coroutine
-    def master():
-        yield from first_50()
-        with QThreadExecutor(1) as exec:
-            yield from loop.run_in_executor(exec, last_50)
-        # TODO announce completion?
-
-    @asyncio.coroutine
-    def first_50():
-        for i in range(50):
-            progress.setValue(i)
-            yield from asyncio.sleep(.1)
-
-    def last_50():
-        for i in range(50,100):
-            loop.call_soon_threadsafe(progress.setValue, i)
-            time.sleep(.1)
-
-    with loop:
-        loop.run_until_complete(master())
-
-Testing
-=======
-Quamash is tested with `pytest`_; in order to run the test suite, just execute py.test on the
-commandline. The tests themselves are beneath the 'tests' directory.
-
-License
-=======
-You may use, modify, and redistribute this software under the terms of the `BSD License`_.
-See LICENSE.
-
-Name
-====
-Tulip related projects are being named after other flowers, Quamash is one of the few flowers that
-starts with a "Q".
-
-.. _`PEP 3156`: http://legacy.python.org/dev/peps/pep-3156/
-.. _`pytest`: http://pytest.org
-.. _`BSD License`: http://opensource.org/licenses/BSD-2-Clause
diff --git a/README.rst b/README.rst
deleted file mode 120000
index 100b938..0000000
--- a/README.rst
+++ /dev/null
@@ -1 +0,0 @@
-README
\ No newline at end of file
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..c54cc08
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,94 @@
+=======
+Quamash
+=======
+Implementation of the `PEP 3156`_ Event-Loop with Qt
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+:author: Mark Harviston <mark.harviston at gmail.com>, Arve Knudsen <arve.knudsen at gmail.com>
+
+.. image:: https://travis-ci.org/harvimt/quamash.png?branch=master
+    :target: https://travis-ci.org/harvimt/quamash
+
+Requirements
+============
+Quamash requires Python 3.4 and either PyQt4, PyQt5 or PySide.
+
+Installation
+============
+``pip install quamash``
+
+Usage
+=====
+
+.. code:: python
+
+    import sys
+    import asyncio
+    import time
+
+    from PyQt5.QtWidgets import QApplication, QProgressBar
+    from quamash import QEventLoop, QThreadExecutor
+
+    app = QApplication(sys.argv)
+    progress = QProgressBar()
+    loop = QEventLoop(app)
+
+    progress.setRange(0, 99)
+    progress.show()
+
+    @asyncio.coroutine
+    def master():
+        yield from first_50()
+        with QThreadExecutor(1) as exec:
+            yield from loop.run_in_executor(exec, last_50)
+        # TODO announce completion?
+
+    @asyncio.coroutine
+    def first_50():
+        for i in range(50):
+            progress.setValue(i)
+            yield from asyncio.sleep(.1)
+
+    def last_50():
+        for i in range(50,100):
+            loop.call_soon_threadsafe(progress.setValue, i)
+            time.sleep(.1)
+
+    with loop:
+        loop.run_until_complete(master())
+
+Testing
+=======
+Quamash is tested with pytest_; in order to run the test suite, just install pytest
+and execute py.test on the commandline. The tests themselves are beneath the 'tests' directory.
+
+Testing can also be done with tox_. The current tox setup in tox.ini requires PyQT4/5 and PySide to
+be installed globally. (pip can't install PyQt into a virtualenv which is what tox will try to do).
+For this reason it may be good to run tox tests while specificying which environments to run. e.g.
+``tox -e py34-pyqt5`` to test python 3.4 with PyQt5. It is unlikely this tox configuration will
+work well on Windows especially since PyQt5 and PyQt4 cannot coexist in the same python installation
+on Windows. Also the PyQt4 w/ Qt5 oddity appears to be mostly a windows only thing too.
+
+Style testing is also handled by tox. Run ``tox -e flake8``. Similarly run ``tox -e coverage`` to
+generate a coverage report.
+
+Continuous Integration & Supported Platforms
+--------------------------------------------
+This project uses Travis CI to perform continuous integration. This works well, but has some limited
+scope. Travis only tests PySide on Linux so this is the best tested platform. Windows is fairly well
+tested semi-manually, but as yet no fully-automated Windows tests exist. FreeBSD, Mac OS X, and other
+\*nix platforms should work, but haven't been thorougly tested.
+
+License
+=======
+You may use, modify, and redistribute this software under the terms of the `BSD License`_.
+See LICENSE.
+
+Name
+====
+Tulip related projects are being named after other flowers, Quamash is one of the few flowers that
+starts with a "Q".
+
+.. _`PEP 3156`: http://legacy.python.org/dev/peps/pep-3156/
+.. _`pytest`: http://pytest.org
+.. _`BSD License`: http://opensource.org/licenses/BSD-2-Clause
+.. _tox: https://tox.readthedocs.org/
diff --git a/coveragerc b/coveragerc
index a24f942..767ee26 100644
--- a/coveragerc
+++ b/coveragerc
@@ -17,4 +17,4 @@ exclude_lines =
 
     # Don't complain if non-runnable code isn't run:
     if 0:
-    if __name__ == .__main__.:
\ No newline at end of file
+    if __name__ == .__main__.:
diff --git a/quamash/__init__.py b/quamash/__init__.py
index 55f389a..fc5ba91 100644
--- a/quamash/__init__.py
+++ b/quamash/__init__.py
@@ -5,6 +5,7 @@
 
 __author__ = 'Mark Harviston <mark.harviston at gmail.com>, Arve Knudsen <arve.knudsen at gmail.com>'
 __version__ = '0.3'
+__url__ = 'https://github.com/harvimt/quamash'
 __license__ = 'BSD'
 
 import sys
diff --git a/setup.py b/setup.py
index 40c1e52..b56223e 100644
--- a/setup.py
+++ b/setup.py
@@ -2,26 +2,39 @@ from setuptools import setup
 import quamash
 import re
 
+from pathlib import Path  # safe (for now) because python 3.4 is only target
+
 groups = re.findall(r'(.+?) <(.+?)>(?:,\s*)?', quamash.__author__)
 authors = [x[0].strip() for x in groups]
 emails = [x[1].strip() for x in groups]
+
+with (Path(__file__).parent / 'README.rst').open() as desc_file:
+	long_description = desc_file.read()
+
 setup(
 	name='Quamash',
 	version=quamash.__version__,
-	url='https://github.com/harvimt/quamash',
+	url=quamash.__url__,
 	author=', '.join(authors),
 	author_email=', '.join(emails),
 	packages=['quamash', ],
 	license=quamash.__license__,
 	description=quamash.__doc__,
-	long_description=open('README').read(),
+	long_description=long_description,
 	keywords=['Qt', 'asyncio'],
 	classifiers=[
+		'Development Status :: 3 - Alpha',
 		'License :: OSI Approved :: BSD License',
+		'Intended Audience :: Developers',
 		'Operating System :: Microsoft :: Windows',
 		'Operating System :: MacOS :: MacOS X',
 		'Operating System :: POSIX',
 		'Programming Language :: Python :: 3.4',
+		'Programming Language :: Python :: 3 :: Only',
 		'Environment :: X11 Applications :: Qt',
 	],
+	# FIXME depends on PyQt4, PyQt5 or PySide, but cannot put that in a setup.py
+	extras_require={
+		'test': ['pytest']
+	}
 )
diff --git a/tox.ini b/tox.ini
index 1ef1c26..456ad6c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,39 +1,50 @@
 [tox]
-envlist={py34}-{pyqt4,pyqt5,pyside,flake8}
-toxworkdir={homedir}/quamash-tox-work
+# this tox file kinda works, but it's designed for a pretty
+# specific environment
 
-[testenv:py34-pyqt4]
-sitepackages=True
-setenv=QUAMASH_QTIMPL=PyQt4
-deps=pytest
-commands=py.test
+envlist={py33,py34}-{pyqt4,pyqt5,pyside}
+# I work on an NFS drive, so switching the work dir
+# to a local drive speeds it up quite a bit
+toxworkdir={homedir}/quamash-tox-work
 
-[testenv:py34-pyqt5]
+[testenv]
 sitepackages=True
-setenv=QUAMASH_QTIMPL=PyQt5
-deps=pytest
+deps=
+	pytest
+	py33: asyncio
 commands=py.test
+setenv=
+	pyqt4: QUAMASH_QTIMPL=PyQt4
+	pyqt5: QUAMASH_QTIMPL=PyQt5
+	pyside: QUAMASH_QTIMPL=PySide
 
 [pytest]
 addopts=--doctest-modules quamash quamash tests
 
-[testenv:py34-pyside]
+[testenv:flake8]
 sitepackages=True
 setenv=QUAMASH_QTIMPL=PySide
-deps=pytest
-commands=py.test
-
-[testenv:py34-flake8]
-sitepackages=True
+basepython=python3.4
 deps=
 	flake8
 	pep8-naming
 	flake8-debugger
-# flake8-docstrings - currently behaves badly in python 3 :-(
+	flake8-docstrings
 commands=
-	flake8
+# different parameters for different parts of the project
+	flake8 --ignore=D1,W191,E501
+	flake8 --select=D1 quamash/*.py
+
+[testenv:coverage]
+sitepackages=True
+setenv=QUAMASH_QTIMPL=PySide
+basepython=python3.4
+deps=
+	pytest
+	pytest-cov
+commands=py.test --cov quamash --cov-config coveragerc
 
 [flake8]
-ignore=W191,E501
 max-complexity=15
+ignore=D1,W191,E501
 exclude=build

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/python-quamash.git



More information about the Pkg-bitcoin-commits mailing list