@@ -427,13 +427,23 @@ custom importer to provide metadata, it would also need to implement
427
427
for dist_record in self.db.query_distributions(query):
428
428
yield DatabaseDistribution(dist_record)
429
429
430
-
431
430
In this way, ``query_distributions `` would return records for
432
431
each distribution served by the database matching the query. For
433
432
example, if ``requests-1.0 `` is in the database, ``find_distributions ``
434
433
would yield a ``DatabaseDistribution `` for ``Context(name='requests') ``
435
434
or ``Context(name=None) ``.
436
435
436
+ For the sake of simplicity, this example ignores ``context.path ``. The
437
+ ``path `` attribute defaults to ``sys.path `` and is the set of import paths to
438
+ be considered in the search. A ``DatabaseImporter `` could potentially function
439
+ without any concern for a search path. Assuming the importer does no
440
+ partitioning, the "path" would be irrelevant. In order to illustrate the
441
+ purpose of ``path ``, the example would need to illustrate a more complex
442
+ ``DatabaseImporter `` whose behavior varied depending on
443
+ ``sys.path ``/``PYTHONPATH ``. In that case, the ``find_distributions `` should
444
+ honor the ``context.path `` and only yield ``Distribution``s pertinent to that
445
+ path.
446
+
437
447
``DatabaseDistribution ``, then, would look something like::
438
448
439
449
class DatabaseDistribution(importlib.metadata.Distributon):
0 commit comments