Package: dose
Language: HaskellTesting with HspecArch LinuxDose running on Python 2.7.12wxPython Phoenix 3.0.3.dev2472+78ae39a (gtk2)Language: Shell scriptTesting with roundupMac OS X 10.11.6 (El Capitan)Dose running on Python 3.5.2wxPython Phoenix 3.0.3.dev2487+3b85464 (osx-cocoa)Language: PythonTesting with py.testWindows 7 Home Premium SP1Dose running on Python 2.7.12wxPython Classic 2.8.12.1 (msw-unicode)Language: CTesting with a custom testerCygwin 2.876 (Windows)Dose running on Python 2.7.10wxPython Classic 3.0.2.0 (gtk2)What does it do?Runs a test command when some file is created/modified/deleted,
showing the returned value in a GUI.There are 3 states:Red: Last test job failed/errored (it didn’t return zero)Yellow: Running a test jobGreen: Last test job passed (it returned zero)The test job output is written on the standard output, so it should
appear in the console/terminal whereby Dose was called. The same
applies to the standard error, whose text should appear in red.Syntax / ExampleJust calldose TEST_COMMAND, whereTEST_COMMANDis what you
would call to run your test suite in a terminal/console/shell. Dose is
written in Python but the test command can be any shell command.Hint (color): Any ANSI escaping code from the test command (e.g.
colors) is also sent to the standard streams in the underlying
console (Linux, Mac OS X and Cygwin) or converted bycoloramato
Windows Console Handles API calls (Windows). In other words, colors
are enabled. For example, in a tox + py.test Python project whosetox.inihascommands = py.test {posargs}, you can force the
py.test coloring withdose tox----color=yes.Hint (shell): You can use shell pipes in your test command by
quoting the whole command, e.g.dose "cat tests.txt | verify.sh".What does it watch?Using thewatchdogpackage, Dose recursively watches a working
directory for file creation/modification/deletion events.The watched directory is the current working directory whence
Dose was called. You can change it from the GUI. The test
command is called in the same directory.There’s a customizable ignore pattern to avoid undesired detections on
temporary/compiled files.Valid events during a test would kill (SIGTERM) a test job to restart
it. There’s a 10ms delay before starting/spawning a test job
subprocess, which is kept alive for at least 50ms before being able to
be killed. Multiple events are handled as a single event to avoid
spawning/killing more than required.There’s a cycle/repeat detection in the watcher: repeating an event
won’t kill the test job. Modifying the same file twice will have the
second modification ignored, unless it happens after finishing a test
job.Hint (change directory): You can watch a directory and call a
command in another directory by usingcd PATH && TEST_COMMANDas
your test command, e.g.dose "cd toxinidir && tox".GUI ControlsOn Linux / WindowsDragging: MoveDragging holding Ctrl: ResizeDragging holding Shift: Controls the transparencyDouble click: start or stop the watcher (can kill the test job)A right click shows more options.On Mac OS XDragging: MoveDragging holding ⌘: ResizeDragging holding ⇧: Controls the transparencyDouble click: start or stop the watcher (can kill the test job)A right click (or Ctrl + mouse click) shows more options.InstallationDose has few requirements:Linux, OS X, Windows or Cygwin (Windows)Python (2 or 3) with pip/wheel/setuptoolsPyPI packages (auto-installed):watchdogdocutilscoloramawxPython 2.8, 3.0 (either Classic or Phoenix) or 4+ (Phoenix)All the packages are installed withpip, including wxPython,
but this last one you might need/want to install by using a build
packaged in your operating system repository, so the following
documentation, once created for older versions of wxPython (before its
4.0 release), was kept here as part of the documentation.On Python 3, wxPython Phoenix is required (since wxPython Classic
requires Python 2, modus tollens). Even on Python 2, Phoenix is
usually easier to install, as it can be installed directly via pip
no matter the platform or Python version:pip install wxPythonThe wxPyWiki have a detailed page onhow to install wxPython,
whence that Phoenix install command came. The link includes some
detailed information on how to install wxPython Classic.If that’s not enough, below are some detailed information on how to
install Dose and its requirements on each platform/environment/system
it supports.Installing Dose with pip/wheel/setuptoolsYou should install with pip, which gets the Dose wheel fromPyPI(recommended):pip install doseTo install from the source distribution (e.g. after cloning this
repository), you can either use pip (recommended):pip install .Wheel:python setup.py bdist_wheel
wheel install dist/*.whlOr setuptools directly (not recommended):python setup.py installTo uninstall Dose with pip while keeping its requirements installed:pip uninstall doseOther useful and self-explanatory commands are:pip install --upgrade dose
pip install --force-reinstall doseDose should be kept upgraded. To check which Dose version is
installed, you can usepip listorpip freeze. Without pip,
you can check the version from thedose.__version__variable:python -c "import dose ; print(dose.__version__)"Python virtualenvIf you wish to install Dose in a Python virtualenv instead of a system
installation, you should either:Install wxPython Phoenix via pip (recommended);Create a virtualenv with the--system-site-packagesoption in a system that already has some wxPython version
installed.On Linux / Mac OS X / Cygwin, this creates avenv27directory with
a new virtualenv that can access the systemsite-packageslibrary
directory, i.e., the installed packages:virtualenv --system-site-packages -p python2.7 venv27On Windows, you should just replacepython2.7by yourpython.exefile. You should remove the--system-site-packagesfor a virtualenv with independent libraries.To activate it (Linux / Mac OS X / Cygwin):source venv27/bin/activateTo activate it (Windows):venv27/Scripts/activate.batAfterwards, you should install Dose with pip/wheel/setuptools in the
activated virtual environment.If virtualenv isn’t available in your Python distribution, it can be
installed with:pip install virtualenvRequirements on Arch LinuxFor a simple installation, it’s available inAUR.This distro doesn’t include a/usr/bin/pipscript, so you should
usepython2-mpip(Python 2) orpython-mpip(Python 3)
instead of justpip. By the way, in this Linux distributionpythonmeans Python 3, onlypython2means Python 2, unless
you’re in a virtualenv. The commands below should be called withsudo.When installing pip, you don’t need to worry if the Python interpreter
itself is installed in your system, as the package manager would
install python for you as a dependency if it’s not installed. To
install pip and wxPython Phoenix 4 on Python 3:pacman -Sy python-pip python-wxpythonThe wxPython Phoenix snapshot can be installed via pip. On the other
hand, to install pip and wxPython Classic 3.0 on Python 2:pacman -Sy python2-pip python2-wxpython3If you wish to install Dose in a virtualenv, you should install thepython-virtualenv(Python 3) or thepython2-virtualenv(Python 2) package with pacman, following the virtualenv instructions
afterwards.Requirements on Ubuntu/Debian/MINT LinuxYou should usepip3instead ofpipon Python 3, unless you’re
in a virtualenv. The commands below should be called withsudo.
You can also install the described packages (names after
“install“) with an APT GUI likesynaptic. These
distros usually come with Python, nevertheless Python itself is
installed as a dependency when installing pip. Before calling the
install commands, remember to:apt-get updateInstalling pip on Python 3:apt-get install python3-pipThe wxPython Phoenix snapshot can be installed via pip. To install pip
and wxPython Classic 2.8 on Python 2:apt-get install python-pip python-wxgtk2.8If you wish to install Dose in a virtualenv, you should install thepython-virtualenv(Python 2) or thepython3-virtualenv(Python 3) package from APT, following the virtualenv instructions
afterwards. If these aren’t available, you should install the
virtualenv package from PyPI with pip.Requirements on Mac OS XEverything discussed here happens in a console, you can open one with
Spotlight by pressing Command (⌘) + Space and typingTerminal.
The recommended (and easier) way to install the requirements is viaHomebrew, even in Mac OS X 10.11 (El Capitan). Another option
would be installing Python directly from thePython official sitepackages, but that installation procedure isn’t described here.Python from Mac OS X 10.11 (El Capitan)This is an installation procedure withoutHomebrew, using the
Python interpreter that comes with Mac OS X 10.11 (El Capitan).
It comes with Python 2.7, but not with pip. You can install pip
using the command:curl https://bootstrap.pypa.io/get-pip.py | sudo pythonIf you wish to install wxPython Phoenix via pip without receiving anOSError: [Errno 1] Operation not permitted: ..., you have to
temporarily disable theSystem Integrity Protection, but that’s
something you probably don’t want to do. The same happens with Dose,
but to avoid that issue you can install Dose directly from itssetup.pyinstead of using pip/wheel.On the other hand, if you wish to install wxPython Classic 3.0,
you should get the “Cocoa” Mac OS X binary packages directly from thewxPython official site. But that’s not enough, as the package
structure isn’t supported by this OS X version. Following the
instructions fromthe DaviXX’ Blog post about wxPython on OS X,
you should:In Finder, open (double click) the downloaded dmg file;Click with the right mouse button (or Ctrl + click) on thewxPython3.0-osx-cocoa-py2.7.pkgfile, and click onShow Package Contents;Drag theContentsdirectory to your Desktop and, on the same
Finder window, eject the “wxPython”-prefixed device;OpenContents, then openResources, there you should
rename:preflighttopreinstallpostflighttopostinstallOpen (double click)wxPython3.0-osx-cocoa-py2.7.pax.gz, there
should appear anusrdirectory;Create two directories in that very sameResourcesdirectory,
with the names:pkg_rootscriptsMove (drag):usrtopkg_rootpreinstalltoscriptspostinstalltoscriptsIn a Terminal, type these 2 commands (be careful, you should use the~symbol, not the˜symbol):cd ~/Desktop/Contents/Resources
pkgbuild --root ./pkg_root --scripts ./scripts \
         --identifier com.wxwidgets.wxpython \
         ~/Desktop/wxPython3.0-osx-cocoa-py2.7-repackaged.pkgWait until the Terminal gives you theWrote packagemessage. You can
now delete the Contents directory and the downloaded dmg, just open
(double click) thewxPython3.0-osx-cocoa-py2.7-repackaged.pkgfile
in your desktop and wxPython Classic 3.0 is installed. The
aforementioned blog post does the same procedure, but in a command
line approach.HomebrewA single command in a Terminal is enough to installHomebrew/usr/bin/ruby -e "$(curl -fsSL \
  https://raw.githubusercontent.com/Homebrew/install/master/install)"In a terminal, before calling the install commands, remember to:brew updateTo install Python 3 (already comes with pip, henceforth calledpip3for this Python version):brew install python3There you can install wxPython Phoenix via pip (replacingpipbypip3in the install command).To install Python 2 (already comes with pip) and wxPython Classic 3.0:brew install python wxpythonRequirements on WindowsOn Windows, you can install Python from some distribution or directly
from thePython official sitebinary packages, the procedure
described here uses the latter approach.The installation asks for adding Python to the path, you should add it
to usepython,pip(anddoseafterwards) on any path.
It’s recommended that you keep the installation directory simple (e.g.
the paths wheretoxlooks for Python interpreters:C:\Python27for Python 2.7 andC:\Python35for Python 3.5), as thepython.exeisn’t renamed nor copied to version-specific filenames
and that becomes an issue if you wish to keep more than one Python
version installed. The suggested path is the default for Python 2.7,
but for Python 3.5 you have to chooseCustomize installationto
change the path.The Python binary packages for Windows already comes with pip as 3
executable files in theScriptssubdirectory on the path where
Python was installed:pip.exe,pipA.exeandpipA.B.exe, whereA.Bis the Python version (e.g.2.7or3.5).A terminal is required for installing Dose and its requirements, as
well as for using Dose afterwards. You can use either theWindows PowerShell(powershell.exe) or theCommand Prompt(cmd.exe), they can be called by pressingWindows + Rand
typing the executable filename (without the.exesuffix/extension).If you wish to install wxPython Phoenix, it can be easily installed
via pip using the formerly described command, you just have to care
about the path: you can see if pip is in the path by trying to call
it or by seeing in the PowerShell if$env:pathincludes the
Python scripts directory (e.g.C:\Python27\Scripts). If not,
you should go to that directory before calling pip, e.g.:cd \Python27\Scripts
pip install doseOn Python 2.7, you can install wxPython Classic from the package in
thewxPython official site. If you’ve installed Python in the
recommended path, the installer should detect the installation path.
If you installed Python onC:\Python27(the Python installation
path and also the directory where thepython.exelies), then
you should install wxPython onC:\Python27\Lib\site-packages.
If Python was installed otherwhere, the\Lib\site-packagessuffix should be added accordingly. When asked, use the full
installation (i.e., everything checked).Requirements on Cygwin (Windows)If you just wish to run Dose on Windows, you should read the previous
section instead.Cygwinis another platform, one that runs on Windows
and has many resources from Linux. On Cygwin, even the Python
resources are the ones documented as available in POSIX systems.To install Python 2 and wxPython Classic 3.0 on Cygwin, you
have to install these packages from the Cygwin installer (as well
as their dependencies detected by the installer):Net/curlPython/pythonLibs/python-wx3.0X11/xinitX11/xorg-serverOpen theStart Menu -> Cygwin-X -> XWin Server, it will just flash
and disappear, but its X and C icons should appear in the taskbar.
Click on theC icon -> System -> Cygwin Terminalto open a terminal
that can display a X GUI in Windows.To install pip, you should use this command in the Cygwin Terminal:curl https://bootstrap.pypa.io/get-pip.py | pythonTo activate wxPython Classic 3.0 (i.e., to make it the default
wxPython installation):cd /lib/python2.7/site-packages
echo wx-3.0* > wx.pthPlease see theCHANGES.rstfile for more information.Copyright (C) 2012-2022 Danilo de Jesus da Silva Bellini