summaryrefslogtreecommitdiffstats
path: root/tox.ini
Commit message (Collapse)AuthorAgeFilesLines
* Misc pylint, flake8 and tox fixesChristian Heimes2017-03-311-10/+16
|
* Added cascading configuration for PKI CLI.Endi S. Dewata2017-03-151-1/+1
| | | | | | | | | The PKI CLI has been modified to support cascading configuration files: default, system-wide, and user-specific configuration. The existing Python-based PKI CLI was moved into pki.cli.main module. A new shell script was added as a replacement which will read the configuration files and invoke the Python module.
* Fedora 24 fixes for Python 3.5 and pylint 1.5Christian Heimes2016-02-291-3/+4
| | | | | | | | | | | Fedora 24 has Python 3.5 instead of Python 3.4. tox.ini now uses python3 to use any Python 3 interpreter. Python 3.5 has unittest.mock in the stdlib. Tests must attempt to import mock from unittest first. Pylint 1.5 has deprecated a couple of old options. Dogtag doesn't use the options anyway. I just removed them from dogtag.pylintrc.
* Python 3 fix for Tomcat.get_major_version()Christian Heimes2016-02-231-1/+1
| | | | | I forgot to decode the output of subprocess.check_call(). All other places decode bytes to text properly.
* Fix flake8 / PEP 8 violationsChristian Heimes2016-01-251-1/+1
| | | | https://fedorahosted.org/pki/ticket/1738
* Py3 modernization: misc manual fixesChristian Heimes2015-08-171-8/+19
| | | | | | | | | | | | | | | | | | | | | | Python 3's exception class has no message attribute. e.message can either be replaced with string representation of e or e.args[0]. Use print(line, end='') instead of sys.stdout.write(). With end='' no new line is appended. Use six.reraise() to reraise an exception. Remove sys.exc_clear() as it is no longer available in Python 3. Conditionally import shutil.WindowsError. Use six.move to import correct modules / function like quote, urlparse and configparser. Silence some pylint warnings. pylint doesn't understand six.moves magic and emits a import-error warning. Add additional tox envs to check for Python 3 compatibility.
* Py3 modernization: libmodernize.fixes.fix_importChristian Heimes2015-08-171-1/+1
| | | | | | | | | | | | | | Enforce absolute imports or explicit relative imports. Python 3 no longer supports implicit relative imports, that is unqualified imports from a module's directory. In order to load a module from the same directory inside a package, use from . import module The future feature 'from __future__ import absolute_import' ensures that pki uses absolute imports on Python 2, too. See https://www.python.org/dev/peps/pep-0328/
* Make pki PEP 8 compatibleChristian Heimes2015-08-141-2/+3
| | | | | | | | | | | | | | | | | | | Large portions of the patch was automatically created with autopep8: find base/ -name '*.py' | xargs autopep8 --in-place --ignore E309 \ --aggressive find base/common/upgrade base/server/upgrade -type f -and \ -not -name .gitignore | autopep8 --in-place --ignore E309 --aggressive autopep8 --in-place --ignore E309 --aggressive \ base/common/sbin/pki-upgrade \ base/server/sbin/pkispawn \ base/server/sbin/pkidestroy \ base/server/sbin/pki-server \ base/server/sbin/pki-server-upgrade About two dozent violations were fixed manually. https://fedorahosted.org/pki/ticket/708
* Move pylint-build-scan.py to scripts directoryChristian Heimes2015-08-141-2/+2
| | | | | | Move internal helper and its configuration out of the project's root directory into scripts/. Also use re instead of fnmatch to find the upgrade scriptlets.
* Rewrite pylint-build-scan as improved Python scriptChristian Heimes2015-08-101-15/+14
| | | | | | | The upgrade scripts don't have a .py file extension. For this reason they are not picked up by pylint in tox.ini. Tox doesn't support shell scripting. In order to check all files I rewrote the pylint-build-scan.sh script as Python script.
* Handle JSON decode error in handle_exceptions()Christian Heimes2015-07-151-0/+6
| | | | | | | | | | | | | pki.handle_exceptions() raises a JSON decode exception when the body of the HTTPException is not a valid JSON string. The JSON exception hides the true error message. The patch also fixes a bug in PKIException.from_json(). The code and ClassName attribute are now correctly set. Finally we have our first unit test. https://fedorahosted.org/pki/ticket/1488 https://fedorahosted.org/freeipa/ticket/5129
* In-tree tests and linting with toxChristian Heimes2015-07-101-0/+80
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