MatrixSynapse/tests/util
David Robertson 313581e4e9
Use importlib.metadata to read requirements (#12088)
* Pull runtime dep checks into their own module
* Reimplement `check_requirements` using `importlib`

I've tried to make this clearer. We start by working out which of
Synapse's requirements we need to be installed here and now. I was
surprised that there wasn't an easier way to see which packages were
installed by a given extra.

I've pulled out the error messages into functions that deal with "is
this for an extra or not". And I've rearranged the loop over two
different sets of requirements into one loop with a "must be instaled"
flag.

I hope you agree that this is clearer.

* Test cases
2022-03-01 17:44:41 +00:00
..
caches Fix 'Unhandled error in Deferred' (#12089) 2022-03-01 09:51:38 +00:00
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_async_helpers.py Add `stop_cancellation` utility function (#12106) 2022-03-01 13:51:03 +00:00
test_batching_queue.py Rewrite the KeyRing (#10035) 2021-06-02 16:37:59 +01:00
test_check_dependencies.py Use importlib.metadata to read requirements (#12088) 2022-03-01 17:44:41 +00:00
test_dict_cache.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_expiring_cache.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_file_consumer.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_itertools.py Use inline type hints in `tests/` (#10350) 2021-07-13 11:52:58 +01:00
test_linearizer.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_logcontext.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_logformatter.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_lrucache.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_ratelimitutils.py Use direct references for configuration variables (part 4). (#10893) 2021-09-23 12:03:01 -04:00
test_retryutils.py Remove `HomeServer.get_datastore()` (#12031) 2022-02-23 11:04:02 +00:00
test_rwlock.py Fix rare error in `ReadWriteLock` when writers complete immediately (#12105) 2022-03-01 15:27:15 +00:00
test_stream_change_cache.py Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
test_stringutils.py Change the format of access tokens away from macaroons (#5588) 2021-05-12 15:04:51 +01:00
test_threepids.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
test_treecache.py Replace assertEquals and friends with non-deprecated versions. (#12092) 2022-02-28 07:12:29 -05:00
test_wheel_timer.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00