Merge pull request #267 from pylast/pep8-naming
Add pep8-naming to flake8 and fix issues
This commit is contained in:
commit
61e95cc2a4
|
@ -108,6 +108,9 @@ SCROBBLE_MODE_LOVED = "L"
|
||||||
SCROBBLE_MODE_BANNED = "B"
|
SCROBBLE_MODE_BANNED = "B"
|
||||||
SCROBBLE_MODE_SKIPPED = "S"
|
SCROBBLE_MODE_SKIPPED = "S"
|
||||||
|
|
||||||
|
# Delay time in seconds from section 4.4 of https://www.last.fm/api/tos
|
||||||
|
DELAY_TIME = 0.2
|
||||||
|
|
||||||
# Python >3.4 and >2.7.9 has sane defaults
|
# Python >3.4 and >2.7.9 has sane defaults
|
||||||
SSL_CONTEXT = ssl.create_default_context()
|
SSL_CONTEXT = ssl.create_default_context()
|
||||||
|
|
||||||
|
@ -254,9 +257,6 @@ class _Network(object):
|
||||||
"""
|
"""
|
||||||
Makes sure that web service calls are at least 0.2 seconds apart.
|
Makes sure that web service calls are at least 0.2 seconds apart.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Delay time in seconds from section 4.4 of https://www.last.fm/api/tos
|
|
||||||
DELAY_TIME = 0.2
|
|
||||||
now = time.time()
|
now = time.time()
|
||||||
|
|
||||||
time_since_last = now - self.last_call_time
|
time_since_last = now - self.last_call_time
|
||||||
|
|
|
@ -54,11 +54,11 @@ class TestPyLastWithLastFm(PyLastTestCase):
|
||||||
self.username = self.__class__.secrets["username"]
|
self.username = self.__class__.secrets["username"]
|
||||||
password_hash = self.__class__.secrets["password_hash"]
|
password_hash = self.__class__.secrets["password_hash"]
|
||||||
|
|
||||||
API_KEY = self.__class__.secrets["api_key"]
|
api_key = self.__class__.secrets["api_key"]
|
||||||
API_SECRET = self.__class__.secrets["api_secret"]
|
api_secret = self.__class__.secrets["api_secret"]
|
||||||
|
|
||||||
self.network = pylast.LastFMNetwork(
|
self.network = pylast.LastFMNetwork(
|
||||||
api_key=API_KEY, api_secret=API_SECRET,
|
api_key=api_key, api_secret=api_secret,
|
||||||
username=self.username, password_hash=password_hash)
|
username=self.username, password_hash=password_hash)
|
||||||
|
|
||||||
def helper_is_thing_hashable(self, thing):
|
def helper_is_thing_hashable(self, thing):
|
||||||
|
|
25
tox.ini
25
tox.ini
|
@ -10,13 +10,13 @@ setenv =
|
||||||
PYLAST_API_SECRET={env:PYLAST_API_SECRET:}
|
PYLAST_API_SECRET={env:PYLAST_API_SECRET:}
|
||||||
deps =
|
deps =
|
||||||
# Workaround for yaml/pyyaml#126
|
# Workaround for yaml/pyyaml#126
|
||||||
py27,py36,py35,py34,pypy,pypy3,py36dev: pyyaml
|
py27,py36,py35,py34,pypy,pypy3,py36dev: pyyaml
|
||||||
py37dev: git+https://github.com/yaml/pyyaml@master#egg=pyyaml
|
py37dev: git+https://github.com/yaml/pyyaml@master#egg=pyyaml
|
||||||
pytest
|
pytest
|
||||||
mock
|
mock
|
||||||
ipdb
|
ipdb
|
||||||
pytest-cov
|
pytest-cov
|
||||||
flaky
|
flaky
|
||||||
commands = pytest -v -s -W all --cov pylast --cov-report term-missing {posargs}
|
commands = pytest -v -s -W all --cov pylast --cov-report term-missing {posargs}
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
|
@ -25,18 +25,15 @@ commands = {posargs}
|
||||||
|
|
||||||
[testenv:lint]
|
[testenv:lint]
|
||||||
deps =
|
deps =
|
||||||
pycodestyle
|
flake8
|
||||||
pyflakes
|
pep8-naming
|
||||||
commands =
|
commands =
|
||||||
pyflakes pylast
|
flake8 .
|
||||||
pyflakes tests
|
|
||||||
pycodestyle pylast
|
|
||||||
pycodestyle tests
|
|
||||||
|
|
||||||
[testenv:py2lint]
|
[testenv:py2lint]
|
||||||
deps =
|
deps =
|
||||||
{[testenv:lint]deps}
|
{[testenv:lint]deps}
|
||||||
clonedigger
|
clonedigger
|
||||||
commands =
|
commands =
|
||||||
{[testenv:lint]commands}
|
{[testenv:lint]commands}
|
||||||
./clonedigger.sh
|
./clonedigger.sh
|
||||||
|
|
Loading…
Reference in a new issue