Skip to content

Commit 8c86557

Browse files
vstinnermiss-islington
authored andcommitted
gh-108494: Document how to add a project in PCbuild/readme.txt (GH-110077)
Add _testclinic_limited to Tools/msi/test/test_files.wxs. (cherry picked from commit 6387b53) Co-authored-by: Victor Stinner <[email protected]>
1 parent 8296b53 commit 8c86557

File tree

2 files changed

+37
-9
lines changed

2 files changed

+37
-9
lines changed

PCbuild/readme.txt

+28
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,31 @@ project, with some projects overriding certain specific values. The GUI
293293
doesn't always reflect the correct settings and may confuse the user
294294
with false information, especially for settings that automatically adapt
295295
for different configurations.
296+
297+
Add a new project
298+
-----------------
299+
300+
For example, add a new _testclinic_limited project to build a new
301+
_testclinic_limited extension, the file Modules/_testclinic_limited.c:
302+
303+
* In PCbuild/, copy _testclinic.vcxproj to _testclinic_limited.vcxproj,
304+
replace RootNamespace value with `_testclinic_limited`, replace
305+
`_asyncio.c` with `_testclinic_limited.c`.
306+
* Open Visual Studio, open PCbuild\pcbuild.sln solution, add the
307+
PCbuild\_testclinic_limited.vcxproj project to the solution ("add existing
308+
project).
309+
* Add a dependency on the python project to the new _testclinic_limited
310+
project.
311+
* Save and exit Visual Studio.
312+
* Add `;_testclinic_limited` to `<TestModules Include="...">` in
313+
PCbuild\pcbuild.proj.
314+
* Update "exts" in Tools\msi\lib\lib_files.wxs file or in
315+
Tools\msi\test\test_files.wxs file (for tests).
316+
* PC\layout\main.py needs updating if you add a test-only extension whose name
317+
doesn't start with "_test".
318+
* Add the extension to PCbuild\readme.txt (this file).
319+
* Build Python from scratch (clean the solution) to check that the new project
320+
is built successfully.
321+
* Ensure the new .vcxproj and .vcxproj.filters files are added to your commit,
322+
as well as the changes to pcbuild.sln, pcbuild.proj and any other modified
323+
files.

Tools/msi/test/test_files.wxs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3-
<?define exts=_testcapi;_ctypes_test;_testbuffer;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testinternalcapi;_testclinic ?>
3+
<?define exts=_testcapi;_ctypes_test;_testbuffer;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testinternalcapi;_testclinic;_testclinic_limited ?>
44
<Fragment>
55
<ComponentGroup Id="test_extensions">
66
<?foreach ext in $(var.exts)?>
7-
7+
88
<Component Id="$(var.ext).pyd" Directory="DLLs" Guid="*">
99
<File Name="$(var.ext).pyd" KeyPath="yes" />
1010
</Component>
11-
11+
1212
<?endforeach ?>
1313
</ComponentGroup>
1414
</Fragment>
15-
15+
1616
<Fragment>
1717
<ComponentGroup Id="test_extensions_symbols">
1818
<?foreach ext in $(var.exts)?>
19-
19+
2020
<Component Id="$(var.ext).pdb" Directory="DLLs" Guid="*">
2121
<File Name="$(var.ext).pdb" />
2222
</Component>
23-
23+
2424
<?endforeach ?>
2525
</ComponentGroup>
2626
</Fragment>
27-
27+
2828
<Fragment>
2929
<ComponentGroup Id="test_extensions_d">
3030
<?foreach ext in $(var.exts)?>
31-
31+
3232
<Component Id="$(var.ext)_d.pyd" Directory="DLLs" Guid="*">
3333
<File Name="$(var.ext)_d.pyd" />
3434
</Component>
3535
<Component Id="$(var.ext)_d.pdb" Directory="DLLs" Guid="*">
3636
<File Name="$(var.ext)_d.pdb" />
3737
</Component>
38-
38+
3939
<?endforeach ?>
4040
</ComponentGroup>
4141
</Fragment>

0 commit comments

Comments
 (0)