synapse/synapse/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 Improve exception handling for concurrent execution (#12109) 2022-03-01 09:34:30 +00:00
async_helpers.py Fix rare error in ReadWriteLock when writers complete immediately (#12105) 2022-03-01 15:27:15 +00:00
batching_queue.py Add types to synapse.util. (#10601) 2021-09-10 17:03:18 +01:00
check_dependencies.py Use importlib.metadata to read requirements (#12088) 2022-03-01 17:44:41 +00:00
daemonize.py Upgrade mypy to version 0.931 (#12030) 2022-02-18 15:57:26 +00:00
distributor.py Add most missing type hints to synapse.util (#11328) 2021-11-16 08:47:36 -05:00
file_consumer.py Add missing type hints to synapse.logging.context (#11556) 2021-12-14 17:35:28 +00:00
frozenutils.py Add types to synapse.util. (#10601) 2021-09-10 17:03:18 +01:00
gai_resolver.py Add most missing type hints to synapse.util (#11328) 2021-11-16 08:47:36 -05:00
hash.py Add missing type hints to synapse.util (#9982) 2021-05-24 15:32:01 -04:00
httpresourcetree.py Add missing type hints to synapse.app. (#11287) 2021-11-10 15:06:54 -05:00
iterutils.py Encode JSON responses on a thread in C, mk2 (#10905) 2021-09-28 09:37:58 +00:00
linked_list.py Eliminate a few Anys in LruCache type hints (#11453) 2021-11-30 15:39:07 +00:00
logcontext.py Improve the backwards compatibility re-exports of synapse.logging.context (#5617) 2019-07-05 02:32:02 +10:00
logformatter.py Improve the backwards compatibility re-exports of synapse.logging.context (#5617) 2019-07-05 02:32:02 +10:00
macaroons.py Add types to synapse.util. (#10601) 2021-09-10 17:03:18 +01:00
manhole.py Add missing type hints to synapse.app. (#11287) 2021-11-10 15:06:54 -05:00
metrics.py Add type annotations to synapse.metrics (#10847) 2021-11-17 19:07:02 +00:00
module_loader.py Standardise the module interface (#10062) 2021-06-18 12:15:52 +01:00
msisdn.py Add missing type hints to synapse.util (#9982) 2021-05-24 15:32:01 -04:00
patch_inline_callbacks.py Upgrade mypy to version 0.931 (#12030) 2022-02-18 15:57:26 +00:00
ratelimitutils.py Add types to synapse.util. (#10601) 2021-09-10 17:03:18 +01:00
retryutils.py Add types to synapse.util. (#10601) 2021-09-10 17:03:18 +01:00
rlimit.py Add types to synapse.util. (#10601) 2021-09-10 17:03:18 +01:00
stringutils.py Add missing type hints to synapse.replication. (#11938) 2022-02-08 11:03:08 -05:00
templates.py Use direct references for some configuration variables (#10798) 2021-09-13 13:07:12 -04:00
threepids.py Add a callback to allow modules to deny 3PID (#11854) 2022-02-08 11:20:32 +01:00
wheel_timer.py Add types to synapse.util. (#10601) 2021-09-10 17:03:18 +01:00