-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added doctest and minor improvements
- Loading branch information
Showing
7 changed files
with
291 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,56 @@ | ||
# githubissuesbot | ||
GitHub Issues Bot for MI-PYT in FIT CTU in Prague. The program has two modes: console and web app. In *console* mode it labels issues (checks new one with the specified frequency) in the given repository by the issues itself and their comments, and in *web* mode the program labels new opened issue as soon as possible (by [webhook](https://developer.github.com/webhooks/) notification and so one by one). | ||
GitHub Issues Bot for MI-PYT in FIT CTU in Prague. The program has two modes: console and web app. In *console* mode it labels [issues](https://help.github.com/articles/creating-an-issue/) (checks new one with the specified frequency) in the given repository by the issues itself and their comments, and in *web* mode the program labels new opened issue as soon as possible (by [webhook](https://developer.github.com/webhooks/) notification and so one by one). | ||
|
||
Link to [testpypi](https://testpypi.python.org/pypi/githubissuesbot). | ||
|
||
Link to [Read The Docs](https://readthedocs.org/projects/githubissuesbot/). | ||
|
||
### Requirements | ||
## Requirements | ||
* python 3.5 | ||
* libraries: [markdown](https://pypi.python.org/pypi/Markdown), [click](http://click.pocoo.org/6/), [requests](http://docs.python-requests.org/en/master/), [flask](http://flask.pocoo.org/), [appdirs](https://pypi.python.org/pypi/appdirs) | ||
|
||
### Manual | ||
Install package by typing the command: **python -m pip install --extra-index-url https://testpypi.python.org/pypi githubissuesbot** | ||
## Manual | ||
### Installation | ||
Install package by typing the command: | ||
|
||
Then you may run the app by typing **python -m githubissuesbot** or just **githubissuesbot**. Type **--help** for command line manual. | ||
`python -m pip install --extra-index-url https://testpypi.python.org/pypi githubissuesbot` | ||
|
||
Read how to generate configuration files by typing **python -m githubissuesbot genconf --help** or **githubissuesbot genconf --help**. | ||
### Running app | ||
Then you may run the app by typing | ||
|
||
The app requires the following configuration files: **auth.cfg** (with GitHub personal access token), **label.cfg** (with available labels and the appropriate rules as regular expressions), **secret.cfg** (with [webhook secret token](https://developer.github.com/webhooks/securing/)) and **web.cfg** (web app uses it for reading info about other configuration files). | ||
`python -m githubissuesbot` or just `githubissuesbot`. | ||
|
||
Type `--help` for command line manual. | ||
|
||
### Creating config files | ||
Read how to generate configuration files by typing | ||
|
||
`python -m githubissuesbot genconf --help` or | ||
|
||
`githubissuesbot genconf --help`. | ||
|
||
The app requires the following configuration files: **auth.cfg** (with [GitHub personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/)), **label.cfg** (with available labels and the appropriate rules as regular expressions), **secret.cfg** (with [webhook secret token](https://developer.github.com/webhooks/securing/)) and **web.cfg** (web app uses it for reading info about other configuration files). | ||
|
||
If you want to deploy this app on some host (tested on [pythonanywhere](https://www.pythonanywhere.com/)), don't forget to manually fix **web_config_file** value in **web_app.py** on line 39. | ||
|
||
### Running tests | ||
You may run tests by typing **python setup.py test**. | ||
You may run tests by typing `python setup.py test`. | ||
|
||
You must have file **./tests/fixtures/auth.cfg.truetoken.test**, if you want to rewrite [betamax](https://pypi.python.org/pypi/betamax) cassettes. | ||
|
||
### Documentation | ||
Go to package directory and type | ||
|
||
`pip install -r docs/requirements.txt` | ||
|
||
Then type the following command in order to generate documentation in HTML | ||
|
||
`cd docs && make html` | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
And verify code and documentation consistency by typing | ||
|
||
`cd docs && make doctest` | ||
|
||
You can reindex package modules by typing from the package directory | ||
|
||
`python -m sphinx.apidoc -f -o docs githubissuesbot` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ Contents: | |
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
intro | ||
modules | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
Introduction | ||
============ | ||
|
||
GitHub Issues Bot for MI-PYT in FIT CTU in Prague. The program has two | ||
modes: console and web app. In *console* mode it labels | ||
`issues <https://help.github.com/articles/creating-an-issue/>`__ (checks | ||
new one with the specified frequency) in the given repository by the | ||
issues itself and their comments, and in *web* mode the program labels | ||
new opened issue as soon as possible (by | ||
`webhook <https://developer.github.com/webhooks/>`__ notification and so | ||
one by one). | ||
|
||
Link to `testpypi <https://testpypi.python.org/pypi/githubissuesbot>`__. | ||
|
||
Link to `Read The Docs <https://readthedocs.org/projects/githubissuesbot/>`__. | ||
|
||
Requirements | ||
~~~~~~~~~~~~ | ||
|
||
- python 3.5 | ||
- libraries: `click <http://click.pocoo.org/6/>`__, | ||
`requests <http://docs.python-requests.org/en/master/>`__, | ||
`markdown <https://pypi.python.org/pypi/Markdown>`__, | ||
`flask <http://flask.pocoo.org/>`__, | ||
`appdirs <https://pypi.python.org/pypi/appdirs>`__ | ||
|
||
Manual | ||
~~~~~~ | ||
|
||
Installation | ||
~~~~~~~~~~~~ | ||
|
||
Install package by typing the command: | ||
|
||
``python -m pip install --extra-index-url https://testpypi.python.org/pypi githubissuesbot`` | ||
|
||
Running app | ||
~~~~~~~~~~~ | ||
|
||
Then you may run the app by typing | ||
|
||
``python -m githubissuesbot`` or just ``githubissuesbot``. | ||
|
||
Type ``--help`` for command line manual. | ||
|
||
Creating config files | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Read how to generate configuration files by typing | ||
|
||
``python -m githubissuesbot genconf --help`` | ||
|
||
or ``githubissuesbot genconf --help``. | ||
|
||
The app requires the following configuration files: **auth.cfg** (with | ||
`GitHub personal access token <https://help.github.com/articles/creating-an-access-token-for-command-line-use/>`__), | ||
**label.cfg** (with available labels and the appropriate rules as regular expressions), | ||
**secret.cfg** (with `webhook secret token <https://developer.github.com/webhooks/securing/>`__) | ||
and **web.cfg** (web app uses it for reading info about other configuration files). | ||
|
||
If you want to deploy this app on some host (tested on | ||
`pythonanywhere <https://www.pythonanywhere.com/>`__), don't forget to | ||
manually fix **web_config_file** value in **web_app.py** on line 39. | ||
|
||
Type ``--help`` for command line manual. | ||
|
||
Running tests | ||
~~~~~~~~~~~~~ | ||
|
||
You may run tests by typing ``python setup.py test``. | ||
|
||
You must have file **./tests/fixtures/auth.cfg.truetoken.test**, if you want to rewrite | ||
`betamax <https://pypi.python.org/pypi/betamax>`__ cassettes. | ||
|
||
Documentation | ||
~~~~~~~~~~~~~ | ||
|
||
Go to package directory and type | ||
|
||
``pip install -r docs/requirements.txt`` | ||
|
||
Then type the following command in order to generate documentation in HTML | ||
|
||
``cd docs && make html`` | ||
|
||
And verify code and documentation consistency by typing | ||
|
||
``cd docs && make doctest`` | ||
|
||
You can reindex package modules by typing from the package directory | ||
|
||
``python -m sphinx.apidoc -f -o docs githubissuesbot`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
When i try to follow this guide I end up with: