Skip to content

Commit

Permalink
Fix build with Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jan 4, 2024
1 parent c84f770 commit fc61a8c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
Requires Node.js (`node`), Python (`python3`), and Java (`java`). It is known to work in these environments but should work in others:

- Windows 10, Python 3.11.7 (Microsoft Store), Node.js 20.10.0 (nodejs.org installer), Java 11 (Temurin-11.0.21+9)

Python 3.12 currently does not work.
- Windows 10, Python 3.12.1 (Microsoft Store), Node.js 20.10.0 (nodejs.org installer), Java 11 (Temurin-11.0.21+9)

Install dependencies:

```sh
npm ci
```

The playground to use for local testing is tests/vertical_playground.html.
Open tests/vertical_playground.html in a browser for local testing. You don't need to rebuild compressed versions for most changes.

To build, run:
To re-build compressed versions, run:

```sh
npm run prepublish
Expand Down
30 changes: 20 additions & 10 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,13 +636,23 @@ def exclude_horizontal(item):
# Run all tasks in parallel threads.
# Uncompressed is limited by processor speed.
# Compressed is limited by network and server speed.
# Vertical:
Gen_uncompressed(search_paths_vertical, True, closure_env).start()
# Horizontal:
Gen_uncompressed(search_paths_horizontal, False, closure_env).start()

# Compressed forms of vertical and horizontal.
Gen_compressed(search_paths_vertical, search_paths_horizontal, closure_env).start()

# This is run locally in a separate thread.
# Gen_langfiles().start()
threads = [
# Vertical:
Gen_uncompressed(search_paths_vertical, True, closure_env),
# Horizontal:
Gen_uncompressed(search_paths_horizontal, False, closure_env),
# Compressed forms of vertical and horizontal.
Gen_compressed(search_paths_vertical, search_paths_horizontal, closure_env),

# This is run locally in a separate thread.
# Gen_langfiles()
]

for thread in threads:
thread.start()

# Need to wait for all threads to finish before the main process ends as in Python 3.12,
# once the main interpreter is being shutdown, trying to spawn more child threads will
# raise "RuntimeError: can't create new thread at interpreter shutdown"
for thread in threads:
thread.join()

0 comments on commit fc61a8c

Please sign in to comment.