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

Commit e6db3f0

Browse files
Merge pull request #332 from samuelhwilliams/tests
Prepare for testing
2 parents 6f2fb7f + 0632300 commit e6db3f0

File tree

14 files changed

+262
-4
lines changed

14 files changed

+262
-4
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
matrix:
14+
os: [ubuntu-20.04, windows-latest, macos-latest]
15+
python-version: [3.6, 3.7, 3.8]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
- name: Setup python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Setup test execution environment.
25+
run: pip3 install -r requirements-meta.txt
26+
- name: Run tox tests
27+
run: tox -- --durations=0 --timeout=30

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Eel.egg-info
77
*.pyc
88
*.swp
99
venv/
10+
.tox

.python-version

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
3.6.10
2+
3.7.7
3+
3.8.3

README-developers.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Eel Developers
2+
3+
## Setting up a development 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]:samuelhwilliams/Eel.git
10+
```
11+
12+
Create a dev virtual environment. Your process for doing this may vary, but might look something like this (assuming you have `venv` in a global `.gitignore` file):
13+
14+
```bash
15+
python3 -m venv venv
16+
./venv/bin/activate
17+
```
18+
19+
We support Python 3.6+ so developers should ideally run their tests against the latest minor version of each major version we support from there. Tox is configured to run tests against each major version we support. In order to run tox fully, you will need to install multiple versions of Python. See the pinned minor versions in `.python-version`.
20+
21+
## Running tests
22+
23+
To test Eel against a specific version of Python you have installed, e.g. Python 3.6 in this case, run:
24+
25+
```bash
26+
tox -e py36
27+
```
28+
29+
To test Eel against all supported versions, run the following:
30+
31+
```bash
32+
tox
33+
```

examples/01 - hello_world/hello.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ def say_hello_py(x):
1010
say_hello_py('Python World!')
1111
eel.say_hello_js('Python World!') # Call a Javascript function
1212

13-
eel.start('hello.html', size=(300, 200)) # Start
13+
eel.start('hello.html', size=(300, 200)) # Start

examples/02 - callbacks/web/callbacks.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
44
<title>Callbacks Demo</title>
@@ -51,4 +51,4 @@
5151
<body>
5252
Callbacks demo
5353
</body>
54-
</html>
54+
</html>

examples/06 - jinja_templates/hello.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
import random
2+
13
import eel
24

35
eel.init('web') # Give folder containing web files
46

7+
@eel.expose
8+
def py_random():
9+
return random.random()
10+
511
@eel.expose # Expose this function to Javascript
612
def say_hello_py(x):
713
print('Hello from %s' % x)

requirements-meta.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tox>=3.15.2
2+
tox-pyenv==1.1.0
3+
tox-gh-actions==1.3.0
4+
virtualenv>=16.7.10

requirements-test.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.[jinja2]
2+
3+
psutil==5.7.0
4+
pytest==5.4.3
5+
pytest-timeout==1.4.1
6+
selenium==3.141.0

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ bottle-websocket==0.2.9
33
gevent==1.3.6
44
gevent-websocket==0.10.1
55
greenlet==0.4.15
6-
pkg-resources==0.0.0
76
whichcraft==0.4.1

0 commit comments

Comments
 (0)