Skip to content

Commit 1973c99

Browse files
committed
chore(python): Add Python 3.14 builds
Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev>
1 parent ea626db commit 1973c99

File tree

7 files changed

+25
-55
lines changed

7 files changed

+25
-55
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ jobs:
7070
cache-dependency-path: "**/requirements-*.txt"
7171

7272
- name: Start background server
73-
run: |
74-
python -m pip install -r ./css-inline/tests/requirements-test.txt
75-
# Starts the server in background
76-
python ./css-inline/tests/server.py &
73+
run: python ./css-inline/tests/server.py &
7774
shell: bash
7875

7976
- uses: dtolnay/rust-toolchain@stable
@@ -317,10 +314,7 @@ jobs:
317314
cache-dependency-path: "**/requirements-*.txt"
318315

319316
- name: Start background server
320-
run: |
321-
python -m pip install -r ./css-inline/tests/requirements-test.txt
322-
# Starts the server in background
323-
python ./css-inline/tests/server.py &
317+
run: python ./css-inline/tests/server.py &
324318
shell: bash
325319

326320
- name: Install Rust
@@ -500,7 +494,8 @@ jobs:
500494
fail-fast: false
501495
matrix:
502496
os: [ubuntu-22.04, macos-15, windows-2022]
503-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.11"]
497+
python-version:
498+
["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy-3.11"]
504499
exclude:
505500
- os: macos-15
506501
python-version: "3.9"
@@ -526,10 +521,7 @@ jobs:
526521
cache-dependency-path: "**/requirements-*.txt"
527522

528523
- name: Start background server
529-
run: |
530-
python -m pip install -r ./css-inline/tests/requirements-test.txt
531-
# Starts the server in background
532-
python ./css-inline/tests/server.py &
524+
run: python ./css-inline/tests/server.py &
533525
shell: bash
534526

535527
- run: python -m pip install -r requirements/dev.txt
@@ -669,10 +661,7 @@ jobs:
669661
cache-dependency-path: "**/requirements-*.txt"
670662

671663
- name: Start background server
672-
run: |
673-
python -m pip install -r ./css-inline/tests/requirements-test.txt
674-
# Starts the server in background
675-
python ./css-inline/tests/server.py &
664+
run: python ./css-inline/tests/server.py &
676665
shell: bash
677666

678667
- run: bundle exec rake test
@@ -865,10 +854,7 @@ jobs:
865854
cache-dependency-path: "**/requirements-*.txt"
866855

867856
- name: Start background server
868-
run: |
869-
python -m pip install -r ./css-inline/tests/requirements-test.txt
870-
# Starts the server in background
871-
python ./css-inline/tests/server.py &
857+
run: python ./css-inline/tests/server.py &
872858
shell: bash
873859

874860
- name: Run tests

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ It would be awesome if you can submit a failing test that demonstrates the probl
4848

4949
## Running tests
5050

51-
Running tests requires a Flask app running in background:
51+
Running tests requires a test server running in background:
5252

5353
```
54-
python -m pip install flask
5554
python ./css-inline/tests/server.py &
5655
```
5756

bindings/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ into:
4444
- Can process multiple documents in parallel
4545
- Works on Linux, Windows, macOS and in the browser via PyOdide
4646
- Supports HTML5 & CSS3
47-
- Tested on CPython 3.9, 3.10, 3.11, 3.12, 3.13 and PyPy 3.11.
47+
- Tested on CPython 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 and PyPy 3.11.
4848

4949
## Playground
5050

bindings/python/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ classifiers=[
2121
"Programming Language :: Python :: 3.11",
2222
"Programming Language :: Python :: 3.12",
2323
"Programming Language :: Python :: 3.13",
24+
"Programming Language :: Python :: 3.14",
2425
"Programming Language :: Python :: Implementation :: CPython",
2526
"Programming Language :: Python :: Implementation :: PyPy",
2627
"Programming Language :: Rust",

css-inline/tests/requirements-test.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

css-inline/tests/requirements-test.txt

Lines changed: 0 additions & 22 deletions
This file was deleted.

css-inline/tests/server.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
from flask import Flask
1+
from http.server import HTTPServer, BaseHTTPRequestHandler
22

3-
app = Flask(__name__)
43

4+
class Handler(BaseHTTPRequestHandler):
5+
def do_GET(self):
6+
if self.path == "/external.css":
7+
self.send_response(200)
8+
self.send_header("Content-Type", "text/css")
9+
self.end_headers()
10+
self.wfile.write(b"h1 { color: blue; }")
11+
else:
12+
self.send_response(404)
13+
self.end_headers()
514

6-
@app.route("/external.css")
7-
def stylesheet():
8-
return "h1 { color: blue; }"
15+
def log_message(self, format, *args):
16+
pass # Suppress logging
917

1018

1119
if __name__ == "__main__":
12-
app.run(host="0.0.0.0", port=1234)
20+
server = HTTPServer(("0.0.0.0", 1234), Handler)
21+
server.serve_forever()

0 commit comments

Comments
 (0)