mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2025-12-22 12:41:57 +00:00
migrate to use black as opinionated auto formater
This commit is contained in:
committed by
Mojib Wali
parent
4fd0501c58
commit
903498185f
@@ -15,15 +15,6 @@ insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
charset = utf-8
|
||||
|
||||
# Python files
|
||||
[*.py]
|
||||
indent_size = 4
|
||||
# isort plugin configuration
|
||||
known_first_party = invenio_theme_tugraz
|
||||
multi_line_output = 2
|
||||
default_section = THIRDPARTY
|
||||
skip = .eggs
|
||||
|
||||
# RST files (used by sphinx)
|
||||
[*.rst]
|
||||
indent_size = 4
|
||||
|
||||
14
docs/conf.py
14
docs/conf.py
@@ -44,9 +44,9 @@ source_suffix = ".rst"
|
||||
master_doc = "index"
|
||||
|
||||
# General information about the project.
|
||||
project = u"invenio-theme-tugraz"
|
||||
copyright = u"2020, Graz University of Technology"
|
||||
author = u"Graz University of Technology"
|
||||
project = "invenio-theme-tugraz"
|
||||
copyright = "2020, Graz University of Technology"
|
||||
author = "Graz University of Technology"
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
@@ -241,8 +241,8 @@ latex_documents = [
|
||||
(
|
||||
master_doc,
|
||||
"invenio-theme-tugraz.tex",
|
||||
u"invenio-theme-tugraz Documentation",
|
||||
u"Graz University of Technology",
|
||||
"invenio-theme-tugraz Documentation",
|
||||
"Graz University of Technology",
|
||||
"manual",
|
||||
),
|
||||
]
|
||||
@@ -276,7 +276,7 @@ man_pages = [
|
||||
(
|
||||
master_doc,
|
||||
"invenio-theme-tugraz",
|
||||
u"invenio-theme-tugraz Documentation",
|
||||
"invenio-theme-tugraz Documentation",
|
||||
[author],
|
||||
1,
|
||||
)
|
||||
@@ -295,7 +295,7 @@ texinfo_documents = [
|
||||
(
|
||||
master_doc,
|
||||
"invenio-theme-tugraz",
|
||||
u"invenio-theme-tugraz Documentation",
|
||||
"invenio-theme-tugraz Documentation",
|
||||
author,
|
||||
"invenio-theme-tugraz",
|
||||
"invenio module for TUGRAZ theme.",
|
||||
|
||||
@@ -16,9 +16,7 @@ INVENIO_THEME_TUGRAZ_DEFAULT_VALUE = _("TU Graz Repository")
|
||||
INVENIO_THEME_TUGRAZ_BASE_TEMPLATE = "invenio_theme_tugraz/base.html"
|
||||
"""TU Graz Default base template"""
|
||||
|
||||
INVENIO_THEME_TUGRAZ_ACCOUNT_BASE = (
|
||||
"invenio_theme_tugraz/accounts/accounts_base.html"
|
||||
)
|
||||
INVENIO_THEME_TUGRAZ_ACCOUNT_BASE = "invenio_theme_tugraz/accounts/accounts_base.html"
|
||||
"""TU Graz Default account base template"""
|
||||
|
||||
INVENIO_THEME_TUGRAZ_ICON = "images/icon_use.png"
|
||||
@@ -75,9 +73,7 @@ THEME_SITENAME = _("Repository")
|
||||
SECURITY_LOGIN_USER_TEMPLATE = "invenio_theme_tugraz/accounts/login_user.html"
|
||||
"""Login template"""
|
||||
|
||||
SECURITY_REGISTER_USER_TEMPLATE = (
|
||||
"invenio_theme_tugraz/accounts/register_user.html"
|
||||
)
|
||||
SECURITY_REGISTER_USER_TEMPLATE = "invenio_theme_tugraz/accounts/register_user.html"
|
||||
"""Sigup template"""
|
||||
|
||||
# Invenio-app-rdm
|
||||
|
||||
@@ -20,5 +20,6 @@ class FrontpageRecordsSearch(RecordsSearch):
|
||||
|
||||
index = "rdmrecords-records"
|
||||
default_filter = Q(
|
||||
"query_string", query=(
|
||||
"access.record:public " "AND versions.is_latest:true"))
|
||||
"query_string",
|
||||
query=("access.record:public " "AND versions.is_latest:true"),
|
||||
)
|
||||
|
||||
@@ -51,7 +51,9 @@ def records_serializer(records=None):
|
||||
"""Serialize list of records."""
|
||||
record_list = []
|
||||
for record in records:
|
||||
record_list.append(UIJSONSerializer().serialize_object_to_dict(record.to_dict()))
|
||||
record_list.append(
|
||||
UIJSONSerializer().serialize_object_to_dict(record.to_dict())
|
||||
)
|
||||
return record_list
|
||||
|
||||
|
||||
@@ -60,8 +62,7 @@ def index():
|
||||
records = FrontpageRecordsSearch()[:5].sort("-created").execute()
|
||||
|
||||
return render_template(
|
||||
"invenio_theme_tugraz/index.html",
|
||||
records=records_serializer(records)
|
||||
"invenio_theme_tugraz/index.html", records=records_serializer(records)
|
||||
)
|
||||
|
||||
|
||||
|
||||
12
pytest.ini
12
pytest.ini
@@ -1,12 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2020-2021 Graz University of Technology.
|
||||
#
|
||||
# invenio-theme-tugraz is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the MIT License; see LICENSE file for more
|
||||
# details.
|
||||
|
||||
[pytest]
|
||||
addopts = --isort --pydocstyle --pycodestyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_theme_tugraz --cov-report=term-missing tests invenio_theme_tugraz
|
||||
testpaths = tests invenio_theme_tugraz
|
||||
live_server_scope = module
|
||||
21
setup.cfg
21
setup.cfg
@@ -44,6 +44,7 @@ install_requires =
|
||||
|
||||
[options.extras_require]
|
||||
tests =
|
||||
pytest-black>=0.3.0,<0.3.10
|
||||
sphinx>=4.2.0,<5
|
||||
pytest-invenio>=1.4.7
|
||||
invenio-app>=1.3.0,<2.0.0
|
||||
@@ -94,20 +95,10 @@ output-dir = invenio_theme_tugraz/translations/
|
||||
[update_catalog]
|
||||
input-file = invenio_theme_tugraz/translations/messages.pot
|
||||
output-dir = invenio_theme_tugraz/translations/
|
||||
|
||||
[flake8]
|
||||
max-line-length = 88
|
||||
extend-ignore = E203
|
||||
select = C,E,F,W,B,B950
|
||||
ignore = E501
|
||||
|
||||
[isort]
|
||||
multi_line_output = 3
|
||||
include_trailing_comma = True
|
||||
force_grid_wrap = 0
|
||||
use_parentheses = True
|
||||
ensure_newline_before_comments = True
|
||||
line_length = 88
|
||||
profile=black
|
||||
|
||||
[pycodestyle]
|
||||
ignore = E203,E501
|
||||
[tool:pytest]
|
||||
addopts = --black --isort --pydocstyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_theme_tugraz --cov-report=term-missing tests invenio_theme_tugraz
|
||||
testpaths = tests invenio_theme_tugraz
|
||||
live_server_scope = module
|
||||
|
||||
Reference in New Issue
Block a user