Skip to content
This repository was archived by the owner on Jun 22, 2025. It is now read-only.

Commit 7332538

Browse files
Merge branch 'main' into custom-json-encoder-decoder
2 parents 39759bf + b88cf6e commit 7332538

File tree

44 files changed

+1374
-1031
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1374
-1031
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ Steps to reproduce the behavior:
2323
**Expected behavior**
2424
A clear and concise description of what you expected to happen.
2525

26+
**System Information**
27+
- OS: [e.g. Windows 10 x64, Linux Ubuntu, macOS 12]
28+
- Browser: [e.g. Chrome 108.0.5359.99 (Official Build) (64-bit), Safari 16, Firefox 107.0.1]
29+
- Python Distribution: [e.g. Python.org 3.9, Anaconda3 2021.11 3.9, ActivePython 3.9]
30+
2631
**Screenshots**
2732
If applicable, add screenshots to help explain your problem.
2833

29-
**Desktop (please complete the following information):**
30-
- OS: [e.g. iOS]
31-
- Browser [e.g. chrome, safari]
32-
- Version [e.g. 22]
33-
3434
**Additional context**
3535
Add any other context about the problem here.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [master]
9+
schedule:
10+
- cron: '0 11 * * 0'
11+
12+
jobs:
13+
analyse:
14+
name: Analyse
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
with:
21+
# We must fetch at least the immediate parents so that if this is
22+
# a pull request then we can checkout the head.
23+
fetch-depth: 2
24+
25+
# If this run was triggered by a pull request event, then checkout
26+
# the head of the pull request instead of the merge commit.
27+
- run: git checkout HEAD^2
28+
if: ${{ github.event_name == 'pull_request' }}
29+
30+
# Initializes the CodeQL tools for scanning.
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v1
33+
# Override language selection by uncommenting this and choosing your languages
34+
with:
35+
languages: javascript, python
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@v1

.github/workflows/test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test Eel
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ${{ matrix.os }}
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-20.04, windows-latest, macos-latest]
16+
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
- name: Setup python
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Setup test execution environment.
26+
run: pip3 install -r requirements-meta.txt
27+
- name: Run tox tests
28+
run: tox -- --durations=0 --timeout=30
29+
30+
typecheck:
31+
runs-on: windows-latest
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v2
36+
- name: Setup python
37+
uses: actions/setup-python@v2
38+
with:
39+
python-version: "3.10"
40+
- name: Setup test execution environment.
41+
run: pip3 install -r requirements-meta.txt
42+
- name: Run tox tests
43+
run: tox -e typecheck

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
__pycache__
22
dist
33
build
4+
Drivers
45
Eel.egg-info
56
.tmp
67
.DS_Store
78
*.pyc
89
*.swp
910
venv/
11+
.tox

.python-version

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
3.6.15
2+
3.7.14
3+
3.8.14
4+
3.9.13
5+
3.10.8

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Change log
22

3+
### v0.15.3
4+
* Comprehensive type hints implement by @thatfloflo in https://github.com/python-eel/Eel/pull/577.
5+
6+
### v0.15.2
7+
* Adds `register_eel_routes` to handle applying Eel routes to non-Bottle custom app instances.
8+
9+
### v0.15.1
10+
* Bump bottle dependency from 0.12.13 to 0.12.20 to address the critical CVE-2022-31799 and moderate CVE-2020-28473.
11+
12+
### v0.15.0
13+
* Add `shutdown_delay` as a `start()` function parameter ([#529](https://github.com/python-eel/Eel/pull/529))
14+
15+
### v0.14.0
16+
* Change JS function name parsing to use PyParsing rather than regex, courtesy @KyleKing.
17+
18+
### v0.13.2
19+
* Add `default_path` start arg to define a default file to retrieve when hitting the root URL.
20+
321
### v0.13.1
422
* Shut down the Eel server less aggressively when websockets get closed (#337)
523

README-developers.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Eel Developers
2+
3+
## Setting up your environment
4+
5+
In order to start developing with Eel you'll need to checkout the code, set up a development and testing environment, and check that everything is in order.
6+
7+
### Clone the repository
8+
```bash
9+
git clone [email protected]:python-eel/Eel.git
10+
```
11+
12+
### (Recommended) Create a virtual environment
13+
It's recommended that you use virtual environments for this project. Your process for setting up a virutal environment will vary depending on OS and tool of choice, but might look something like this:
14+
15+
```bash
16+
python3 -m venv venv
17+
source venv/bin/activate
18+
```
19+
20+
**Note**: `venv` is listed in the `.gitignore` file so it's the recommended virtual environment name
21+
22+
23+
### Install project requirements
24+
25+
```bash
26+
pip3 install -r requirements.txt # eel's 'prod' requirements
27+
pip3 install -r requirements-test.txt # pytest and selenium
28+
pip3 install -r requirements-meta.txt # tox
29+
```
30+
31+
### (Recommended) Run Automated Tests
32+
Tox is configured to run tests against each major version we support (3.6+). In order to run Tox as configured, you will need to install multiple versions of Python. See the pinned minor versions in `.python-version` for recommendations.
33+
34+
#### Tox Setup
35+
Our Tox configuration requires [Chrome](https://www.google.com/chrome) and [ChromeDriver](https://chromedriver.chromium.org/home). See each of those respective project pages for more information on setting each up.
36+
37+
**Note**: Pay attention to the version of Chrome that is installed on your OS because you need to select the compatible ChromeDriver version.
38+
39+
#### Running Tests
40+
41+
To test Eel against a specific version of Python you have installed, e.g. Python 3.6 in this case, run:
42+
43+
```bash
44+
tox -e py36
45+
```
46+
47+
To test Eel against all supported versions, run the following:
48+
49+
```bash
50+
tox
51+
```

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ As of Eel v0.12.0, the following options are available to `start()`:
116116
- **position**, a tuple of ints specifying the (left, top) of the main window in pixels *Default: `None`*
117117
- **geometry**, a dictionary specifying the size and position for all windows. The keys should be the relative path of the page, and the values should be a dictionary of the form `{'size': (200, 100), 'position': (300, 50)}`. *Default: {}*
118118
- **close_callback**, a lambda or function that is called when a websocket to a window closes (i.e. when the user closes the window). It should take two arguments; a string which is the relative path of the page that just closed, and a list of other websockets that are still open. *Default: `None`*
119-
- **app**, an instance of Bottle which will be used rather than creating a fresh one. This can be used to install middleware on the
120-
instance before starting eel, e.g. for session management, authentication, etc.
119+
- **app**, an instance of Bottle which will be used rather than creating a fresh one. This can be used to install middleware on the instance before starting eel, e.g. for session management, authentication, etc. If your `app` is not a Bottle instance, you will need to call `eel.register_eel_routes(app)` on your custom app instance.
120+
- **shutdown_delay**, timer configurable for Eel's shutdown detection mechanism, whereby when any websocket closes, it waits `shutdown_delay` seconds, and then checks if there are now any websocket connections. If not, then Eel closes. In case the user has closed the browser and wants to exit the program. By default, the value of **shutdown_delay** is `1.0` second
121121

122122

123123

@@ -251,7 +251,7 @@ the JavaScript side, which defaults to 10000 milliseconds (10 seconds). This can
251251

252252
#### Callbacks
253253

254-
When you call an exposed function, you can immediately pass a callback function afterwards. This callback will automatically be called asynchrounously with the return value when the function has finished executing on the other side.
254+
When you call an exposed function, you can immediately pass a callback function afterwards. This callback will automatically be called asynchronously with the return value when the function has finished executing on the other side.
255255

256256
For example, if we have the following function defined and exposed in Javascript:
257257

@@ -288,7 +288,7 @@ n = eel.js_random()() # This immediately returns the value
288288
print('Got this from Javascript:', n)
289289
```
290290

291-
You can only perform synchronous returns after the browser window has started (after calling `eel.start()`), otherwise obviously the call with hang.
291+
You can only perform synchronous returns after the browser window has started (after calling `eel.start()`), otherwise obviously the call will hang.
292292

293293
In Javascript, the language doesn't allow us to block while we wait for a callback, except by using `await` from inside an `async` function. So the equivalent code from the Javascript side would be:
294294

0 commit comments

Comments
 (0)