##// END OF EJS Templates
contrib: add a bat file to build all of the wheels on Windows...
Matt Harbison -
r53162:ea9cbb0f stable
parent child Browse files
Show More
@@ -0,0 +1,37
1 @echo off
2
3 REM - This is a convenience script to build all of the wheels outside of the CI
4 REM - system. It requires the cibuildwheel package to be installed, and the
5 REM - executable on PATH, as well as `msgfmt.exe` from gettext and the x86,
6 REM - amd64, and arm64 compilers from VS BuildTools. These can be obtained by
7 REM - running `contrib/install-windows-dependencies.ps1`.
8
9 REM - None of the variable set here live past this script exiting.
10 setlocal
11
12 REM - Build translations; requires msgfmt.exe on PATH.
13 set MERCURIAL_SETUP_FORCE_TRANSLATIONS=1
14
15 REM - Prevent building pypy wheels, which is broken.
16 set CIBW_SKIP=pp*
17
18 REM - Disable warning about not being able to test without an arm64 runner.
19 set CIBW_TEST_SKIP=*-win_arm64
20
21
22 REM - arm64 support starts with py39, but the first arm64 installer wasn't
23 REM - available until py311, so skip arm64 on the older, EOL versions.
24 set CIBW_ARCHS=x86 AMD64
25 set CIBW_BUILD=cp38-* cp39-* cp310-*
26
27 cibuildwheel --output-dir dist/wheels
28
29 if %errorlevel% neq 0 exit /b %errorlevel%
30
31
32 set CIBW_ARCHS=x86 AMD64 ARM64
33 set CIBW_BUILD=cp311-* cp312-* cp313-*
34
35 cibuildwheel --output-dir dist/wheels
36
37 if %errorlevel% neq 0 exit /b %errorlevel%
@@ -1,97 +1,98
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ check_code="$TESTDIR"/../contrib/check-code.py
4 $ check_code="$TESTDIR"/../contrib/check-code.py
5 $ cd "$TESTDIR"/..
5 $ cd "$TESTDIR"/..
6
6
7 New errors are not allowed. Warnings are strongly discouraged.
7 New errors are not allowed. Warnings are strongly discouraged.
8 (The writing "no-che?k-code" is for not skipping this file when checking.)
8 (The writing "no-che?k-code" is for not skipping this file when checking.)
9
9
10 $ testrepohg locate \
10 $ testrepohg locate \
11 > -X contrib/python-zstandard \
11 > -X contrib/python-zstandard \
12 > -X hgext/fsmonitor/pywatchman \
12 > -X hgext/fsmonitor/pywatchman \
13 > -X mercurial/thirdparty \
13 > -X mercurial/thirdparty \
14 > -X mercurial/pythoncapi_compat.h \
14 > -X mercurial/pythoncapi_compat.h \
15 > | sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
15 > | sed 's-\\-/-g' | "$check_code" --warnings --per-file=0 - || false
16 Skipping contrib/automation/hgautomation/__init__.py it has no-che?k-code (glob)
16 Skipping contrib/automation/hgautomation/__init__.py it has no-che?k-code (glob)
17 Skipping contrib/automation/hgautomation/aws.py it has no-che?k-code (glob)
17 Skipping contrib/automation/hgautomation/aws.py it has no-che?k-code (glob)
18 Skipping contrib/automation/hgautomation/cli.py it has no-che?k-code (glob)
18 Skipping contrib/automation/hgautomation/cli.py it has no-che?k-code (glob)
19 Skipping contrib/automation/hgautomation/linux.py it has no-che?k-code (glob)
19 Skipping contrib/automation/hgautomation/linux.py it has no-che?k-code (glob)
20 Skipping contrib/automation/hgautomation/pypi.py it has no-che?k-code (glob)
20 Skipping contrib/automation/hgautomation/pypi.py it has no-che?k-code (glob)
21 Skipping contrib/automation/hgautomation/ssh.py it has no-che?k-code (glob)
21 Skipping contrib/automation/hgautomation/ssh.py it has no-che?k-code (glob)
22 Skipping contrib/automation/hgautomation/try_server.py it has no-che?k-code (glob)
22 Skipping contrib/automation/hgautomation/try_server.py it has no-che?k-code (glob)
23 Skipping contrib/automation/hgautomation/windows.py it has no-che?k-code (glob)
23 Skipping contrib/automation/hgautomation/windows.py it has no-che?k-code (glob)
24 Skipping contrib/automation/hgautomation/winrm.py it has no-che?k-code (glob)
24 Skipping contrib/automation/hgautomation/winrm.py it has no-che?k-code (glob)
25 Skipping contrib/fuzz/FuzzedDataProvider.h it has no-che?k-code (glob)
25 Skipping contrib/fuzz/FuzzedDataProvider.h it has no-che?k-code (glob)
26 Skipping contrib/fuzz/standalone_fuzz_target_runner.cc it has no-che?k-code (glob)
26 Skipping contrib/fuzz/standalone_fuzz_target_runner.cc it has no-che?k-code (glob)
27 Skipping contrib/packaging/hgpackaging/cli.py it has no-che?k-code (glob)
27 Skipping contrib/packaging/hgpackaging/cli.py it has no-che?k-code (glob)
28 Skipping contrib/packaging/hgpackaging/downloads.py it has no-che?k-code (glob)
28 Skipping contrib/packaging/hgpackaging/downloads.py it has no-che?k-code (glob)
29 Skipping contrib/packaging/hgpackaging/inno.py it has no-che?k-code (glob)
29 Skipping contrib/packaging/hgpackaging/inno.py it has no-che?k-code (glob)
30 Skipping contrib/packaging/hgpackaging/pyoxidizer.py it has no-che?k-code (glob)
30 Skipping contrib/packaging/hgpackaging/pyoxidizer.py it has no-che?k-code (glob)
31 Skipping contrib/packaging/hgpackaging/util.py it has no-che?k-code (glob)
31 Skipping contrib/packaging/hgpackaging/util.py it has no-che?k-code (glob)
32 Skipping contrib/packaging/hgpackaging/wix.py it has no-che?k-code (glob)
32 Skipping contrib/packaging/hgpackaging/wix.py it has no-che?k-code (glob)
33 Skipping hgext/fsmonitor/__init__.py it has no-che?k-code (glob)
33 Skipping hgext/fsmonitor/__init__.py it has no-che?k-code (glob)
34 Skipping i18n/polib.py it has no-che?k-code (glob)
34 Skipping i18n/polib.py it has no-che?k-code (glob)
35 Skipping mercurial/statprof.py it has no-che?k-code (glob)
35 Skipping mercurial/statprof.py it has no-che?k-code (glob)
36 Skipping tests/testlib/badserverext.py it has no-che?k-code (glob)
36 Skipping tests/testlib/badserverext.py it has no-che?k-code (glob)
37
37
38 @commands in debugcommands.py should be in alphabetical order.
38 @commands in debugcommands.py should be in alphabetical order.
39
39
40 >>> import re
40 >>> import re
41 >>> commands = []
41 >>> commands = []
42 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
42 >>> with open('mercurial/debugcommands.py', 'rb') as fh:
43 ... for line in fh:
43 ... for line in fh:
44 ... m = re.match(br"^@command\('([a-z]+)", line)
44 ... m = re.match(br"^@command\('([a-z]+)", line)
45 ... if m:
45 ... if m:
46 ... commands.append(m.group(1))
46 ... commands.append(m.group(1))
47 >>> scommands = list(sorted(commands))
47 >>> scommands = list(sorted(commands))
48 >>> for i, command in enumerate(scommands):
48 >>> for i, command in enumerate(scommands):
49 ... if command != commands[i]:
49 ... if command != commands[i]:
50 ... print('commands in debugcommands.py not sorted; first differing '
50 ... print('commands in debugcommands.py not sorted; first differing '
51 ... 'command is %s; expected %s' % (commands[i], command))
51 ... 'command is %s; expected %s' % (commands[i], command))
52 ... break
52 ... break
53
53
54 Prevent adding new files in the root directory accidentally.
54 Prevent adding new files in the root directory accidentally.
55
55
56 $ testrepohg files 'glob:*'
56 $ testrepohg files 'glob:*'
57 .arcconfig
57 .arcconfig
58 .clang-format
58 .clang-format
59 .editorconfig
59 .editorconfig
60 .gitattributes
60 .gitattributes
61 .hgignore
61 .hgignore
62 .hgsigs
62 .hgsigs
63 .hgtags
63 .hgtags
64 .jshintrc
64 .jshintrc
65 CONTRIBUTING
65 CONTRIBUTING
66 CONTRIBUTORS
66 CONTRIBUTORS
67 COPYING
67 COPYING
68 Makefile
68 Makefile
69 README.rst
69 README.rst
70 hg
70 hg
71 hgeditor
71 hgeditor
72 hgweb.cgi
72 hgweb.cgi
73 pyproject.toml
73 pyproject.toml
74 rustfmt.toml
74 rustfmt.toml
75 setup.py
75 setup.py
76
76
77 Prevent adding modules which could be shadowed by ancient .so/.dylib.
77 Prevent adding modules which could be shadowed by ancient .so/.dylib.
78
78
79 $ testrepohg files \
79 $ testrepohg files \
80 > mercurial/base85.py \
80 > mercurial/base85.py \
81 > mercurial/bdiff.py \
81 > mercurial/bdiff.py \
82 > mercurial/diffhelpers.py \
82 > mercurial/diffhelpers.py \
83 > mercurial/mpatch.py \
83 > mercurial/mpatch.py \
84 > mercurial/osutil.py \
84 > mercurial/osutil.py \
85 > mercurial/parsers.py \
85 > mercurial/parsers.py \
86 > mercurial/zstd.py
86 > mercurial/zstd.py
87 [1]
87 [1]
88
88
89 Keep python3 tests sorted:
89 Keep python3 tests sorted:
90 $ sort < contrib/python3-whitelist > $TESTTMP/py3sorted
90 $ sort < contrib/python3-whitelist > $TESTTMP/py3sorted
91 $ cmp contrib/python3-whitelist $TESTTMP/py3sorted || echo 'Please sort passing tests!'
91 $ cmp contrib/python3-whitelist $TESTTMP/py3sorted || echo 'Please sort passing tests!'
92
92
93 Keep Windows line endings in check
93 Keep Windows line endings in check
94
94
95 $ testrepohg files 'set:eol(dos)'
95 $ testrepohg files 'set:eol(dos)'
96 contrib/packaging/build-windows-wheels.bat
96 contrib/win32/hg.bat
97 contrib/win32/hg.bat
97 contrib/win32/mercurial.ini
98 contrib/win32/mercurial.ini
General Comments 0
You need to be logged in to leave comments. Login now