diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2018-03-02 08:01:21 +0000 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2018-03-03 15:59:05 -0500 |
commit | 4f7bc4f4e6531aba5beb0d8efbb7b5f3478a030d (patch) | |
tree | ed4fd81aeeb52ca16eab680f7dee6bf9bc9ae3b3 /setup.py | |
parent | 5ac2fe7fe4f6eac6da3ef49837b2fab26cad85cd (diff) | |
download | virt-manager-4f7bc4f4e6531aba5beb0d8efbb7b5f3478a030d.tar.gz |
pylint: Use pylint.lint module
The `pylint-3` executable is provided by the python3-pylint rpm
package on Fedora.
For Debian the equivalent is `pylint3`.
On Arch Linux the default version of Python is 3.
Pylint lints for the version of Python it is running. Instead of
spawning an executable, import the `pylint.lint` module and call
`Run()`.
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -581,6 +581,8 @@ class CheckPylint(distutils.core.Command): self.jobs = int(self.jobs) def run(self): + import pylint.lint + files = ["setup.py", "virt-install", "virt-clone", "virt-convert", "virt-xml", "virt-manager", "virtcli", "virtinst", "virtconv", "virtManager", @@ -597,15 +599,14 @@ class CheckPylint(distutils.core.Command): os.system(cmd) print("running pylint") - cmd = "pylint-3 " + pylint_opts = [ + "--rcfile", "tests/pylint.cfg", + "--output-format=%s" % output_format, + ] + ["--ignore"] + [os.path.basename(p) for p in exclude] if self.jobs: - cmd += "--jobs=%d " % self.jobs - cmd += "--rcfile tests/pylint.cfg " - cmd += "--output-format=%s " % output_format - cmd += "--ignore %s " % ",".join( - [os.path.basename(p) for p in exclude]) - cmd += " ".join(files) - os.system(cmd) + pylint_opts += ["--jobs=%d" % self.jobs] + + pylint.lint.Run(files + pylint_opts) class VMMDistribution(distutils.dist.Distribution): |