CRITICAL NOTE about versions!
For historical reasons a major refactor/redesign was started but
aborted partway through the release process. As a result, the 1.x
python-krux-stdlib should not be used. Please use
either pre-1.x releases or the 2.x series.
Commit a2ff5ab is where we discarded the 1.x series and "reset" master to be based off of 0.8.x. That markes the beginning of the 2.x series.
Add the Krux pip repository and python-krux-stdlib to the top of your project's
### Optional - also available on PyPi --extra-index-url https://staticfiles.krxd.net/foss/pypi/ krux-stdlib==2.1.1
Code up your app. First, define your class to inherit from krux.cli.Application. In the
__init__()method, initialize the superclass, passing in whatever parameters you need. Minimally:
class TestLoggingApp( krux.cli.Application ): def __init__(self): super(TestLoggingApp, self).__init__(name='testloggingapp', syslog_facility='local0')
Now you are ready to define any methods you might need under your Application() subclass:
def foo_things(self): self.logger.debug("just called foo_things()")
Finally, call the whole kit from
def main(): app = TestLoggingApp() app.logger.debug("this is a debug level message") app.foo_things()
Clone the repository.
git clone firstname.lastname@example.org:krux/python-krux-stdlib.git ~/Projects/krux-stdlib
Set up a virtual environment.
mkdir -p ~/.virtualenv/krux-stdlib && virtualenv ~/.virtualenv/krux-stdlib
Activate the virtual environment.
Install the requirements.
cd ~/Projects/krux-stdlib; pip install -r requirements.pip
Hack away! Make sure to add unit tests.
Make sure you document everything. You can preview the generated documentation by running:
docsubdirectory. Then open
doc/github/html/index.htmlin your favorite browser.
To cut a release, update the VERSION in
krux/__init__.py, merge to the
releasebranch, and push to GitHub. Jenkins will build and upload the new version to the Krux python repository, as well as tagging the release in git and updating the documentation.
Note: To set this kind of workflow up for your own projects, clone the python-krux-stdlib Jenkins job :-)