aboutsummaryrefslogtreecommitdiffstats
path: root/dodo.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-02-03 19:17:50 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-02-03 19:17:50 -0500
commit475d074fd74425efbe783fad08f97f2df0c4909f (patch)
tree2acdae53999b3c74b716efa4edb5b40311fa356a /dodo.py
parentcd502d52787f666fff3254d7d7e7578930c813c2 (diff)
parent3a0d66f07b112b6d2bdc2b57bbf717a89a351ce6 (diff)
Update upstream source from tag 'upstream/8.1.2'
Update to upstream version '8.1.2' with Debian dir e5e966a9e6010ef70618dc9a61558fa4db35aceb
Diffstat (limited to 'dodo.py')
-rw-r--r--dodo.py46
1 files changed, 1 insertions, 45 deletions
diff --git a/dodo.py b/dodo.py
index fe08661..1d78634 100644
--- a/dodo.py
+++ b/dodo.py
@@ -1,8 +1,6 @@
import os
import fnmatch
-import locale
-import subprocess
DOIT_CONFIG = {
'default_tasks': ['flake8', 'test'],
@@ -29,54 +27,13 @@ def task_pydocstyle():
"""pydocstyle -- static check for docstring style"""
yield {
'name': os.path.join(os.getcwd(), 'nikola'),
- 'actions': ["pydocstyle --count --match-dir='(?!^\.)(?!data).*' nikola/"],
- }
-
-
-def task_locale():
- """set environ locale vars used in nikola tests"""
- def set_nikola_test_locales():
- try:
- out = subprocess.check_output(['locale', '-a'])
- out = out.decode('utf-8')
- locales = []
- languages = set()
- for line in out.splitlines():
- if (line.endswith('.utf8') or line.endswith('.UTF-8')) and '_' in line:
- lang = line.split('_')[0]
- if lang not in languages:
- try:
- locale.setlocale(locale.LC_ALL, str(line))
- except:
- continue
- languages.add(lang)
- locales.append((lang, line))
- if len(locales) == 2:
- break
- if len(locales) != 2:
- return False # task failed
- else:
- os.environ['NIKOLA_LOCALE_DEFAULT'] = ','.join(locales[0])
- os.environ['NIKOLA_LOCALE_OTHER'] = ','.join(locales[1])
- finally:
- # restore to default locale
- locale.resetlocale()
-
- return {'actions': [set_nikola_test_locales], 'verbosity': 2}
-
-
-def task_doctest():
- """run doctests with py.test"""
- return {
- 'actions': ['py.test --doctest-modules nikola/'],
- 'verbosity': 2,
+ 'actions': ["pydocstyle --count --match-dir='(?!^\\.)(?!data).*' nikola/"],
}
def task_test():
"""run unit-tests using py.test"""
return {
- 'task_dep': ['locale', 'doctest'],
'actions': ['py.test tests/'],
}
@@ -84,7 +41,6 @@ def task_test():
def task_coverage():
"""run unit-tests using py.test, with coverage reporting"""
return {
- 'task_dep': ['locale', 'doctest'],
'actions': ['py.test --cov nikola --cov-report term-missing tests/'],
'verbosity': 2,
}