Skip to content
Snippets Groups Projects
Commit 1a436bbf authored by Robert Habermann's avatar Robert Habermann
Browse files

fix layout

parent eabb7d96
No related branches found
No related tags found
No related merge requests found
Contributing
============
Google Docstring format for
* Args: (includes **kwargs)
* Returns:
* Raises:
* Examples:
https://sphinxcontrib-napoleon.readthedocs.org/en/latest/
https://sphinxcontrib-napoleon.readthedocs.org/en/latest/example_google.html#example-google
For a Spinx formatted "Note" or "Warning" use .rst Syntax:
* ``.. note::``
* ``.. warning::``
http://www.sphinx-doc.org/en/stable/markup/para.html
http://www.sphinx-doc.org/en/stable/rest.html
# Template
# PyOTRS
## Getting Started
### Get and initialize template
```
git clone https://github.com/frennkie/template
mv template NEW_PROJECT_NAME
cd NEW_PROJECT_NAME
```
### Use
`from pyotrs import PyOTRS`
`import pyotrs`
or
### Customize
`from pyotrs import Client, Ticket, Article`
Weired stuff.. don't name your python files the same as the NEW_PROJECT_NAME.
### more to come on this README page
There will be import trouble (at least when testing!)
Run script to change "template" to something that fits your project (not yet implemented!!)
```
./bin/start_project_from_template.sh NEW_PROJECT_NAME
```
```
virtualenv NEW_PROJECT_NAME/venv
source NEW_PROJECT_NAME/venv/bin/activate
pip install pip --upgrade
pip install -r requirements.txt
```
Verify all is good
```
py.test
```
## Code
Magic Happens Here (don't forget Testing, Versioning/Commiting and so on)
## Important non-coding stuff (Testing, Versioning/Git-Flow, Packaging, PEP8)
### Run Tests
```
py.test -v
```
Result should be similar to this:
```
$: py.test
================================================================================
test session starts
================================================================================
platform linux2 -- Python 2.7.8 -- py-1.4.30 -- pytest-2.7.2
rootdir: /home/XXX/template, inifile: setup.cfg
plugins: cache
collected 2 items
template/tests/test_misc.py .
template/tests/test_something.py .
================================================================================
2 passed in 0.05 seconds
================================================================================
```
### Versioning/Git-Flow
Versioning Style:
- Mayor Version: e.g. 0 | 1 | 2
- Minor Version: odd numbers for dev releases; even for stable releases
- Last Part: String or Number - for Hotfixes and Dev stages (e.g. 0 | 1 | dev1)
Example:
- `0.3.dev2` - unstable release; 2nd dev iteration
- `0.4.0` - stable release 0.4
- `0.6.2` - stable release 0.6 after 2 Hotfixes
This Style is supported by Git-Flow
http://danielkummer.github.io/git-flow-cheatsheet/
Reminders
- avoid the hotfixes.. just stick with feature branches
- if you need to create a hotfix starting from an old master/release state
create tags manually
- the following is extremely useful for bumping version numbers in multiple
files
```
sed -i "s/__version_info__ = ('0', '2', '0')/__version_info__ = ('0', '2', '1')/gi" *.py modules/*.py tests/*.py
```
### Packaging
```
python setup.py sdist
```
### Test coverage
`pip install pytest-cov`
.coveragerc:
```
[run]
omit = venv/*, tests/*
```
```
cd template
py.test --cov .
```
### PEP8 (getting really funky now.. ;-) )
```
# E402 can not be passed in tests because we need to add parent dir to path
pep8 --exclude=venv --ignore=E402 .
```
""" This is PyOTRS provide python access to OTRS
"""
.. moduleauthor:: Robert Habermann <robert.habermann@dlh.de>
.. autosummary::
This is PyOTRS provide python access to OTRS
Warm welcome words
Foo
Bar
Kernel::GenericInterface::Operation GenericInterface Operation interface
Kernel::GenericInterface::Operation
Common Base class for all Operations
Session::Common Base class for Session Operations
Session::SessionCreate GenericInterface Session Create Operation backend
Test::Test GenericInterface Operation Test backend
Ticket::Common Base class for all Ticket Operations
Ticket::TicketCreate GenericInterface Ticket TicketCreate Operation backend
Ticket::TicketGet GenericInterface Ticket Get Operation backend
Ticket::TicketSearch GenericInterface Ticket Search Operation backend
Ticket::TicketUpdate GenericInterface Ticket TicketUpdate Operation backend
.. note::
Roughly implements: https://otrs.github.io/doc/api/otrs/5.0/Perl/index.html
"""
from .client import Client
from .ticket import Ticket
from .lib import Article, Client, Ticket # noqa
This diff is collapsed.
......@@ -4,5 +4,5 @@
# 3) we can import it into your module module
"""
__version_info__ = ('0', '2', '4')
__version_info__ = ('0', '2', '7')
__version__ = '.'.join(__version_info__)
......@@ -53,8 +53,8 @@ basepython = python2.7
commands = flake8 \
--max-complexity=15 \
--exclude=./build,.venv,.tox,dist,doc,test_pyotrs.py \
--ignore=F403,Q000 \
--exclude=./build,.venv,.tox,dist,docs,test_pyotrs.py \
--ignore=Q000 \
--max-line-length=99 \
[]
......@@ -73,5 +73,5 @@ commands = flake8 \
#commands =
# rm -rf doc/_build/*
# sphinx-build -b html doc doc/_build/html
# pandoc -o docs/source/changelog.rst CHANGELOG.md
# pandoc -o docs/source/changelog.txt CHANGELOG.md
# rm -rf ./docs/build && sphinx-build -b html ./docs/source ./docs/build && sudo rm -rf /var/www/build && sudo cp -a docs/build /var/www
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment