Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #69 from Nicolas-Klatzer/bugfix-68
Browse files Browse the repository at this point in the history
[#68] Bugfix for asyncio.create_task bug in Python 3.7 and new release 0.1.3.1
  • Loading branch information
Luna-Klatzer committed Apr 9, 2021
2 parents 40ecdbf + 4271f2f commit 472e627
Show file tree
Hide file tree
Showing 29 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at space.frostbyte@gmail.com. All
reported by contacting the project team at nicolas.klatzer@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Frostbyte Development Team
Copyright (c) 2020 - 2021 Nicolas Klatzer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
global-include requirements.txt
include openhivenpy/*.env
exclude doc-examples
global-exclude *__pycache__*/
graft openhivenpy
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# ![OpenHiven.py](https://images.nxybi.me/da4e88d64f12.png) <br> OpenHiven.py
## The OpenSource Python API Wrapper for Hiven!

[![Package Version](https://img.shields.io/badge/package%20version-v0.1.3.dev2-purple?logo=python)](https://github.com/FrostbyteSpace/openhiven.py)
[![Package Version](https://img.shields.io/badge/package%20version-v0.1.3.1-purple?logo=python)](https://github.com/Nicolas-Klatzer/openhiven.py)
[![Python Version](https://img.shields.io/badge/python->=3.7-blue?logo=python)](https://python.org)
![Build](https://img.shields.io/github/workflow/status/FrostbyteSpace/openhiven.py/CodeQL?logo=github)
[![Latest Commit](https://img.shields.io/github/last-commit/FrostbyteSpace/openhiven.py?logo=github&color=violet)](https://github.com/FrostbyteSpace/openhiven.py/commits/mainy)
![Lines of Code](https://img.shields.io/tokei/lines/github/FrostbyteSpace/openhiven.py)
[![License](https://img.shields.io/github/license/FrostbyteSpace/openhiven.py)](https://github.com/FrostbyteSpace/openhiven.py/blob/main/LICENSE)
![Build](https://img.shields.io/github/workflow/status/Nicolas-Klatzer/openhiven.py/CodeQL?logo=github)
[![Latest Commit](https://img.shields.io/github/last-commit/Nicolas-Klatzer/openhiven.py?logo=github&color=violet)](https://github.com/Nicolas-Klatzer/openhiven.py/commits/mainy)
![Lines of Code](https://img.shields.io/tokei/lines/github/Nicolas-Klatzer/openhiven.py)
[![License](https://img.shields.io/github/license/Nicolas-Klatzer/openhiven.py)](https://github.com/Nicolas-Klatzer/openhiven.py/blob/main/LICENSE)
[![Documentation Status](https://readthedocs.org/projects/openhivenpy/badge/?version=latest)](https://readthedocs.org/projects/openhivenpy/)

## Dependencies

[![aiohttp](https://img.shields.io/github/pipenv/locked/dependency-version/FrostbyteSpace/openhiven.py/aiohttp/main)](https://docs.aiohttp.org/en/stable/)
[![asyncio](https://img.shields.io/github/pipenv/locked/dependency-version/FrostbyteSpace/openhiven.py/asyncio/main)](https://docs.python.org/3/library/asyncio.html)
[![typing](https://img.shields.io/github/pipenv/locked/dependency-version/FrostbyteSpace/openhiven.py/typing/main)](https://docs.python.org/3/library/typing.html)
[![aiohttp](https://img.shields.io/github/pipenv/locked/dependency-version/Nicolas-Klatzer/openhiven.py/aiohttp/main)](https://docs.aiohttp.org/en/stable/)
[![asyncio](https://img.shields.io/github/pipenv/locked/dependency-version/Nicolas-Klatzer/openhiven.py/asyncio/main)](https://docs.python.org/3/library/asyncio.html)
[![typing](https://img.shields.io/github/pipenv/locked/dependency-version/Nicolas-Klatzer/openhiven.py/typing/main)](https://docs.python.org/3/library/typing.html)

## Installation
### Install (PyPi Release)
Expand All @@ -30,13 +30,13 @@ python3 -m pip install -U openhivenpy==version

### Install (Github Build)
```bash
python3 -m pip install -U https://github.com/FrostbyteSpace/openhiven.py/archive/main.zip
python3 -m pip install -U https://github.com/Nicolas-Klatzer/openhiven.py/archive/main.zip
```

## Documentation
For full documentation visit the documentation our readthedocs-page
[here](https://openhivenpy.readthedocs.io/en/latest/) or go to the github pages build
[here](https://frostbytespace.github.io/docs_openhiven.py/build/)
[here](https://nicolas-klatzer.github.io/docs_openhiven.py/build/)


### Usage Example
Expand Down
6 changes: 3 additions & 3 deletions openhivenpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Under MIT License
Copyright © 2020 Frostbyte Development Team
Copyright © 2020 - 2021 Nicolas Klatzer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -31,8 +31,8 @@
__title__ = "openhiven.py"
__author__ = "Nicolas Klatzer"
__license__ = "MIT"
__version__ = "0.1.3.dev2"
__copyright__ = "FrostbyteSpace"
__version__ = "0.1.3.1"
__copyright__ = "Nicolas Klatzer"

import logging

Expand Down
2 changes: 1 addition & 1 deletion openhivenpy/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Under MIT License
Copyright © 2020 Frostbyte Development Team
Copyright © 2020 - 2021 Nicolas Klatzer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion openhivenpy/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Under MIT License
Copyright © 2020 Frostbyte Development Team
Copyright © 2020 - 2021 Nicolas Klatzer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion openhivenpy/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Under MIT License
Copyright © 2020 Frostbyte Development Team
Copyright © 2020 - 2021 Nicolas Klatzer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion openhivenpy/gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Under MIT License
Copyright © 2020 Frostbyte Development Team
Copyright © 2020 - 2021 Nicolas Klatzer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions openhivenpy/gateway/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async def startup():
# Fetching the startup_task from the object that stores them
async_task = getattr(self._startup_tasks_handler, task_name)
# Creating a callable task and appending it to the methods to call
_tasks.append(asyncio.create_task(async_task(), name=task_name))
_tasks.append(asyncio.create_task(async_task()))

# Passing all tasks as args to the event loop
await asyncio.gather(*_tasks)
Expand Down Expand Up @@ -155,7 +155,7 @@ async def __background_loop():
# Fetching the startup_task from the object that stores them
async_task = getattr(self._background_tasks_handler, task_name)
# Creating a callable task
_tasks.append(asyncio.create_task(async_task(), name=task_name))
_tasks.append(asyncio.create_task(async_task()))

# Passing all tasks as args to the event loop
await asyncio.gather(*_tasks)
Expand Down
2 changes: 1 addition & 1 deletion openhivenpy/gateway/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ async def ws_connection():
return

# Creating a task that wraps the coroutine
self._connection_task = asyncio.create_task(ws_connection(), name="openhivenpy-ws-connection")
self._connection_task = asyncio.create_task(ws_connection())

# Running the task in the background
try:
Expand Down
2 changes: 1 addition & 1 deletion openhivenpy/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Under MIT License
Copyright © 2020 Frostbyte Development Team
Copyright © 2020 - 2021 Nicolas Klatzer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions openhivenpy/types/attatchment.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ async def from_dict(cls, data: dict, http, **kwargs):

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
# Adding the http attribute for API interaction
instance._http = http
Expand Down
4 changes: 2 additions & 2 deletions openhivenpy/types/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ async def from_dict(cls, data: dict, http, **kwargs):

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
# Adding the http attribute for API interaction
instance._http = http
Expand Down
4 changes: 2 additions & 2 deletions openhivenpy/types/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ async def from_dict(cls, data: dict, http, **kwargs):

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
# Adding the http attribute for API interaction
instance._http = http
Expand Down
6 changes: 3 additions & 3 deletions openhivenpy/types/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EntitySchema(Schema):
id = fields.Int(required=True)
name = fields.Str(required=True)
type = fields.Int(required=True)
resource_pointers = fields.List(fields.Field(), required=True)
resource_pointers = fields.List(fields.Field(), allow_none=True, required=True)
house_id = fields.Str(default=None)
position = fields.Int(default=0)

Expand Down Expand Up @@ -81,14 +81,14 @@ async def from_dict(cls, data: dict, http, house, **kwargs):

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
# Adding the http attribute for API interaction
instance._http = http
Expand Down
8 changes: 4 additions & 4 deletions openhivenpy/types/house.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ async def from_dict(cls, data: dict, http, rooms: typing.List[room.Room], **kwar

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
# Adding the http attribute for API interaction
instance._http = http
Expand Down Expand Up @@ -231,14 +231,14 @@ async def from_dict(cls, data: dict, http, rooms: typing.List[room.Room], **kwar

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
# Adding the http attribute for API interaction
instance._http = http
Expand Down
4 changes: 2 additions & 2 deletions openhivenpy/types/invite.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ async def from_dict(cls,

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
# Adding the http attribute for API interaction
instance._http = http
Expand Down
4 changes: 2 additions & 2 deletions openhivenpy/types/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ async def from_dict(cls,

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
# Adding the http attribute for API interaction
instance._http = http
Expand Down
4 changes: 2 additions & 2 deletions openhivenpy/types/mention.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ async def from_dict(cls,

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
return instance

Expand Down
8 changes: 4 additions & 4 deletions openhivenpy/types/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ async def from_dict(cls, data: dict, **kwargs):

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
return instance

Expand Down Expand Up @@ -235,14 +235,14 @@ async def from_dict(cls,

except ValidationError as e:
utils.log_validation_traceback(cls, e)
raise errs.InvalidPassedDataError(data=data)
raise errs.InvalidPassedDataError(f"Failed to perform validation in '{cls.__name__}'", data=data) from e

except Exception as e:
utils.log_traceback(msg=f"Traceback in '{cls.__name__}' Validation:",
suffix=f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
raise errs.InitializationError(f"Failed to initialise {cls.__name__} due to exception:\n"
f"{sys.exc_info()[0].__name__}: {e}!")
f"{sys.exc_info()[0].__name__}: {e}!") from e
else:
# Adding the http attribute for API interaction
instance._http = http
Expand Down
Loading

0 comments on commit 472e627

Please sign in to comment.