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
Release 0.15.1 - removed version bound from `setup_requires`, allows building from source when only PyYaml 6.0 is available (and downloading 5.4 is not), #121, #125 - added type assertion to parser lookup, to make the error clearer on type error, #122, #123 - fixed `setup.py build_regexes` and `setup.py build` for non-in-place builds, #127
Deprecate js override bits They were a feature for testing whose need was removed in 2015 (ua-parser/uap-core#58). They are *entirely* unnecessary, it is possible a user somewhere is leveraging them for some reason. So remove the override bits from the docstrings, and have them trigger a `DeprecationWarning`. Also: - add tests that they do trigger - remove support for them from the yaml testing functions - update the pytest invocations to raise on all warnings - while at it remove the apparently dead makePGTSComparisonYAML test utility method (?) - and add pypy to the envlist Note: `simplefilter` has to be updated to `"always"` for 2.7's dumb ass: the new tests triggers the same warning multiple times and of course `"default"` only yields them once. Closes #119
PreviousNext