# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['wutch', 'wutch.js']

package_data = \
{'': ['*']}

install_requires = \
['aiofiles>=0.6.0,<0.7.0',
 'aiohttp>=3.7.3,<4.0.0',
 'beautifulsoup4>=4.9.3,<5.0.0',
 'ilexconf>=0.9.5,<0.10.0',
 'loguru>=0.5.3,<0.6.0',
 'watchdog>=1.0.2,<2.0.0']

entry_points = \
{'console_scripts': ['wutch = wutch:cli']}

setup_kwargs = {
    'name': 'wutch',
    'version': '1.0.11',
    'description': 'Watch and rebuild your files like LiveServer',
    'long_description': '# Wutch\n\n`wutch` watches for changes in the directories and runs a shell command for\nevery change. It can also open a browser a display whatever is in the build\ndirectory, just like Live Server.\n\nCommon use case for Wutch involves writing docs with [Sphinx][sphinx]. Wutch will\nwatch for the changes in all `*.rst` files and automatically rebuild documentation.\nIt will also open a browser window pointing to the build directory and inject\nevery built webpage with a code that will auto-refresh that page after each\nrebuild.\n\n<p>\n    <a href="https://pypi.org/project/wutch/"><img alt="PyPI" src="https://img.shields.io/pypi/v/wutch?color=blue&logo=pypi"></a>\n    <a href=\'https://wutch.readthedocs.io/en/latest/?badge=latest\'><img src=\'https://readthedocs.org/projects/wutch/badge/?version=latest\' alt=\'Documentation Status\' /></a>\n</p>\n\n![Wutch Demo](https://github.com/vduseev/wutch/raw/master/docs/_static/wutch-demo.gif)\n\n* [Documentation](https://wutch.readthedocs.io/en/latest/)\n* [Getting Started (Blog post)](https://duseev.com/articles/introducing-wutch/)\n\n## Installation\n\n```shell\npip install wutch\n```\n\n## Usage\n\nJust run wutch in the directory where you want to watch for the changes.\nBy default, `wutch` will:\n\n* Watch for every change in the current directory.\n* Ignore changes in the `_build/` and `build` directories.\n* Run `sphinx-build` shell command for every change in the files.\n* Open a browser pointing to `index.html` in the `_build` directory.\n* Automatically refresh that page every time you change the files\n  and shell command runs.\n\n```shell\n$ wutch -vvv\n\n2021-04-10 12:33:16.367 | DEBUG    | wutch.watcher:start:25 - Starting observer thread\n2021-04-10 12:33:16.368 | DEBUG    | wutch.watcher:on_any_event:58 - Processing event <FileModifiedEvent: event_type=modified, src_path=\'docs\', is_directory=False>.\nrm -rf "_build"\n#@poetry run sphinx-build -M build "." "_build"\nRunning Sphinx v3.5.3\nloading translations [en]... done\nmaking output directory... done\nbuilding [mo]: targets for 0 po files that are out of date\nbuilding [html]: targets for 1 source files that are out of date\nupdating environment: [new config] 1 added, 0 changed, 0 removed\nreading sources... [100%] index\nlooking for now-outdated files... none found\npickling environment... done\nchecking consistency... done\npreparing documents... done\nwriting output... [100%] index\ngenerating indices... genindex done\nwriting additional pages... search done\ncopying static files... done\ncopying extra files... done\ndumping search index in English (code: en)... done\ndumping object inventory... done\nbuild succeeded.\n\nThe HTML pages are in _build/html.\n2021-04-10 12:33:17.627 | DEBUG    | wutch.watcher:on_any_event:71 - Shell command executed with result: None.\n2021-04-10 12:33:17.627 | DEBUG    | wutch.events:report:15 - New Event.ShellCommandFinished event has been reported.\n2021-04-10 12:33:17.627 | DEBUG    | wutch.watcher:start:28 - Observer thred started\n2021-04-10 12:33:17.628 | DEBUG    | wutch.server:start:44 - Server thread started\n2021-04-10 12:33:17.628 | DEBUG    | wutch.server:open_browser:137 - Opening browser at: http://localhost:5010/index.html\n```\n\nStop wutch by issuing a <kbd>Ctrl+C</kbd> key sequence.\n\n```shell\n^C2021-04-10 12:33:28.396 | DEBUG    | wutch.threaded:run:28 - Stopping all threads on KeyboardInterrupt\n2021-04-10 12:33:28.397 | DEBUG    | wutch.watcher:stop:32 - Stopping observer thread\n2021-04-10 12:33:28.560 | DEBUG    | wutch.watcher:stop:35 - Observer thread stopped\n2021-04-10 12:33:28.560 | DEBUG    | wutch.server:stop:58 - Server thread stopped\n```\n\n## Configuration\n\n### Parameters\n\n```shell\n-h, --help            show this help message and exit\n-c COMMAND, --command COMMAND\n                    Shell command executed in response to file changes. Defaults to: sphinx-build.\n-C CONFIG, --config CONFIG\n                    Path to the wutch config file. Defaults to: wutch.cfg.\n-d [DIRS ...], --dirs [DIRS ...]\n                    Directories to watch (separated by \' \'). Defaults to: [\'.\'].\n-p [PATTERNS ...], --patterns [PATTERNS ...]\n                    Matches paths with these patterns (separated by \' \'). Defaults to: [\'*\'].\n-P [IGNORE_PATTERNS ...], --ignore-patterns [IGNORE_PATTERNS ...]\n                    Ignores changes in files that match these patterns (separated by \' \'). Defaults to: [\'_build/\', \'build/\'].\n-w WAIT, --wait WAIT  Wait N seconds after the command is finished before refreshing the web page. Defaults to: 1.\n-b BUILD, --build BUILD\n                    Build directory containing files to render in the browser. Defaults to: _build/html.\n-I [INJECT_PATTERNS ...], --inject-patterns [INJECT_PATTERNS ...]\n                    Patterns of files to inject with JS code that refreshes them on rebuild (separated by \' \'). Defaults to: [\'*.htm*\'].\n-i INDEX, --index INDEX\n                    File that will be opened in the browser with the start of the watcher. Defaults to: index.html.\n--host HOST           Host to bind internal HTTP server to. Defaults to: localhost.\n--port PORT           TCP port to bind internal HTTP server to. Defaults to: 5010.\n-B, --no-browser      Do not open browser at wutch launch. Defaults to: False.\n-S, --no-server       Do not start the webserver, just launch the shell command. Defaults to: False.\n-v, --verbose         Log verbosity. Has four levels: error, wargning, info, and debug. Can be stacked: -v (for warning) or -vvv (for debug).\n-V, --version         Display version of the wutch.\n```\n\n### Loading order\n\nWutch loads configuration settings in the following priority:\n\n1. Command line arguments\n2. Environment variables starting with `WUTCH_`\n3. Configuration file `wutch.cfg`\n4. Default variables\n\nEvery variable can be specified in any of the sources above, thanks to\n[`ilexconf`][ilexconf] configuration management library.\n\nFor example, `dirs` variable that lists directories to watch can be\nspecified in several ways:\n\n**Command line:**\n\n```shell\nwutch --dirs . ../other_dir\n```\n\n**Environment variables starting with `WUTCH_`:**\n\n```shell\nexport WUTCH_DIRS=". ../other_dir"\n```\n\n**Configuration file `wutch.cfg`:**\n\n```json\n{\n    "dirs": [".", "../other_dir"]\n}\n```\n\n## Wutch\'s documentation is built using `wutch`\n\nTake a look at the `wutch.cfg` file at the root of the repository. This\nserves as a somewhat common configuration for Sphinx dependent documentation.\n\nWutch documentation is developed using `wutch` and this config below.\n\n```json\n{\n    "dirs": ["docs"],\n    "patterns": ["*.rst", "*.py"],\n    "ignore_patterns": ["docs/_build/"],\n    "command": "make -C docs rebuild",\n    "build": "docs/_build/html",\n    "inject_patterns": ["*.html"],\n    "index": "index.html",\n    "host": "localhost",\n    "port": 5010\n}\n```\n\n[sphinx]: https://www.sphinx-doc.org/ "Sphinx"\n[ilexconf]: https://github.com/ilexconf/ilexconf "Ilexconf"',
    'author': 'vduseev',
    'author_email': 'vagiz@duseev.com',
    'maintainer': 'vduseev',
    'maintainer_email': 'vagiz@duseev.com',
    'url': 'https://github.com/vduseev/wutch',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.8,<4.0',
}


setup(**setup_kwargs)
