Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Relax python_version option to allow 3.x etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Apr 17, 2017
1 parent 520948f commit 9e91286
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
babel-eslint

RUN pip2 install -U flake8 pep8 pep8-naming pylint flake8-import-order && \
python3 -m pip install -U flake8 pep8 pep8-naming pylint flake8-import-order && \
pip3 install -U flake8 pep8 pep8-naming pylint flake8-import-order && \
python3.6 -m pip install -U badwolf \
&& rm -rf /var/lib/apt/list/* /tmp/* /var/tmp/*

Expand Down
7 changes: 3 additions & 4 deletions badwolf/lint/linters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import re
import sys
Expand Down Expand Up @@ -76,8 +77,6 @@ class PythonLinter(Linter):

@property
def python_name(self):
python_version = int(self.options.get('python_version', sys.version_info.major))
if python_version not in (2, 3):
python_version = sys.version_info.major

current_python = '{}.{}'.format(sys.version_info.major, sys.version_info.minor)
python_version = self.options.get('python_version', current_python)
return 'python{}'.format(python_version)
2 changes: 1 addition & 1 deletion src.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
babel-eslint

RUN pip2 install -U flake8 pep8 pep8-naming pylint flake8-import-order && \
python3 -m pip install -U flake8 pep8 pep8-naming pylint flake8-import-order && \
pip3 install -U flake8 pep8 pep8-naming pylint flake8-import-order && \
pip3 install -Ur requirements.txt \
&& python3.6 -m pip install . \
&& rm -rf /var/lib/apt/list/* /tmp/* /var/tmp/*
Expand Down

0 comments on commit 9e91286

Please sign in to comment.