Skip to content

Commit 8c0a2ed

Browse files
committed
doc: Add a development workflow guide
1 parent 2f7dd22 commit 8c0a2ed

File tree

4 files changed

+567
-51
lines changed

4 files changed

+567
-51
lines changed

doc/source/build.rst

Lines changed: 43 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Build from source
2-
=================
1+
Install/Build from source
2+
=========================
33

44
.. note::
55
The instructions here are for building ``python-flint`` from source. For
@@ -8,13 +8,15 @@ Build from source
88
is not available for the platform. See :ref:`install_pip_conda`.
99

1010

11+
.. _simple_build_instructions:
12+
1113
Simple build instructions
1214
-------------------------
1315

1416
The simple explanation of how to build ``python-flint`` from source is that
1517
there are two steps:
1618

17-
- Install ``FLINT >= 3.0`` (see :ref:`install_dependencies` below).
19+
- Install ``FLINT >= 3.0`` (see :ref:`installing_the_dependencies` below).
1820
- Run ``pip install --no-binary python-flint python-flint``.
1921

2022
For example on Ubuntu 24.04 (but not older versions of Ubuntu) and when installing
@@ -38,10 +40,15 @@ If you have the source code locally then you can build and install with::
3840
After installing from source it is recommended to run the tests to check that
3941
everything is working correctly as described in :ref:`test_installation`.
4042

41-
The remainder of this page provides more detailed instructions for building
42-
``python-flint`` from source including how to install the dependencies, how to
43-
build older versions of ``python-flint`` (``< 0.7.0``), how to install from
44-
git, and other more advanced topics.
43+
The remainder of this page provides more detailed instructions for:
44+
45+
- :ref:`supported_versions`.
46+
- :ref:`building_from_source`.
47+
- :ref:`building_older_versions`.
48+
- :ref:`installing_the_dependencies`.
49+
- :ref:`building_on_windows`.
50+
- :ref:`non_standard_location`.
51+
- :ref:`editable_install`.
4552

4653
.. note::
4754
If you have more than one Python environment in your system then you need to
@@ -142,10 +149,10 @@ It is also possible to build and use python-flint for PyPy. Other Python
142149
implementations may work but are not tested.
143150

144151

145-
.. _build_from_source:
152+
.. _building_from_source:
146153

147-
Building python-flint from source
148-
---------------------------------
154+
Installing python-flint from source
155+
-----------------------------------
149156

150157
.. note::
151158
The instructions here are for building ``python-flint`` from source. For
@@ -154,18 +161,18 @@ Building python-flint from source
154161
is not available for the platform. See :ref:`install_pip_conda`.
155162

156163
Also if you are working on ``python-flint`` itself then it is not
157-
recommended to install the package
158-
159-
- XXX: Add link to separate development page...
164+
recommended to install the package as described here. Instead see the
165+
:ref:`development_workflow` page for how to work on ``python-flint``.
160166

161167
The source code for ``python-flint`` is available on `GitHub
162168
<https://github.com/flintlib/python-flint/tags>`_ and source distributions can
163169
be downloaded from PyPI.
164170

165171
To build from source you must first install the dependencies (see
166-
:ref:`install_dependencies` below for instructions). Once the dependencies are
167-
installed the following command will download the ``python-flint`` source code
168-
from PyPI, then build and install it into the active Python environment::
172+
:ref:`installing_the_dependencies` below for instructions). Once the
173+
dependencies are installed the following command will download the
174+
``python-flint`` source code from PyPI, then build and install it into the
175+
active Python environment::
169176

170177
pip install python-flint
171178

@@ -223,8 +230,10 @@ example if you want to build ``python-flint`` against the latest git version of
223230
and Cython that are supported by each version of ``python-flint``.
224231

225232

226-
Building older versions of python-flint
227-
---------------------------------------
233+
.. _building_older_versions:
234+
235+
Installing older versions from source
236+
-------------------------------------
228237

229238
For ``python-flint < 0.6.0`` the source distribution did not include
230239
``pyproject.toml`` and did not list the build requirements. Also for
@@ -244,7 +253,7 @@ If the build fails during the Cython step then it is likely that a different
244253
version of Cython is needed.
245254

246255

247-
.. _install_dependencies:
256+
.. _installing_the_dependencies:
248257

249258
Installing the dependencies
250259
---------------------------
@@ -321,34 +330,19 @@ again be able to install ``python-flint`` with::
321330

322331
pip install .
323332

324-
In the ``python-flint`` git repo there is a script
325-
`bin/build_dependencies_unix.sh
326-
<https://github.com/flintlib/python-flint/blob/master/bin/build_dependencies_unix.sh>`_
327-
which will download and build GMP, MPFR and FLINT and install them in the
328-
current directory under ``~/.local``. The versions used and the installation
329-
directory can be changed by editing the `bin/build_variables.sh
330-
<https://github.com/flintlib/python-flint/blob/master/bin/build_variables.sh>`_
331-
script. This script is useful for building ``python-flint`` on systems where
332-
the system-wide ``FLINT`` is too old or if precise control over the versions of
333-
GMP, MPFR and FLINT is needed. This script is used for building the binaries
334-
for PyPI and also takes care of ensuring that ``GMP`` and ``FLINT`` are built
335-
as redistributable shared libraries (this is not the default behaviour of the
336-
``configure`` scripts for these libraries and disables some optimisation
337-
features of ``FLINT`` on some ``x86_64`` micro-architectures). Since this
338-
installation is not system-wide, see :ref:`non_standard_location` below for
339-
instructions on how to build and use ``python-flint`` in this case.
340-
341-
342-
Building on Windows
343-
-------------------
333+
334+
.. _building_on_windows:
335+
336+
Installing from source on Windows
337+
---------------------------------
344338

345339
.. note::
346340
Building from source is not the recommended way for most users to install
347341
``python-flint``, especially on Windows. For most users it is recommended to
348342
use the binaries from ``PyPI`` or ``conda-forge`` except in cases where a
349343
binary is not available for the platform. See :ref:`install_pip_conda`.
350344

351-
The instructions in :ref:`install_dependencies` above are for Unix-like systems
345+
The instructions in :ref:`installing_the_dependencies` above are for Unix-like systems
352346
(e.g. Linux or MacOS). On Windows the dependencies can be built in a similar
353347
way using MSYS2 or under WSL. It is also possible to build ``python-flint`` and
354348
its dependencies using MSVC but we do not currently provide instructions for
@@ -464,18 +458,17 @@ perhaps it could be possible to link ``FLINT`` and the other libraries
464458
statically into ``python-flint``.
465459

466460

467-
Editable install
468-
----------------
469-
470-
.. note::
471-
For working on ``python-flint`` itself it is not recommended to install the
472-
package into the active Python environment. Instead the development
473-
workflow uses ``spin`` and ``meson`` to manage a local build of
474-
``python-flint``. See
461+
.. _editable_install:
475462

476-
- XXX: Add link to separate development page...
463+
Installing in editable mode
464+
---------------------------
477465

478-
for more information on how to develop ``python-flint``.
466+
.. note::
467+
For working on ``python-flint`` itself it is not recommended to install the
468+
package into the active Python environment. Instead the development workflow
469+
uses ``spin`` and ``meson`` to manage a local build of ``python-flint``. See
470+
the :ref:`development_workflow` page for more information on how to develop
471+
``python-flint``.
479472

480473
If you are building and testing ``python-flint`` while working on another
481474
project then it may be useful to install ``python-flint`` in editable mode.

doc/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Introduction
3131
install.rst
3232
general.rst
3333
build.rst
34+
workflow.rst
3435

3536

3637
Reference

doc/source/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Platforms without binaries
7272
There are many other platforms on which ``python-flint`` works fine but for
7373
which binaries are not provided. If a binary is not available for your platform
7474
then you may be able to build from source as described in
75-
:ref:`build_from_source`.
75+
:ref:`simple_build_instructions`.
7676

7777
Notably, at the time of writing the following platforms do *not* have binaries
7878
available but ``python-flint`` should work if built from source:

0 commit comments

Comments
 (0)