Tags: ua-parser/uap-python
Tags
Fix memoisation of lazy parser & bump version Reported by @Rafiot: the lazy parser is not memoised, this has limited effect on the basic / pure Python parser as its initialisation is trivial, but it *significantly* impact the re2 and regex parsers as they need to process regexes into a filter tree. The memoization was mistakenly removed in #230: while refactoring initialisation I removed the setting of the `parser` global. - add a test to ensure the parser is correctly memoized, not re-instantiated every time - reinstate setting the global - add a mutex on `__getattr__`, it should only be used on first access and avoids two threads creating an expensive parser at the same time (which is a waste of CPU) Fixes #253
Slightly late update of uap-core to 0.18.0 See ua-parser/uap-core@v0.16.0...v0.18.0 for the upstream changelog Also remove 2.7 and 3.6 from the changelog as they're not accessible from setup-python anymore, we'd need to e.g. install them by hand using pyenv if we want to keep them (which might be a good idea but it's not like anyone is touching the 0.x code so changes of breakage are low anyway). - actions/setup-python#672 - actions/setup-python#544
PreviousNext