fsoubelet/AoE2NetAPIWrapper

View on GitHub
remove 3.10 for now as typed_ast STILL doesn't have binaries available #86
Felix Soubelet authored c2645822
complete00:00:32
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
No errors or warnings found in .codeclimate.yml.
3
codeclimate prepare
View output
codeclimate prepare
4
builder pull-engines
View output
determining required images
docker pull codeclimate/codeclimate-sonar-python:b10
b10: Pulling from codeclimate/codeclimate-sonar-python
709515475419: Pulling fs layer
d1c225ed7c34: Pulling fs layer
887f300163b6: Pulling fs layer
a3ed95caeb02: Pulling fs layer
9b412187b352: Pulling fs layer
8fe915fa1948: Pulling fs layer
65145a386a45: Pulling fs layer
a64dfb9c0f27: Pulling fs layer
59a464ab5a51: Pulling fs layer
47413513c002: Pulling fs layer
9f30da6d3676: Pulling fs layer
8fe915fa1948: Waiting
65145a386a45: Waiting
a64dfb9c0f27: Waiting
59a464ab5a51: Waiting
47413513c002: Waiting
9f30da6d3676: Waiting
a3ed95caeb02: Waiting
9b412187b352: Waiting
d1c225ed7c34: Verifying Checksum
d1c225ed7c34: Download complete
709515475419: Verifying Checksum
709515475419: Download complete
a3ed95caeb02: Verifying Checksum
a3ed95caeb02: Download complete
9b412187b352: Verifying Checksum
9b412187b352: Download complete
65145a386a45: Verifying Checksum
65145a386a45: Download complete
709515475419: Pull complete
887f300163b6: Verifying Checksum
887f300163b6: Download complete
d1c225ed7c34: Pull complete
59a464ab5a51: Verifying Checksum
59a464ab5a51: Download complete
8fe915fa1948: Download complete
47413513c002: Verifying Checksum
47413513c002: Download complete
a64dfb9c0f27: Verifying Checksum
a64dfb9c0f27: Download complete
9f30da6d3676: Verifying Checksum
9f30da6d3676: Download complete
887f300163b6: Pull complete
a3ed95caeb02: Pull complete
9b412187b352: Pull complete
8fe915fa1948: Pull complete
65145a386a45: Pull complete
a64dfb9c0f27: Pull complete
59a464ab5a51: Pull complete
47413513c002: Pull complete
9f30da6d3676: Pull complete
Digest: sha256:7904831e83e5474cba8a95726a691787d74d669d74a8721f114057ebb4a8943d
Status: Downloaded newer image for registry.prod.codeclimate.net/codeclimate/codeclimate-sonar-python:b10
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-05-03T07:46:42.415998 #1]  INFO -- : Skipping file ./aoe2netwrapper/models/num_online.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 16
    steam: Optional[int] = Field(None, description="Number of players from Steam")
         ^
SyntaxError: invalid syntax


I, [2024-05-03T07:46:42.430360 #1]  INFO -- : Skipping file ./aoe2netwrapper/models/lobbies.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 16
    profile_id: Optional[int] = Field(None, description="The ID attributed to the member by AoE II")
              ^
SyntaxError: invalid syntax


I, [2024-05-03T07:46:42.469944 #1]  INFO -- : Skipping file ./aoe2netwrapper/models/last_match.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 18
    profile_id: Optional[int] = Field(None, description="The ID attributed to the player by AoE II")
              ^
SyntaxError: invalid syntax


I, [2024-05-03T07:46:42.480656 #1]  INFO -- : Skipping file ./aoe2netwrapper/models/strings.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 19
    id: Optional[int] = Field(None, description="ID for this specific string value")
      ^
SyntaxError: invalid syntax


I, [2024-05-03T07:46:42.493389 #1]  INFO -- : Skipping file ./aoe2netwrapper/models/leaderboard.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 16
    profile_id: Optional[int] = Field(None, description="The ID attributed to the player by AoE II")
              ^
SyntaxError: invalid syntax


I, [2024-05-03T07:46:42.525538 #1]  INFO -- : Skipping file ./aoe2netwrapper/models/rating_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 16
    rating: Optional[int] = Field(None, description="The player's rating in the ELO system")
          ^
SyntaxError: invalid syntax


I, [2024-05-03T07:46:42.542278 #1]  INFO -- : Skipping file ./aoe2netwrapper/api.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
    API_BASE_URL: str = "https://aoe2.net/api"
                ^
SyntaxError: invalid syntax


I, [2024-05-03T07:46:42.562172 #1]  INFO -- : Skipping file ./aoe2netwrapper/converters.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 30
    ) from error
         ^
SyntaxError: invalid syntax


I, [2024-05-03T07:46:42.593691 #1]  INFO -- : Skipping file ./aoe2netwrapper/nightbot.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 23
    NIGHTBOT_BASE_URL: str = "https://aoe2.net/api/nightbot"
                     ^
SyntaxError: invalid syntax
7
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/docs/assets/attribute_autocompletion.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/assets/parameter_autocompletion.png' at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: 27 files indexed
ERROR: Unable to parse file: /code/aoe2netwrapper/models/num_online.py
ERROR: Parse error at line 16 column 9:

    1: """
    2: aoe2netwrapper.models.num_online
    3: --------------------------------
    4: 
    5: This module contains the model objects to encapsulate the responses from the endpoint at
    6: https://aoe2.net/api/stats/players
    7: """
    8: from typing import List, Optional
    9: 
   10: from pydantic import BaseModel, Field
   11: 
   12: 
   13: class NumPlayers(BaseModel):
   14:     """A model to encapsulate the metrics from the num_online API."""
   15: 
  -->      steam: Optional[int] = Field(None, description="Number of players from Steam")
   17:     multiplayer: Optional[int] = Field(None, description="Number of people playing multiplayer")

ERROR: Unable to parse file: /code/aoe2netwrapper/models/lobbies.py
ERROR: Parse error at line 16 column 14:

    1: """
    2: aoe2netwrapper.models.lobbies
    3: -----------------------------
    4: 
    5: This module contains the model objects to encapsulate the responses from the endpoint at
    6: https://aoe2.net/api/lobbies
    7: """
    8: from typing import Any, List, Optional
    9: 
   10: from pydantic import BaseModel, Field
   11: 
   12: 
   13: class LobbyMember(BaseModel):
   14:     """An object to encapsulate any entry in the leaderboard ranking."""
   15: 
  -->      profile_id: Optional[int] = Field(None, description="The ID attributed to the member by AoE II")
   17:     steam_id: Optional[int] = Field(None, description="ID of the member on the Steam platform")

ERROR: Unable to parse file: /code/aoe2netwrapper/models/last_match.py
ERROR: Parse error at line 18 column 14:

    8: import Optional
    9: 
   10: from pydantic import BaseModel, Field
   11: 
   12: from aoe2netwrapper.models.lobbies import MatchLobby
   13: 
   14: 
   15: class LastMatchResponse(BaseModel):
   16:     """An object to encapsulate the response from the last_match API."""
   17: 
  -->      profile_id: Optional[int] = Field(None, description="The ID attributed to the player by AoE II")
   19:     steam_id: Optional[int] = Field(None, description="ID of the player on the Steam platform")

ERROR: Unable to parse file: /code/aoe2netwrapper/models/strings.py
ERROR: Parse error at line 19 column 6:

    1: """
    2: aoe2netwrapper.models.strings
    3: -----------------------------
    4: 
    5: This module contains the model objects to encapsulate the responses from the endpoint at
    6: https://aoe2.net/api/strings
    7: 
    8: Any confusing with a specific attribute being an INTEGER in the models can be cleared by checking the
    9: corresponding string the API / system attributes to this ID.
   10: """
   11: from typing import List, Optional
   12: 
   13: from pydantic import BaseModel, Field
   14: 
   15: 
   16: class AgeString(BaseModel):
   17:     """An object to encapsulate any entry for the available age strings and their respective IDs."""
   18: 
  -->      id: Optional[int] = Field(None, description="ID for this specific string value")
   20:     string: Optional[str] = Field(None, description="String value for this specific 'age' ID")

ERROR: Unable to parse file: /code/aoe2netwrapper/models/leaderboard.py
ERROR: Parse error at line 16 column 14:

    1: """
    2: aoe2netwrapper.models.leaderboard
    3: ---------------------------------
    4: 
    5: This module contains the model objects to encapsulate the responses from the endpoint at
    6: https://aoe2.net/api/leaderboard
    7: """
    8: from typing import Any, List, Optional
    9: 
   10: from pydantic import BaseModel, Field
   11: 
   12: 
   13: class LeaderBoardSpot(BaseModel):
   14:     """An object to encapsulate any entry in the leaderboard ranking."""
   15: 
  -->      profile_id: Optional[int] = Field(None, description="The ID attributed to the player by AoE II")
   17:     rank: Optional[int] = Field(None, description="The player's rank on the ladder")

ERROR: Unable to parse file: /code/aoe2netwrapper/models/rating_history.py
ERROR: Parse error at line 16 column 10:

    1: """
    2: aoe2netwrapper.models.rating_history
    3: ------------------------------------
    4: 
    5: This module contains the model objects to encapsulate the responses from the endpoint at
    6: https://aoe2.net/api/player/ratinghistory
    7: """
    8: from typing import Optional
    9: 
   10: from pydantic import BaseModel, Field
   11: 
   12: 
   13: class RatingTimePoint(BaseModel):
   14:     """An object to encapsulate any entry in the list of returned ranking timestamped data points."""
   15: 
  -->      rating: Optional[int] = Field(None, description="The player's rating in the ELO system")
   17:     num_wins: Optional[int] = Field(None, description="Total amount of wins")

ERROR: Unable to parse file: /code/aoe2netwrapper/api.py
ERROR: Parse error at line 33 column 16:

   15: Aoe2NetException
   16: from aoe2netwrapper.models import (
   17:     LastMatchResponse,
   18:     LeaderBoardResponse,
   19:     MatchLobby,
   20:     NumOnlineResponse,
   21:     RatingTimePoint,
   22:     StringsResponse,
   23: )
   24: 
   25: 
   26: class AoE2NetAPI:
   27:     """
   28:     The 'AoE2NetAPI' class is a client that encompasses the https://aoe2.net/#api API endpoints.
   29:     Each method in this class corresponds name for name to an endpoint, and will do the work in querying then
   30:     parsing and validating the response before returning it.
   31:     """
   32: 
  -->      API_BASE_URL: str = "https://aoe2.net/api"
   34:     STRINGS_ENDPOINT: str = API_BASE_URL + "/strings"
   35:     LEADERBOARD_ENDPOINT: str = API_BASE_URL + "/leaderboard"
   36:     LOBBIES_ENDPOINT: str = API_BASE_URL + "/lobbies"
   37:     LAST_MATCH_ENDPOINT

ERROR: Unable to parse file: /code/aoe2netwrapper/nightbot.py
ERROR: Parse error at line 23 column 21:

    8: , Dict, Tuple, Union
    9: 
   10: import requests
   11: 
   12: from loguru import logger
   13: 
   14: from aoe2netwrapper.exceptions import NightBotException
   15: 
   16: 
   17: class AoE2NightbotAPI:
   18:     """
   19:     The 'AoE2NightbotAPI' class is a client that encompasses the https://aoe2.net/#nightbot API endpoints,
   20:     which only return their requested data as plain text.
   21:     """
   22: 
  -->      NIGHTBOT_BASE_URL: str = "https://aoe2.net/api/nightbot"
   24:     RANK_DETAILS_ENDPOINT = NIGHTBOT_BASE_URL + "/rank"
   25:     RECENT_OPPONENT_ENDPOINT = NIGHTBOT_BASE_URL + "/opponent"
   26:     CURRENT_MATCH_ENDPOINT = NIGHTBOT_BASE_URL + "/match"
   27:     CURRENT_CIVS_ENDPOINT = NIGHTBOT_BASE_URL + "/civs"
   28:     CURRENT_MAP_ENDPOINT

INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.747s
INFO: Final Memory: 6M/292M
INFO: ------------------------------------------------------------------------