treyhunner/django-simple-history

View on GitHub
[pre-commit.ci] pre-commit autoupdate (#1374) #491
pre-commit-ci[bot] authored 7fdebc8f
complete00:00:22
Your first build completed successfully!

Congratulations

Your first build completed successfully!

See the Results

1
git clone
2
codeclimate validate-config
View output
codeclimate validate-config
WARNING: engine radon: unrecognized key 'threshold'
3
codeclimate prepare
View output
codeclimate prepare
4
builder pull-engines
View output
determining required images
docker pull codeclimate/codeclimate-bandit:b866
b866: Pulling from codeclimate/codeclimate-bandit
a0e0ef996968: Pulling fs layer
00c69949e211: Pulling fs layer
124b11ffd9dc: Pulling fs layer
74d262bd6915: Pulling fs layer
963a4e0e1415: Pulling fs layer
ea041886215a: Pulling fs layer
3bbf7ff90c63: Pulling fs layer
963a4e0e1415: Waiting
ea041886215a: Waiting
3bbf7ff90c63: Waiting
74d262bd6915: Waiting
124b11ffd9dc: Verifying Checksum
124b11ffd9dc: Download complete
00c69949e211: Verifying Checksum
00c69949e211: Download complete
a0e0ef996968: Download complete
ea041886215a: Verifying Checksum
ea041886215a: Download complete
963a4e0e1415: Download complete
a0e0ef996968: Pull complete
00c69949e211: Pull complete
3bbf7ff90c63: Verifying Checksum
3bbf7ff90c63: Download complete
124b11ffd9dc: Pull complete
74d262bd6915: Verifying Checksum
74d262bd6915: Download complete
74d262bd6915: Pull complete
963a4e0e1415: Pull complete
ea041886215a: Pull complete
3bbf7ff90c63: Pull complete
Digest: sha256:b831294279e697e4402c0bd94153247577b1e1297055bac81a8e2922b4dedba5
Status: Downloaded newer image for registry.prod.codeclimate.net/codeclimate/codeclimate-bandit:b866
docker pull codeclimate/codeclimate-radon:b695
b695: Pulling from codeclimate/codeclimate-radon
e00d546a75ad: Pulling fs layer
21f0a0866768: Pulling fs layer
cd9d3946aa16: Pulling fs layer
2e56add6654f: Pulling fs layer
6c87f215a2be: Pulling fs layer
c2b31566ca3d: Pulling fs layer
2e56add6654f: Waiting
6c87f215a2be: Waiting
c2b31566ca3d: Waiting
21f0a0866768: Verifying Checksum
21f0a0866768: Download complete
e00d546a75ad: Verifying Checksum
e00d546a75ad: Download complete
cd9d3946aa16: Verifying Checksum
cd9d3946aa16: Download complete
e00d546a75ad: Pull complete
6c87f215a2be: Verifying Checksum
6c87f215a2be: Download complete
c2b31566ca3d: Verifying Checksum
c2b31566ca3d: Download complete
21f0a0866768: Pull complete
cd9d3946aa16: Pull complete
2e56add6654f: Download complete
2e56add6654f: Pull complete
6c87f215a2be: Pull complete
c2b31566ca3d: Pull complete
Digest: sha256:dfeb7edc634b4e2f851f3c788f7c21bd8bae097d4c66af722c76a6ba51121f98
Status: Downloaded newer image for registry.prod.codeclimate.net/codeclimate/codeclimate-radon:b695
5
structure
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
6
duplication
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
I, [2024-11-04T00:47:43.405421 #1]  INFO -- : Skipping file runtests.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 156
    def get_default_settings(*, database_name=DEFAULT_DATABASE_NAME):
                              ^
SyntaxError: invalid syntax


I, [2024-11-04T00:47:43.439065 #1]  INFO -- : Skipping file ./simple_history/management/commands/clean_duplicate_history.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 79
    self.log(f"{model} has {found} historical entries", 2)
                                                     ^
SyntaxError: invalid syntax


I, [2024-11-04T00:47:43.450187 #1]  INFO -- : Skipping file ./simple_history/management/commands/populate_history.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 85
    self.stderr.write(f"{e}\n")
                             ^
SyntaxError: invalid syntax


I, [2024-11-04T00:47:43.455299 #1]  INFO -- : Skipping file ./simple_history/management/commands/clean_old_history.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 63
    self.log(f"{model} has {found} old historical entries", 2)
                                                         ^
SyntaxError: invalid syntax


I, [2024-11-04T00:47:43.466076 #1]  INFO -- : Skipping file simple_history/manager.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 32
    def as_instances(self) -> "HistoricalQuerySet":
                           ^
SyntaxError: invalid syntax


I, [2024-11-04T00:47:43.472329 #1]  INFO -- : Skipping file simple_history/template_utils.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 14
    def conditional_str(obj: Any) -> str:
                           ^
SyntaxError: invalid syntax


I, [2024-11-04T00:47:43.480238 #1]  INFO -- : Skipping file simple_history/admin.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 112
    self, request, history_manager: HistoryManager, pk_name: str, object_id: Any
                                  ^
SyntaxError: invalid syntax


I, [2024-11-04T00:47:43.485832 #1]  INFO -- : Skipping file simple_history/__init__.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 12
    **records_config,
                    ^
SyntaxError: invalid syntax


I, [2024-11-04T00:47:43.494069 #1]  INFO -- : Skipping file simple_history/middleware.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 33
    async def middleware(request):
            ^
SyntaxError: invalid syntax


I, [2024-11-04T00:47:43.499493 #1]  INFO -- : Skipping file simple_history/utils.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 34
    raise NotHistoricalModelError(f"Cannot find a historical model for {model}.")
                                                                               ^
SyntaxError: invalid syntax


I, [2024-11-04T00:47:43.511958 #1]  INFO -- : Skipping file simple_history/models.py due to exception (CC::Engine::Analyzers::ParserError): `python2 /usr/src/app/lib/cc/engine/analyzers/python/parser.py` exited with code 1:
Traceback (most recent call last):
  File "/usr/src/app/lib/cc/engine/analyzers/python/parser.py", line 51, in <module>
    print(json.dumps(to_json(ast.parse(source))))
  File "/usr/local/python2/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 253
    return f"{self.DEFAULT_MODEL_NAME_PREFIX}{model._meta.object_name}"
                                                                      ^
SyntaxError: invalid syntax
7
bandit
bandit engine documentation
View output
[main]	INFO	profile include tests: None
[main]	INFO	profile exclude tests: None
[main]	INFO	cli include tests: None
[main]	INFO	cli exclude tests: None
[node_visitor]	INFO	Unable to find qualified name for module: runtests.py
8
radon
radon engine documentation
View output
Running radon3...
9
sonar-python
sonar-python engine documentation
View output
INFO: Java 1.8.0_111-internal Oracle Corporation (64-bit)
INFO: Linux 4.4.0-1128-aws amd64
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-core-2.17.0.899.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-cli-2.1.0.566.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
INFO: Index files
INFO: Invalid character encountered in file '/code/simple_history/locale/nb/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/ru_RU/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/ur/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/cs_CZ/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/de/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/zh_Hans/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/fr/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/pt_BR/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/pl/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/ar/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/simple_history/locale/id/LC_MESSAGES/django.mo' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/3_poll_reverted.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/5_history_list_display.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/1_poll_history.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/4_history_after_poll_reverted.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/10_revert_disabled.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: Invalid character encountered in file '/code/docs/screens/2_revert.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: 92 files indexed
ERROR: Unable to parse file: /code/simple_history/template_utils.py
ERROR: Parse error at line 39 column 44:

   23: (s: Any) -> bool:
   24:     """
   25:     Returns whether ``s`` is a (presumably) pre-escaped string or not.
   26: 
   27:     This relies on the same ``__html__`` convention as Django's ``conditional_escape``
   28:     does.
   29:     """
   30:     return hasattr(s, "__html__")
   31: 
   32: 
   33: class HistoricalRecordContextHelper:
   34:     """
   35:     Class containing various utilities for formatting the template context for
   36:     a historical record.
   37:     """
   38: 
  -->      DEFAULT_MAX_DISPLAYED_DELTA_CHANGE_CHARS: Final = 100
   40: 
   41:     def __init__(
   42:         self,
   43:         model: Type[Model],
   44:         historical_record: HistoricalChanges,
   45:         *,
   46:         max_displayed_delta_change_chars=DEFAULT_MAX_DISPLAYED_DELTA_CHANGE_CHARS,
   47:     ):
   48: 

ERROR: Unable to parse file: /code/simple_history/admin.py
ERROR: Parse error at line 124 column 10:

  109: 
  110: 
  111:     def get_history_queryset(
  112:         self, request, history_manager: HistoryManager, pk_name: str, object_id: Any
  113:     ) -> QuerySet:
  114:         """
  115:         Return a ``QuerySet`` of all historical records that should be listed in the
  116:         ``object_history_list_template`` template.
  117:         This is used by ``history_view()``.
  118: 
  119:         :param request:
  120:         :param history_manager:
  121:         :param pk_name: The name of the original model's primary key field.
  122:         :param object_id: The primary key of the object whose history is listed.
  123:         """
  -->          qs: HistoricalQuerySet = history_manager.filter(**{pk_name: object_id})
  125:         if not isinstance(history_manager.model.history_user, property):
  126: 
  127:             

ERROR: Unable to parse file: /code/simple_history/__init__.py
ERROR: Parse error at line 12 column 20:

    3: metadata.version("django-simple-history")
    4: 
    5: 
    6: def register(
    7:     model,
    8:     app=None,
    9:     manager_name="history",
   10:     records_class=None,
   11:     table_name=None,
  -->      **records_config,
   13: ):
   14:     """
   15:     Create historical model for `model` and attach history manager to `model`.
   16: 
   17:     Keyword arguments:
   18:     app -- App to install historical model into (defaults to model.__module__)
   19:     manager_name -- class attribute name to use for historical manager
   20:     records_class -- class to use for history relation (defaults to
   21:         HistoricalRecords)
   22:     table_name -- Custom name for history table (defaults to
   23:         'APPNAME_historicalMODELNAME')
   24: 
   25:     This method should be used as an alternative to attaching an
   26:     `HistoricalManager` instance directly to `model`.
   27:     """
   28:     from . import models
   29: 
   30:     if records_class is None:
   31:         records_class = models.HistoricalRecords
   32: 
   33:     records = records_class(

ERROR: Unable to parse file: /code/simple_history/models.py
ERROR: Parse error at line 960 column 4:

  954: self,
  955:         old_history: "HistoricalChanges",
  956:         excluded_fields: Iterable[str] = None,
  957:         included_fields: Iterable[str] = None,
  958:         *,
  959:         foreign_keys_are_objs=False,
  -->      ) -> "ModelDelta":
  961:         """
  962:         :param old_history:
  963:         :param excluded_fields: The names of fields to exclude from diffing.
  964:                This takes precedence over ``included_fields``.
  965:         :param included_fields: The names of the only fields to include when diffing.
  966:                If not provided, all history-tracked fields will be included.
  967:         :param foreign_keys_are_objs: If ``False``, the returned diff will only contain
  968:                the raw PKs of any ``ForeignKey`` fields.
  969:                If ``True``, the diff will contain the actual related model objects
  970:                instead of just the PKs; deleted related objects will be instances of
  971:                ``DeletedObject``.
  972:                Note that passing ``True`` will necessarily query the database if the
  973:                related objects have not been prefetched (using e.g.
  974:                ``select_related()``).
  975:         """
  976:         if not isinstance(old_history, type(self)):
  977:             raise TypeError(
  978:                 "unsupported type(s) for diffing:"
  979:                 f" '{type(self)}' and '{type(old_history)}'"
  980:             )
  981: 

INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.519s
INFO: Final Memory: 6M/295M
INFO: ------------------------------------------------------------------------