From 597bf54f3e999867a3e42686b3063b169b52018c Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Wed, 1 Jul 2015 13:15:30 +0200 Subject: In-tree tests and linting with tox Before the patch it wasn't possible to run pylint outside a RPM build. The Python sources were split into common and server files in two separate trees. With setup.py and tox the pki package can now be installed and tested in a virtual env. Tox enables developers to automate installation and testing in Python virtual environment. The new tox.ini performs several tasks with one command: * It creates and installs a source distribution of pki packages and its command line scripts * It verifies that all CLI scripts can be execute (using its --help argument). * It runs pylint on all Python files and CLI scripts. * It can run flake8 on all Python and CLI files (disabled for now). * Finally it builds Sphinx autodocs. I had to delay the root check in pkispawn and pkidestroy and modify two files to get rid of Sphinx warnings. https://fedorahosted.org/pki/ticket/696 http://tox.readthedocs.org --- base/common/python/_static/.gitignore | 4 ++++ base/common/python/pki/cert.py | 39 +++++++++++++++++------------------ 2 files changed, 23 insertions(+), 20 deletions(-) create mode 100644 base/common/python/_static/.gitignore (limited to 'base/common/python') diff --git a/base/common/python/_static/.gitignore b/base/common/python/_static/.gitignore new file mode 100644 index 000000000..5e7d2734c --- /dev/null +++ b/base/common/python/_static/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/base/common/python/pki/cert.py b/base/common/python/pki/cert.py index 1fe323f24..01d2a616b 100644 --- a/base/common/python/pki/cert.py +++ b/base/common/python/pki/cert.py @@ -1,26 +1,25 @@ #!/usr/bin/python -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2014 Red Hat, Inc. +# All rights reserved. +# +# Authors: +# Abhishek Koneru +# Ade Lee - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Copyright (C) 2014 Red Hat, Inc. - All rights reserved. - -Authors: - Abhishek Koneru - Ade Lee - -""" import copy import json import types -- cgit