Skip to content

Commit a1c0bcf

Browse files
committed
Build all wheels at once, disable Pypy for now
1 parent 334679f commit a1c0bcf

File tree

6 files changed

+77
-47
lines changed

6 files changed

+77
-47
lines changed

.github/workflows/build_wheels.yml

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,33 @@ name: Build Manylinux Wheels
33
on:
44
workflow_dispatch:
55
inputs:
6-
os:
7-
description: OS
8-
required: true
9-
default: ubuntu-20.04
10-
python:
11-
description: Python
12-
required: true
13-
default: "3.9"
14-
manylinux:
15-
description: Manylinux
16-
required: true
17-
default: manylinux2014
18-
archs:
19-
description: CIBW_ARCHS
20-
required: true
21-
default: auto
226

237
jobs:
248
build_wheels:
25-
name: Build compat:${{ github.event.inputs.manylinux }}, python:${{ github.event.inputs.python }}, os:${{ github.event.inputs.os }}
26-
runs-on: ${{ github.event.inputs.os }}
9+
strategy:
10+
matrix:
11+
os: ['windows-2019', 'macos-10.15']
12+
manylinux: ['notlinux']
13+
include:
14+
- os: ubuntu-20.04
15+
manylinux: manylinux2010
16+
- os: ubuntu-20.04
17+
manylinux: manylinux2014
18+
- os: ubuntu-20.04
19+
manylinux: manylinux_2_24
20+
21+
name: Build ${{ matrix.os }} / ${{ matrix.manylinux }}
22+
runs-on: ${{ matrix.os }}
2723

2824
steps:
29-
- name: Print setup
30-
run: |
31-
echo os=${{ github.event.inputs.os }}
32-
echo python=${{ github.event.inputs.python }}
33-
echo manylinux=${{ github.event.inputs.manylinux }}
34-
echo archs=${{ github.event.inputs.archs }}
35-
3625
- uses: actions/checkout@v2
3726
with:
3827
submodules: true
3928

4029
- name: Setup python
4130
uses: actions/setup-python@v2
4231
with:
43-
python-version: ${{ github.event.inputs.python }}
32+
python-version: "3.9"
4433

4534
- name: Update pip
4635
run: python3 -m pip install -U pip wheel setuptools
@@ -52,12 +41,12 @@ jobs:
5241
run: make _pytidyhtml5.cpp
5342

5443
- name: Build wheels
55-
run: python3 -m cibuildwheel --output-dir wheelhouse-${{ github.event.inputs.manylinux }}-${{ github.event.inputs.os }}
44+
run: python3 -m cibuildwheel --output-dir wheelhouse-${{ matrix.os }}-${{ matrix.manylinux }}
5645
env:
57-
CIBW_SKIP: "cp27-* cp34-* cp35-* pp27-*"
58-
CIBW_MANYLINUX_X86_64_IMAGE: ${{ github.event.inputs.manylinux }}
59-
CIBW_MANYLINUX_I686_IMAGE: ${{ github.event.inputs.manylinux }}
60-
CIBW_ARCHS: ${{ github.event.inputs.archs }}
46+
CIBW_SKIP: "cp27-* cp34-* cp35-* pp*" # FIXME: Unicode strings are broken in Pypy
47+
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }}
48+
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux }}
49+
CIBW_ARCHS: auto
6150
CIBW_ARCHS_WINDOWS: auto64
6251
CIBW_BEFORE_BUILD: make clean-artifacts && make tidy-html5/build/cmake/libtidy.a
6352
CIBW_BUILD_FRONTEND: pip
@@ -66,5 +55,5 @@ jobs:
6655
- name: Store artifacts
6756
uses: actions/upload-artifact@v2
6857
with:
69-
name: Wheelhouse-${{ github.event.inputs.manylinux }}-${{ github.event.inputs.os }}
70-
path: ./wheelhouse-${{ github.event.inputs.manylinux }}-${{ github.event.inputs.os }}/*.whl
58+
name: Wheelhouse-${{ matrix.os }}-${{ matrix.manylinux }}
59+
path: ./wheelhouse-${{ matrix.os }}-${{ matrix.manylinux }}/*.whl

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/env*/
44
/build/
5+
/built_wheel/
56
/cython_debug/
67
/dist/
78
/*.egg-info/
@@ -22,8 +23,7 @@ run.cgi
2223
*.old
2324
*.bak
2425
*.pid
26+
*.orig
2527

2628
.*
2729
!.git*
28-
29-
*.orig

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@ _${NAME}.cpp: _${NAME}.pyx $(wildcard lib/*.pyx) | lib/_import_tidy_enum.pyx
7979

8080
python3 -m Cython.Build.Cythonize -f $<
8181

82-
sed -i -e '1s;^;#ifdef _WIN64\
83-
static void hypot() {}\
84-
namespace std { static void _hypot() {} }\
85-
#include <cmath>\
86-
#endif\
87-
;' -e 's/%z/%" PY_FORMAT_SIZE_T "/g' $@
82+
sed -i.bak '1s;^;#include "./lib/_fix-mingw32-w64s-cmath.h"\
83+
;' $@
84+
sed -i.bak 's/%z/%" PY_FORMAT_SIZE_T "/g' $@
8885

8986
prepare: _${NAME}.cpp ${FILES}
9087

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
PyTidyHTML5
22
===========
33

4-
HTML clean-up and repair: Statically linked Python interface for [tidy-html5](https://github.com/htacg/tidy-html5) v5.8.0.
4+
HTML clean-up and repair: Statically linked Python interface for `tidy-html5 <https://github.com/htacg/tidy-html5>`_ v5.8.0.

basic-sanity-test.py

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,44 @@
11
#!/usr/bin/env python3
22

3-
import pytidyhtml5
3+
from pytidyhtml5 import AttrSortStrategy, LineEnding, OptionId, set_language, tidy_document
4+
5+
6+
options = {
7+
OptionId.alt_text: '',
8+
OptionId.doctype: 'html5',
9+
OptionId.drop_empty_elems: False,
10+
OptionId.drop_empty_paras: False,
11+
OptionId.fix_backslash: False,
12+
OptionId.force_output: True,
13+
OptionId.hide_comments: True,
14+
OptionId.html_out: True,
15+
OptionId.indent_attributes: False,
16+
OptionId.indent_cdata: False,
17+
OptionId.indent_content: False,
18+
OptionId.indent_spaces: 0,
19+
OptionId.join_classes: True,
20+
OptionId.join_styles: True,
21+
OptionId.mark: False,
22+
OptionId.merge_divs: False,
23+
OptionId.merge_emphasis: False,
24+
OptionId.merge_spans: False,
25+
OptionId.meta_charset: True,
26+
OptionId.newline: LineEnding.crlf,
27+
OptionId.num_entities: True,
28+
OptionId.quote_ampersand: True,
29+
OptionId.quote_marks: True,
30+
OptionId.quote_nbsp: True,
31+
OptionId.sort_attributes: AttrSortStrategy.alpha,
32+
}
33+
34+
set_language('de')
435

5-
pytidyhtml5.set_language('de')
636
expected = (
7-
'<!DOCTYPE html>\n<html>\n<head>\n<meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0">\n<title></title>\n</head>\n<body>\nHall&ouml;chen\n</body>\n</html>\n',
8-
"Zeile 1 Spalte 1 - Warnung: fehlende <!DOCTYPE> Deklaration\nZeile 1 Spalte 1 - Warnung: Klartext ist im Element <head> nicht erlaubt\nZeile 1 Spalte 1 - Info: <head> bereits vermerkt\nZeile 1 Spalte 1 - Warnung: füge implizites <body> ein\nZeile 1 Spalte 1 - Warnung: füge fehlendes 'title' Element ein\n"
37+
'<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<meta charset="utf-8">\r\n<title></title>\r\n</head>\r\n<body>\r\nHall&#246;chen\r\n</body>\r\n</html>\r\n',
38+
"Zeile 1 Spalte 1 - Warnung: fehlende <!DOCTYPE> Deklaration\nZeile 1 Spalte 1 - Warnung: Klartext ist im Element <head> nicht erlaubt\nZeile 1 Spalte 1 - Info: <head> bereits vermerkt\nZeile 1 Spalte 1 - Warnung: füge implizites <body> ein\nZeile 1 Spalte 1 - Warnung: füge fehlendes 'title' Element ein\nZeile 1 Spalte 10 - Info: Fehlendes <meta charset=...> wurde in <head> hinzugefügt\n",
939
)
10-
actual = pytidyhtml5.tidy_document('Hallöchen')
40+
actual = tidy_document('Hallöchen', options=options)
41+
1142
if expected != actual:
1243
print('actual=' + repr(actual))
1344
raise SystemExit(1)

lib/_fix-mingw32-w64s-cmath.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#ifdef _WIN64
2+
3+
static void hypot() {
4+
}
5+
6+
namespace std {
7+
static void _hypot() {
8+
}
9+
}
10+
11+
#include <cmath>
12+
13+
#endif

0 commit comments

Comments
 (0)