Skip to content

Commit 64eb90b

Browse files
Minor tweaks to wheel instructions
1 parent cc88b7e commit 64eb90b

File tree

1 file changed

+14
-58
lines changed

1 file changed

+14
-58
lines changed

docs/source/Build/pipInstall.rst

Lines changed: 14 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,18 @@
33

44
.. _pipInstall:
55

6-
Advanced: Building and Installing Pre-Compiled Basilisk Wheels
7-
==============================================================
6+
Advanced: Building Pre-Compiled Basilisk Wheels
7+
===============================================
88

9-
.. warning::
10-
11-
:beta:`Pip Wheel Support` This method of building Basilisk is currently a beta feature, and should only be attempted by advanced users
12-
familiar with `Python packaging and distribution
13-
<https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/>`_.
14-
This method is not yet guaranteed to work on every platform, and there are still some annoyances
15-
to iron out, but we appreciate any feedback you may have.
9+
The following instructions explain how to build wheels with Basilisk.
10+
While we distribute pre-compiled wheels already in :ref:`bskInstall`,
11+
you can also build them manually using the steps below. This is desirable if
12+
you want to use Python wheels but still need to enable custom build options
13+
or link against a custom external module location.
1614

17-
Most users should see :ref:`configureBuild` for documentation on the regular build process.
1815

19-
20-
Building and Installing with ``pip``
21-
------------------------------------
16+
Building Wheels and Installing with ``pip``
17+
-------------------------------------------
2218

2319
.. note::
2420

@@ -44,16 +40,10 @@ Build options (as passed to ``conanfile.py`` and described in :ref:`configureBui
4440
installations (``pip install -e .``) are not currently supported. Please follow the standard
4541
:ref:`configureBuild` process.
4642

47-
After installing
4843

4944
Building Basilisk ``wheel`` File
5045
--------------------------------
5146

52-
On its own, there is no significant benefit to installing Basilisk in this way. However, supporting standard Python
53-
packaging tools means that Basilisk can now be built into a pre-compiled `"wheel" (.whl) file
54-
<https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#wheels>`_ that can be shared
55-
and installed on other compatible machines.
56-
5747
Using ``pip``, the command below will generate a ``Basilisk-*.whl`` file in the current directory::
5848

5949
pip wheel --no-deps -v .
@@ -100,29 +90,6 @@ The following command is used to both download the code and compile Basilisk wit
10090

10191
pip install git+https://github.com/AVSLab/basilisk.git
10292

103-
Wheel Compatibility
104-
-------------------
105-
106-
.. warning::
107-
108-
Wheel compatibility is currently being verified across Python versions and different platforms. So far,
109-
some users have reported successfully installing the same wheel on different Ubuntu versions and with
110-
different Python versions, but your mileage may vary.
111-
112-
If you choose to try this feature and run into and problems, please `raise an issue
113-
<https://github.com/AVSLab/basilisk/issues>`_ for the Basilisk maintainers to investigate.
114-
115-
When installed using a standard Python packaging tool such as ``pip``, Basilisk will automatically be
116-
built using the `Python Limited C API <https://docs.python.org/3/c-api/stable.html#limited-c-api>`_. The
117-
resulting wheel file will contain a set of compiled Python extension modules that, at least in theory, can be
118-
run using any compatible Python version (currently, any from Python 3.8 to 3.11).
119-
120-
To maintain backwards compatibility, standard Basilisk installations via ``python conanfile.py`` are not
121-
compatible between different Python versions, as is stated in :ref:`customPython`. However, users can
122-
also forcibly build with the Python Limited C API by providing the ``--pyLimitedAPI`` flag::
123-
124-
python conanfile.py --pyLimitedAPI 0x030800f0
125-
12693

12794
For Maintainers: Overview of Implementation
12895
-------------------------------------------
@@ -140,23 +107,12 @@ specified in ``pyproject.toml``). The builder then invokes ``python conanfile.py
140107
environment. The main reasons for this setting was to maintain the current default behaviour of
141108
``conanfile.py``-based installation.
142109

143-
Editable installations (i.e. ``pip install -e .``) are not currently supported for two main reasons:
144-
145-
1. ``pip install -e .`` is currently overridden to maintain the existing ``python conanfile.py`` behaviour.
146-
2. Due to the underlying CMake build system, editable installs with ``pip`` require setting the
147-
``--no-build-isolation`` option, which means that the user must manually install the build requirements.
148-
Since these build requirements are installed automatically by the standard ``conanfile.py`` installation,
149-
it is the recommended method for editable installations.
150-
151-
Tools such as `cibuildwheel <https://cibuildwheel.pypa.io/en/stable/>`_ can be used to build wheels that are
152-
automatically compatible with a broad range of operating system versions. These pre-compiled wheels can then
153-
be shared publicly using tools like `twine <https://pypi.org/project/twine/>`_ to upload them to the
154-
`Python Package Index (PyPi) <https://pypi.org/>`_, allowing users to simply ``pip install Basilisk``. We
155-
expect that these tools will be added into the Basilisk Continuous Integration pipeline in the future.
156-
157-
Further discussions and implementation details can be found in
158-
`Basilisk merge request #737 <https://github.com/AVSLab/basilisk/pull/737>`_.
110+
Editable installations (i.e. ``pip install -e .``) are are partially supported. Python code changes are reflected
111+
automatically with this flag, but C++ components are not automatically rebuilt.
159112

113+
This limitation exists because editable mode still routes through ``python conanfile.py``, but skips C++ rebuilds
114+
once the initial build exists. This avoids long native rebuilds and preserves the Conan/CMake configuration.
115+
...
160116

161117
.. rubric:: Footnotes
162118

0 commit comments

Comments
 (0)