Skip to content

Commit 4d7e545

Browse files
committed
ci: fix ci/test issues
1 parent 1fda1e1 commit 4d7e545

8 files changed

Lines changed: 59 additions & 35 deletions

File tree

.github/workflows/test.yml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: test
22
on: [pull_request]
33
jobs:
4-
byexample-test:
4+
byexample-linux-test:
55
name: "Byexample Python (ver: ${{ matrix.python-version }}) (os: ${{ matrix.os }})"
66
runs-on: ${{ matrix.os }}
77
strategy:
88
matrix:
99
python-version: ["3.7.17", "3.8.18", "3.9.25", "3.10.20", "3.11.15", "3.12.13", "3.13.12", "3.14.3"]
10-
os: [ubuntu-22.04, macos-26]
10+
os: [ubuntu-22.04]
1111
env:
1212
TERM: xterm-color
1313
steps:
@@ -24,6 +24,29 @@ jobs:
2424
- run: make examples-test
2525
- run: make corner-test
2626

27+
byexample-mac-test:
28+
name: "Byexample Python (ver: ${{ matrix.python-version }}) (os: ${{ matrix.os }})"
29+
runs-on: ${{ matrix.os }}
30+
strategy:
31+
matrix:
32+
python-version: ["3.7.17", "3.8.18", "3.9.25", "3.10.20", "3.11.15", "3.12.13", "3.13.12", "3.14.3"]
33+
os: [macos-26-intel]
34+
env:
35+
TERM: xterm-color
36+
steps:
37+
- uses: actions/checkout@v2
38+
- name: Setup python
39+
uses: actions/setup-python@v6
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
- run: make deps-dev
43+
- run: make install-from-pkg-tgz
44+
- run: make lib-test
45+
- run: make modules-test
46+
- run: make docs-test
47+
- run: make examples-test
48+
- run: make corner-test
49+
2750
source-code-test:
2851
name: "Source code"
2952
runs-on: ubuntu-22.04
@@ -70,7 +93,7 @@ jobs:
7093
runs-on: ${{ matrix.os }}
7194
strategy:
7295
matrix:
73-
os: [ubuntu-22.04, macos-26]
96+
os: [ubuntu-22.04, macos-26-intel]
7497
steps:
7598
- uses: actions/checkout@v2
7699
- name: Setup python
@@ -87,7 +110,7 @@ jobs:
87110
runs-on: ${{ matrix.os }}
88111
strategy:
89112
matrix:
90-
os: [ubuntu-22.04, macos-26]
113+
os: [ubuntu-22.04, macos-26-intel]
91114
steps:
92115
- uses: actions/checkout@v2
93116
- name: Setup python
@@ -104,7 +127,7 @@ jobs:
104127
strategy:
105128
matrix:
106129
ruby-version: ["2.4", "2.5", "2.6", "2.7", "3.0", "3.1"]
107-
os: [ubuntu-22.04, macos-26]
130+
os: [ubuntu-22.04, macos-26-intel]
108131
steps:
109132
- uses: actions/checkout@v2
110133
- name: Setup python
@@ -124,7 +147,7 @@ jobs:
124147
runs-on: ${{ matrix.os }}
125148
strategy:
126149
matrix:
127-
os: [ubuntu-22.04, macos-26]
150+
os: [ubuntu-22.04, macos-26-intel]
128151
steps:
129152
- uses: actions/checkout@v2
130153
- name: Setup python
@@ -141,7 +164,7 @@ jobs:
141164
strategy:
142165
matrix:
143166
node-version: [10.x, 12.x, 14.x, 15.x, 16.x]
144-
os: [ubuntu-22.04, macos-26]
167+
os: [ubuntu-22.04, macos-26-intel]
145168
steps:
146169
- uses: actions/checkout@v2
147170
- name: Setup python
@@ -162,7 +185,7 @@ jobs:
162185
strategy:
163186
matrix:
164187
go-version: [{go: "1.19", yaegi: "v0.14.0"}, {go: "1.18", yaegi: "v0.14.0"}, {go: "1.17", yaegi: "v0.13.0"}, {go: "1.16", yaegi: "v0.13.0"}]
165-
os: [ubuntu-22.04, macos-26]
188+
os: [ubuntu-22.04, macos-26-intel]
166189
steps:
167190
- uses: actions/checkout@v2
168191
- name: Setup python
@@ -185,7 +208,7 @@ jobs:
185208
strategy:
186209
matrix:
187210
java: [ '11', '13', '15' ]
188-
os: [ubuntu-22.04, macos-26]
211+
os: [ubuntu-22.04, macos-26-intel]
189212
steps:
190213
- uses: actions/checkout@v2
191214
- name: Setup python

byexample/expected.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def _get_captures_by_incremental_match(
348348
>>> expected = r'aa<...>bb<...>ddd<...>eee<...>cc'
349349
>>> got = r'aaAAbbBBxxxddeeeCCcc'
350350
351-
>>> expected_regexs = ['\A', 'aa', '(.*?)', 'bb', '(.*?)', 'ddd',
351+
>>> expected_regexs = ['\\A', 'aa', '(.*?)', 'bb', '(.*?)', 'ddd',
352352
... '(.*?)', 'eee', '(.*?)', 'cc', r'\n*\Z']
353353
>>> charnos = [0, 0, 2, 7, 9, 14, 17, 22, 25, 30, 32]
354354
>>> rcounts = [0, 2, 0, 2, 0, 3, 0, 3, 0, 2, 0]
@@ -396,7 +396,7 @@ def _get_captures_by_incremental_match(
396396
>>> expected = r'aa<foo>bb<b-r>ddd<baz>eee<z-z>cc'
397397
>>> got = r'aaAAbbBBxxxddeeeCCcc'
398398
399-
>>> expected_regexs = ['\A', 'aa', '(?P<foo>.*?)', 'bb',
399+
>>> expected_regexs = ['\\A', 'aa', '(?P<foo>.*?)', 'bb',
400400
... '(?P<b_r>.*?)', 'ddd', '(?P<baz>.*?)',
401401
... 'eee', '(?P<z_z>.*?)', 'cc', r'\n*\Z']
402402
>>> charnos = [0, 0, 2, 7, 9, 14, 17, 22, 25, 30, 32]
@@ -423,7 +423,7 @@ def _get_captures_by_incremental_match(
423423
>>> expected = 'aa<foo>bb\ncc\ndd<bar>ee'
424424
>>> got = 'aaAAbb\nxx\nxxAAee'
425425
426-
>>> expected_regexs = ['\A', 'aa', '(?P<foo>.*?)', 'bb\n',
426+
>>> expected_regexs = ['\\A', 'aa', '(?P<foo>.*?)', 'bb\n',
427427
... 'cc\n', 'dd', '(?P<bar>.*?)',
428428
... 'ee', r'\n*\Z']
429429
>>> charnos = [0, 0, 2, 7, 10, 13, 15, 20, 22]
@@ -442,7 +442,7 @@ def _get_captures_by_incremental_match(
442442
443443
>>> expected = 'aa<foo>bb\ncc\ndd<foo>ee'
444444
445-
>>> expected_regexs = ['\A', 'aa', '(?P<foo>.*?)', 'bb\n',
445+
>>> expected_regexs = ['\\A', 'aa', '(?P<foo>.*?)', 'bb\n',
446446
... 'cc\n', 'dd', '(?P=foo)',
447447
... 'ee', r'\n*\Z']
448448
>>> rcounts = [0, 2, 0, 3, 3, 2, 1, 2, 0] # notice the +1

byexample/log.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ def log_with(logger_name, child=True):
334334
finally:
335335
_logger_stack.pop()
336336

337+
337338
class _DummyRLock:
338339
'''
339340
A dummy reentrant lock to emulate a lock (acquire/release) but without
@@ -364,6 +365,7 @@ def __enter__(self):
364365
def __exit__(self, exc_type, exc_value, traceback):
365366
self.release()
366367

368+
367369
class XStreamHandler(logging.StreamHandler):
368370
def __init__(self, *args, **kargs):
369371
logging.StreamHandler.__init__(self, *args, **kargs)

byexample/prof.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
with the elapsed time in nanoseconds:
2424
2525
>>> foo() # byexample: +timeout=8
26-
stdin>::foo 1<...>
26+
stdin<...>::foo 1<...>
2727
2828
The function name is prefixed by the name of the module. In this case,
29-
"stdin>".
29+
"stdin>" plus some prefix like "stdin>-11" or "stdin-11>"
30+
(but this prefix depends on the Python version used).
3031
3132
Nested profiled functions will print a larger stack trace:
3233
@@ -36,8 +37,8 @@
3637
... foo()
3738
3839
>>> gus() # byexample: +timeout=8 +paste
39-
stdin>::gus;stdin>::foo 1<...>
40-
stdin>::gus 2<...>
40+
stdin<...>::gus;stdin<...>::foo 1<...>
41+
stdin<...>::gus 2<...>
4142
4243
Two one-liner stack traces were printed: one for foo() called from
4344
gus() and the other for gus() only.
@@ -63,7 +64,7 @@
6364
... time.sleep(2)
6465
6566
>>> bar() # byexample: +timeout=8
66-
stdin>::bar 2<...>
67+
stdin<...>::bar 2<...>
6768
6869
By default the context manager uses the name of the calling function
6970
for the stack trace.
@@ -78,8 +79,8 @@
7879
... time.sleep(2)
7980
8081
>>> baz() # byexample: +timeout=8
81-
stdin>::baz::head 1<...>
82-
stdin>::baz::tail 2<...>
82+
stdin<...>::baz::head 1<...>
83+
stdin<...>::baz::tail 2<...>
8384
8485
Nested is possible too:
8586
@@ -92,9 +93,9 @@
9293
... time.sleep(3)
9394
9495
>>> nested() # byexample: +timeout=12
95-
stdin>::nested;stdin>::nested;stdin>::nested 3<...>
96-
stdin>::nested;stdin>::nested 2<...>
97-
stdin>::nested 1<...>
96+
stdin<...>::nested;stdin<...>::nested;stdin<...>::nested 3<...>
97+
stdin<...>::nested;stdin<...>::nested 2<...>
98+
stdin<...>::nested 1<...>
9899
99100
The engine is thread safe. Due how the engine works
100101
the traces may be written out of order and they may be

docs/languages/python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ executed and with the output returned by the interpreter.
372372

373373
>>> sys
374374
Traceback <...>
375-
NameError: name 'sys' is not defined
375+
NameError: name 'sys' is not defined<...>
376376
```
377377

378378
### Empty lines

docs/overview/usage.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ The help included in ``byexample`` should give you a quick overview of its
8989
capabilities
9090

9191
```
92-
$ byexample -h # byexample: +norm-ws -tags +rm=  +diff=ndiff
92+
$ byexample -h # byexample: +norm-ws -capture +rm=  +diff=ndiff
9393
usage: byexample -l <languages> [--ff] [--timeout <secs>] [-j <n>] [--dry]
9494
[--skip <file> [<file> ...]] [--capture-env-var <var names>]
9595
[-d {none,unified,ndiff,context,tool}] [--difftool <cmd>]
@@ -105,7 +105,7 @@ positional arguments:
105105
<file> files that have the examples to run.
106106
 
107107
Language Selection:
108-
-l <languages>, --language <languages>, --languages <languages>
108+
-l<...> --language<...> --languages <languages>
109109
select which languages to parse and run. Comma
110110
separated syntax is also accepted.
111111
 
@@ -114,21 +114,21 @@ Execution Options:
114114
--timeout <secs> timeout in seconds to complete each example (2 by
115115
default); this can be changed per example with this
116116
option.
117-
-j <n>, --jobs <n> run <n> jobs in parallel (1 by default); <n> can be an
117+
-j<...> --jobs <n> run <n> jobs in parallel (1 by default); <n> can be an
118118
integer or the string "cpu" or "cpu<n>": "cpu" means
119119
use all the cpus available; "cpu<n>" multiply it by
120120
<n> the cpus available.
121121
--dry do not run any example, only parse them.
122122
--skip <file> [<file> ...]
123123
skip these files
124-
--capture-env-var <var names>, --capture-env-vars <var names>
124+
--capture-env-var<...> --capture-env-vars <var names>
125125
capture some environment variables and put them in the
126126
clipboard so they can be pasted and used in
127127
conditional executions. Comma separated syntax is also
128128
accepted.
129129
 
130130
Diff Options:
131-
-d {none,unified,ndiff,context,tool}, --diff {none,unified,ndiff,context,tool}
131+
-d<...> --diff {none,unified,ndiff,context,tool}
132132
select diff algorithm (none by default).
133133
--difftool <cmd> command line to the external diff program; the tokens
134134
%e and %g are replaced by the file names with the
@@ -140,12 +140,12 @@ Diff Options:
140140
disables all of that.
141141
 
142142
Miscellaneous Options:
143-
-o <options>, --options <options>
143+
-o<...> --options <options>
144144
add additional options; see --show-options to list
145145
them.
146146
--show-options show the available options for the selected languages
147147
(with -l)
148-
-m <dir>, --modules <dir>
148+
-m<...> --modules <dir>
149149
append a directory for searching modules there.
150150
--encoding <enc>[:<error>]
151151
select the encoding and optionally the error handler

docs/recipes/arguments-per-environment.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<!--
22
Check that we have byexample installed first
33
$ hash byexample # byexample: +fail-fast
4-
$ hash j2 # byexample: +fail-fast
54
65
$ alias byexample=byexample\ --pretty\ none\ --dry
76
@@ -66,8 +65,8 @@ docs/overview/*.md
6665
Then:
6766
6867
```shell
69-
$ osname=$(uname) j2 test/ds/template.args > test/ds/good.args
70-
$ byexample @test/ds/good.args
68+
$ osname=$(uname) j2 test/ds/template.args > test/ds/good.args # byexample: +pass
69+
$ byexample @test/ds/good.args # byexample: +pass
7170
```
7271
7372
`j2` is one of many engines based on

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
yapf
22
twine
33
coverage
4-
j2cli
54
wheel
65
setuptools

0 commit comments

Comments
 (0)