11
22.. _pyproject :
33
4- setup.py and pyproject.toml
5- =========================== 
6- 
7- setup.py
8- -------- 
9- 
10- Projects that use robotpy-build must use the setup function provided by
11- robotpy-build. Your project's setup.py should look like this:
12- 
13- .. code-block :: py 
14- 
15-    # !/usr/bin/env python3 
16-    from  robotpy_build.setup import  setup 
17-    setup() 
18- 
194pyproject.toml
20- -------------- 
5+ ============== 
216
22- Projects that use robotpy-build  must add a ``pyproject.toml `` to the root of
7+ Projects that use semiwrap  must add a ``pyproject.toml `` to the root of
238their project as specified in `PEP 518  <https://www.python.org/dev/peps/pep-0518 >`_.
249
25- It  is recommended that projects include the standard `` build-system `` section to 
26- tell pip  to install robotpy- build (and any other dependencies) before starting 
27- a build .
10+ Because semiwrap  is a hatchling plugin, you should add semiwrap and hatchling 
11+ to your `` build-system.requires  ``. You need meson to build the project, so we 
12+ recommend also using `` hatch-meson `` to do so .
2813
2914.. code-block :: toml 
3015
3116   [build-system] 
32-    requires = ["robotpy-build>=2020.1.0,<2021.0.0"] 
17+    build-backend = "hatchling.build" 
18+    requires = ["semiwrap", "hatch-meson", "hatchling"] 
3319
34- robotpy-build  specific sections in their pyproject.toml.
35- robotpy-build  takes ``pyproject.toml `` and converts it to a python dictionary
36- using ``toml.load ``. The resulting dictionary is given  to pydantic, which 
37- validates the structure of the dictionary against the objects  described below.
20+ semiwrap  specific sections in their pyproject.toml.
21+ semiwrap  takes ``pyproject.toml `` and converts it to a python dictionary
22+ using ``toml.load ``. The resulting dictionary is converted  to the dataclasses 
23+ described below.
3824
3925Required sections:
4026
@@ -49,73 +35,12 @@ Optional sections:
4935* :class: `.PatchInfo ` - patch downloaded sources
5036
5137
52- .. note :: For a complete example pyproject.toml file, see ``tests/cpp/pyproject.toml.tmpl`` 
53- 
54- .. _pyproject_overrides :
55- 
56- Overrides
57- --------- 
58- 
59- You can define 'override' sections that will be grafted onto the configuration
60- if they match a particular platform. For example, to change the dependencies
61- for a wrapper section on Windows:
62- 
63- .. code-block :: toml 
64- 
65-    [tool.robotpy-build.wrappers."PACKAGENAME".override.os_windows] 
66-    depends = ["windows-thing"] 
67- 
68- 
69- by specifying the identical section as '.override.KEYNAME'. If the key matches
70- the current configuration, the override will be written to the original section.
71- The matched keys are generated at runtime. Current supported platform override
72- keys are:
73- 
74- * ``arch_{platform_arch} ``
75- * ``os_{platform_os} ``
76- * ``platform_{platform_os}_{platform_arch} ``
77- 
78- To get information about the current platform, you can run:
79- 
80- .. code-block :: sh 
81- 
82-    robotpy-build platform-info 
83- 
84- 
85- 
86- .. code-block :: sh 
87- 
88-    robotpy-build platform-info --list 
89- 
90- 
91- you can use this tool to process for the current platform:
92- 
93- .. code-block :: sh 
94- 
95-    robotpy-build show-override 
96- 
97- 
98- 
99- .. code-block :: sh 
100- 
101-    robotpy-build show-override -p linux-athena 
102- 
103- platforms :
104- 
105- Current supported platform/os/arch combinations are:
106- 
107- * OS: windows/osx/linux
108- * Arch: x86/x86-64/armv7l/aarch64
109- 
110- For ARM linux distributions we support:
38+ .. note :: For a complete example pyproject.toml file, see ``tests/cpp/*/pyproject.toml`` 
11139
112- * armv7l + nilrt (RoboRIO)
113- * armv7l + raspbian (Raspbian 10)
114- * aarch64 + bionic (Ubuntu 18.04)
11540
11641Reference
11742--------- 
11843
119- .. automodule :: robotpy_build .config.pyproject_toml
44+ .. automodule :: semiwrap .config.pyproject_toml
12045   :members: 
12146   :exclude-members:  __init__, Config
0 commit comments