Skip to content

Commit bc7920f

Browse files
spelling
1 parent c1ab99e commit bc7920f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hugosite/content/posts/compile_python_pycache_on_upsun.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ date = 2024-08-07T12:00:00+02:00
44
draft = false
55
+++
66

7-
When the python interpretor executes python files, it compiles them to bytecode and saves it as files in a directory called `__pycache__` in the same directory as the code itself. You might have seen such files, here's an example from a Django project:
7+
When the python interpreter executes python files, it compiles them to bytecode and saves it as files in a directory called `__pycache__` in the same directory as the code itself. You might have seen such files, here's an example from a Django project:
88

99
```bash
1010
$ ls -1 __pycache__/
@@ -18,7 +18,7 @@ views.cpython-311.pyc
1818

1919
This saves time by allowing the compile step to be skipped in subsequent executions.
2020

21-
On Upsun, python code is deployed onto a read-only file system. The python interpretor won't be able to save the compiled bytecode onto that file system, and it would need to compile the python code every execution. This is wasteful.
21+
On Upsun, python code is deployed onto a read-only file system. The python interpreter won't be able to save the compiled bytecode onto that file system, and it would need to compile the python code every execution. This is wasteful.
2222

2323
You have two options for how to get the bytecode into place to gain the efficiency needed for production.
2424

@@ -36,7 +36,7 @@ __pycache__/
3636
*$py.class
3737
```
3838

39-
To have Upsun compile the pytyon code in the build hook, your build hook should look something like this in `.upsun/config.yaml`:
39+
To have Upsun compile the python code in the build hook, your build hook should look something like this in `.upsun/config.yaml`:
4040

4141
```yaml
4242
hooks:

0 commit comments

Comments
 (0)