Skip to content

Commit 77283bb

Browse files
committed
chore: Format, duties
1 parent 747d554 commit 77283bb

6 files changed

Lines changed: 15 additions & 10 deletions

File tree

config/flake8.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
exclude = fixtures,docs,site
2+
exclude = tests,docs,site
33
max-line-length = 132
44
docstring-convention = google
55
ban-relative-imports = true

duties.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,13 @@ def check_code_quality(ctx, files=PY_SRC):
123123
ctx: The context instance (passed automatically).
124124
files: The files to check.
125125
"""
126-
ctx.run(f"flake8 --config=config/flake8.ini {files}", title="Checking code quality", pty=PTY)
126+
ctx.run(
127+
f"flake8 --config=config/flake8.ini {files}",
128+
title="Checking code quality",
129+
pty=PTY,
130+
nofail=True,
131+
quiet=True,
132+
)
127133

128134

129135
@duty
@@ -158,10 +164,11 @@ def check_docs(ctx, strict: bool = False):
158164
159165
Arguments:
160166
ctx: The context instance (passed automatically).
167+
strict: Whether to build with MkDocs' struct mode.
161168
"""
162169
Path("htmlcov").mkdir(parents=True, exist_ok=True)
163170
Path("htmlcov/index.html").touch(exist_ok=True)
164-
ctx.run("mkdocs build -s", title="Building documentation", pty=PTY)
171+
ctx.run(f"mkdocs build{' -s' if strict else ''}", title="Building documentation", pty=PTY)
165172

166173

167174
@duty

scripts/setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ if [ -n "${PYTHON_VERSIONS}" ]; then
1818
for python_version in ${PYTHON_VERSIONS}; do
1919
if pdm use -f "${python_version}" &>/dev/null; then
2020
echo "> Using Python ${python_version} environment"
21-
pdm install
21+
pdm install -s numpy-style
2222
else
2323
echo "> pdm use -f ${python_version}: Python version not available?" >&2
2424
fi
2525
done
2626
else
27-
pdm install
27+
pdm install -s numpy-style
2828
fi

tests/test_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import pytest
99
from django.db.models.fields import CharField
1010
from marshmallow import fields
11-
from tests import FIXTURES_DIR
1211

1312
from pytkdocs.loader import Loader, get_object_tree
13+
from tests import FIXTURES_DIR
1414

1515

1616
def test_import_no_path():

tests/test_objects.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
"""Tests for [the `objects` module][pytkdocs.objects]."""
22
import os
33

4-
from tests import FIXTURES_DIR
5-
64
from pytkdocs.loader import Loader
75
from pytkdocs.objects import Attribute, Class, Function, Method, Module, Object
6+
from tests import FIXTURES_DIR
87

98

109
def test_creating_module():

tests/test_parsers/test_attributes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"""Tests for [the `parsers.attributes` module][pytkdocs.parsers.attributes]."""
22

3-
from tests.fixtures.parsing import attributes as attr_module
4-
53
from pytkdocs.parsers.attributes import get_class_attributes, get_instance_attributes, get_module_attributes
4+
from tests.fixtures.parsing import attributes as attr_module
65

76

87
class TestParsing:

0 commit comments

Comments
 (0)