Skip to content

Commit c58b565

Browse files
committed
fix: wrong import syntax used in python examples. relates to architect/architect#1462
1 parent 9e84714 commit c58b565

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/views/docs/en/guides/developer-experience/dependency-management.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,17 @@ To share code across multiple Lambdas, please make use of `@shared` and `@views`
166166
For example, assume the following `src/http/get-index/lambda.py` handler:
167167

168168
```python
169-
# This is ok if it exists in the root requirements.txt file
169+
# This is ok if it exists in the `requirements.txt` file
170170
import arc # → architect-functions
171171

172172
# This will fail
173-
import ..foo
173+
from ..foo import bar
174174

175-
# This will work (if present, of course)
176-
import .foo
175+
# This will work (assuming `foo.py` exists in the same directory, of course)
176+
from foo import bar
177177

178-
# This is also ok (if foo exists in @shared)
179-
import vendor.shared.foo
178+
# This is also ok (if `foo.py` exists in @shared)
179+
from vendor.shared.foo import bar
180180
```
181181

182182
---

src/views/docs/en/guides/developer-experience/sharing-code.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ require_relative './vendor/views/document'
8484

8585
```python
8686
# get-index/lambda.py
87-
import vendor.shared.authenticate
88-
import vendor.views.document
87+
from vendor.shared.authenticate import foo
88+
from vendor.views.document import bar
8989
```
9090

9191
</div>
@@ -129,7 +129,7 @@ require_relative './vendor/shared/authenticate'
129129

130130
```python
131131
# post-like/lambda.py
132-
import vendor.shared.authenticate
132+
from vendor.shared.authenticate import foo
133133
```
134134

135135
</div>
@@ -190,8 +190,8 @@ require_relative './vendor/views/document'
190190

191191
```python
192192
# get-index/lambda.py
193-
import vendor.shared.authenticate
194-
import vendor.views.document
193+
from vendor.shared.authenticate import foo
194+
from vendor.views.document import bar
195195
```
196196

197197
</div>

0 commit comments

Comments
 (0)