6.x.x
6.0.5
Hotfix (for those who believe oc1
platform exists):
In 2022/6/29, a data migration happened for the
oc1
platform, moving all the data fromamericas
region tosea
region, it is now reflected in Pyot aswell (after almost 2 months because I forgot thatoc1
exists).
6.0.4
Improvement:
Improved documentation syntax and type hints.
6.0.3
Hotfix (rare-breaking bug):
Type error after rate limit returns non-service 429.
6.0.2
Hotfix (breaking bug):
Class
Queue
frompyot.core.queue
is not properly printing raised exceptions inside workers and causing workers to fail after an exception is raised. Now fixed.
6.0.1
Hotfix (non-breaking bug):
Changed warning action for
PyotResourceWarning
todefault
.
6.0.0
Summary:
Reworked resource management logic, fixing a scary amount of issues and bugs related to ungraceful handling of resources. Warnings and errors such as
unclosed transport ...
,unclosed <socker._socket ...
,Event loop is closed
, etc.Reworked parts of warning mechanics, warnings are now actual warnings sent using the
warnings
module instead oflogging
.Reworked major parts of
pyot.utils
modules, removing unused and over-abstracted codes.Support for
aioredis
v2.0, dropping support foraioredis
v1.3.Other general codebase improvements.
New additions:
Introduces new core resource management module with
pyot.core.resources
, intended to handle graceful acquisition and release of resources used by Pyot, the usage is recommended but optional, please refer to Cores -> Resources.New conf utils function
import_confs
for importing pyot conf files, located atpyot.conf.utils
. It's a slightly modified version ofimportlib.import_module
.New functools decorator
async_generator_property
, for decorating an async generator method to a property.Most warnings are now sent using
warnings.warn
, new modulepyot.core.warnings
contain all warning classes used by Pyot. Stores log level remains usinglogging.log
.New module
pyot.utils.aiohttp
with classSafeClientSession
, intended to fix part of the ungraceful closing of resources byaiohttp
until the release ofaiohttp>=4.0
(version where aiohttp fixes it themselves).
Breaking changes:
(To obtain the source of removed or before change codes, please search on the github commit history.)
Removed
pyot.utils.runtime
module, with the new introduced resource management rework, the intended function of the module is no longer needed. To obtain the source code for other uses, please search on the github commit history.Removed
pyot.utils.eventloop
module, replaced by the new resource management module, the old 'magic' has proven to be problematic and unreliable. The near-replacement isResourceTemplate
->EventLoopFactory
andResourceManager
remains the same name.Renamed multiple internal methods and functions to
_
prefixed as they are not intended to be used publicly, its changes will no longer be documented as they are private. Including but not limited to:PyotCore internal methods.
Stores and Limiters attributes.
Removed
.pipeline(name: str)
method andpipeline: str
arguments in request methods from PyotCore instances, it is now replaced with.using(pipeline_name: str)
method. A typical non-default-pipeline request would now look likeawait UnknownPyotCore(param1=param1).using(pipeline_name).get()
.PyotCore instances now returns
AttributeError
if.query()
or.body()
method is not implemented on its classes.Renamed
clean
method in PyotCore tovalidate
.Removed import hook
PYOT_SETTINGS
on django settings, it has been deprecated since v5, usePYOT_CONFS
instead.Removed module
pyot.utils.parsers
, for functionsto_bytes
andfrom_bytes
please usepickle.dumps
andpickle.loads
directly.safejson
is now a module onpyot.utils.safejson
providing the functionsloads
andload
.Removed module
pyot.utils.runners
, forloop_run
please useasyncio.get_event_loop().run_until_complete
, forthread_run
please useasyncio.get_event_loop().run_in_executor
(withfunctools.partial
if needed).Removed module
pyot.utils.time
, use builtin moduletimeit
instead.Renamed module
pyot.utils.locks
topyot.utils.threading
, classLock
is renamed toAsyncLock
, the intended scope of this module is now to storethreading
related utils.Renamed multiple functions in modules
pyot.utils.{model}.cdragon
to be more explicit, please review on Utils page.Renamed
import_class
inpyot.utils.importlib
toimport_variable
as it intends to import any variable in a module.Removed
swapped_dict
inpyot.utils.itertools
.Renamed
Logger
inpyot.utils.logging
toLazyLogger
.Renamed
snakecase
inpyot.utils.text
tosnake_case
.Renamed
camelcase
inpyot.utils.text
tocamel_case
.Logs formatting changed from
[Trace: ...] ...
to[pyot.{modules...}:{class}#{optional_tag}] ...
.Store instantiation, for stores that accepts
kwargs
, is now on first level as**kwargs
, e.g. now accepts"a": "b"
instead of"kwargs": {"a": "b"}
.Stores and limiters depending on
aioredis
now supportsaioredis>=2.0
, due to breaking compatibility, this version will not supportaioredis<=2.0
anymore, the class names remains the same and no extra changes required on conf.
The following breaking changes is specific to the PyotCore class val.Match
, the renamed attributes is to reserve them for the new static asset bridges (much like lol.Champion
, lol.Item
, etc.) to be released in the next versions.
Renamed
val.match.MatchInfoData.map_id
toval.match.MatchInfoData.map_url
.Renamed
val.match.MatchPlayerData.player_card
toval.match.MatchPlayerData.player_card_id
.Renamed
val.match.MatchPlayerData.player_title
toval.match.MatchPlayerData.player_title_id
.Renamed
val.match.MatchPlayerEconomyData.weapon
toval.match.MatchPlayerEconomyData.weapon_id
.Renamed
val.match.MatchPlayerEconomyData.armor
toval.match.MatchPlayerEconomyData.armor_id
.Attribute
val.match.MatchPlayerFinishingDamageData.damage_item
will remain unchanged, due to it being agnostic and inconsistent, subject to change.
Last updated