File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,15 @@ Early Binding Functions
80
80
+++++++++++++++++++++++
81
81
82
82
Early binding functions use the ``@early `` decorator. They are evaluated at *build time *, hence the
83
- 'early' in 'early binding'. Any package attribute can be implemented as an early binding function.
83
+ 'early' in 'early binding'. By build time, we mean that they are evaluated before the resolve has happened and before
84
+ the :ref: `build environment <the-build-environment >` is constructed. Therefore it's important to note a few important
85
+ behaviors of early bound functions:
84
86
85
- Here is an example of an :attr: `authors ` attribute that is automatically set to the contributors of the
86
- package's git project:
87
+ - The :attr: `this ` object only exposes package attributes and nothing else when used inside an early bound function.
88
+ - No Rez-set :ref: `environment variables <environment-variables >` can be accessed inside an early bound function.
89
+
90
+ Any package attribute can be implemented as an early binding function. Here is an example of an :attr: `authors `
91
+ attribute that is automatically set to the contributors of the package's git project:
87
92
88
93
.. code-block :: python
89
94
@@ -113,12 +118,6 @@ implicit :attr:`this` object:
113
118
Do not reference other early bound or late bound attributes in
114
119
your early bound function. An error will be raised if you do.
115
120
116
- .. warning ::
117
- Certain package attributes cannot be accessed inside of an early bound function such as :attr: `this.root `.
118
-
119
- Additionally, :ref: `build environment variables <build-environment-variables >` cannot be accessed inside
120
- of early bound functions.
121
-
122
121
Early binding functions are a convenience. You can always use an arbitrary function instead, like so:
123
122
124
123
.. code-block :: python
You can’t perform that action at this time.
0 commit comments