Skip to content

Commit e9240da

Browse files
committed
Edit rezconfig docstrings for package_filter to reflect python form rather than YAML
1 parent 71f2f61 commit e9240da

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

src/rez/rezconfig.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -362,42 +362,43 @@
362362
# during a resolve, and if any filter excludes a package, that package is not
363363
# included in the resolve. Here is a simple example:
364364
#
365-
# package_filter:
366-
# excludes:
367-
# - glob(*.beta)
368-
# includes:
369-
# - glob(foo-*)
365+
# package_filter = {
366+
# 'excludes': 'glob(*.beta)',
367+
# 'includes': 'glob(foo-*)',
368+
# }
370369
#
371370
# This is an example of a single filter with one exclusion rule and one inclusion
372371
# rule. The filter will ignore all packages with versions ending in '.beta',
373372
# except for package 'foo' (which it will accept all versions of). A filter will
374-
# only exclude a package iff that package matches at least one exclusion rule,
373+
# only exclude a package if that package matches at least one exclusion rule,
375374
# and does not match any inclusion rule.
376375
#
377-
# Here is another example, which excludes all beta packages, and all packages
378-
# except 'foo' that are released after a certain date. Note that in order to
379-
# use multiple filters, you need to supply a list of dicts, rather than just a
380-
# dict:
376+
# Here is another example, which excludes all beta and dev packages, and all
377+
# packages except 'foo' that are released after a certain date. Note that in
378+
# order to use multiple filters, you need to supply a list of dicts, rather
379+
# than just a dict:
381380
#
382-
# package_filter:
383-
# - excludes:
384-
# - glob(*.beta)
385-
# - excludes:
386-
# - after(1429830188)
387-
# includes:
388-
# - foo # same as range(foo), same as glob(foo-*)
381+
# package_filter = [
382+
# {
383+
# 'excludes': ['glob(*.beta)', 'glob(*.dev)']
384+
# },
385+
# {
386+
# 'excludes': ['after(1429830188)'],
387+
# 'includes': ['foo'], # same as range(foo), same as glob(foo-*)
388+
# }
389+
# ]
389390
#
390391
# This example shows why multiple filters are supported - with only one filter,
391-
# it would not be possible to exclude all beta packages (including foo), but also
392-
# exclude all packages after a certain date, except for foo.
392+
# it would not be possible to exclude all beta and dev packages (including foo),
393+
# but also exclude all packages after a certain date, except for foo.
393394
#
394395
# Following are examples of all the possible rules:
395396
#
396397
# example | description
397398
# --------------------|----------------------------------------------------
398399
# glob(*.beta) | Matches packages matching the glob pattern.
399400
# regex(.*-\\.beta) | Matches packages matching re-style regex.
400-
# requirement(foo-5+) | Matches packages within the given requirement.
401+
# range(foo-5+) | Matches packages within the given requirement.
401402
# before(1429830188) | Matches packages released before the given date.
402403
# after(1429830188) | Matches packages released after the given date.
403404
# *.beta | Same as glob(*.beta)

0 commit comments

Comments
 (0)