Skip to content

Commit 28140ba

Browse files
authored
Merge pull request #115 from Kai-Striega/doc/building-with-spin
Doc/building with spin
2 parents 4fd4939 + fc70786 commit 28140ba

File tree

4 files changed

+76
-89
lines changed

4 files changed

+76
-89
lines changed

doc/source/dev/building_the_docs.md

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,30 @@
11
# Building the docs
22

3-
This guide goes through how to build the NumPy-Financial documentation with poetry
3+
This guide goes through how to build the NumPy-Financial documentation with spin and conda
44

55
## Assumptions
66

77
This guide assumes that you have set up poetry and a virtual environment. If you have
8-
not done this please read [building_with_poetry](building_with_poetry.md).
8+
not done this please read [building_with_spin](building_with_spin).
99

10-
You can check that poetry is installed by running:
10+
You can check that conda and spin are installed by running:
1111

1212
```shell
13-
poetry -V
13+
conda -V
1414
```
1515

16-
## Installing the documentation dependencies
17-
18-
NumPy-Financial is built using [sphinx](https://www.sphinx-doc.org/en/master/) with [numpydoc](https://numpydoc.readthedocs.io/en/latest/).
19-
20-
The dependencies can be installed using poetry and the ``docs`` group:
21-
2216
```shell
23-
poetry install --with docs
17+
spin -V
2418
```
2519

2620
## Building the documentation
2721

28-
The documentation is located in the ``doc`` directory. The first step is to change directory into this directory
29-
30-
```shell
31-
cd doc
32-
```
33-
34-
Once you are in the ``doc`` directory, the documentation can be built using ``make``.
22+
spin handles building the documentation for us. All we have to do is invoke the built-in command.
3523

3624
```shell
37-
poetry run make html
25+
spin docs -j 1
3826
```
3927

40-
This will create the docs as a html document in the ``build`` directory. Note that there are several options available,
41-
however, only the html documentation is built officially.
28+
This will create the docs as a html document in the ``doc/build`` directory. Note that there are several options
29+
available, however, only the html documentation is built officially.
30+

doc/source/dev/building_with_poetry.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

doc/source/dev/building_with_spin.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Building with spin and conda
2+
3+
## Installing conda
4+
numpy-financial uses [spin](https://github.com/scientific-python/spin) and conda
5+
to manage dependencies, build wheels and sdists, and publish to PyPI this page
6+
documents how to work with spin and conda.
7+
8+
To install poetry follow their [official guide](https://docs.anaconda.com/free/miniconda/miniconda-install/)
9+
it is recommended to use the official installer for local development.
10+
11+
To check your installation try to check the version of miniconda:
12+
13+
```shell
14+
conda -V
15+
```
16+
17+
## Setting up a virtual environment using conda
18+
19+
Once conda is installed it is time to set up the virtual environment. To do
20+
this run:
21+
22+
```shell
23+
conda env create -f environment.yml
24+
```
25+
26+
This command looks for dependencies in the ``environment.yml`` file,
27+
resolves them to the most recent version and installs the dependencies
28+
in a virtual environment. It is now possible to launch an interactive REPL
29+
by running the following command:
30+
31+
```shell
32+
conda activate numpy-financial-dev
33+
```
34+
35+
## Building NumPy-Financial
36+
37+
NumPy-Financial is built using a combination of Python and Cython. We therefore
38+
require a build step. This can be run using
39+
40+
```shell
41+
spin build
42+
```
43+
44+
## Running the test suite
45+
46+
NumPy-Financial has an extensive test suite, which can be run with the
47+
following command:
48+
49+
```shell
50+
spin test
51+
```
52+
53+
## Building distributions
54+
55+
It is possible to manually build distributions for numpy-financial using
56+
poetry. This is possible via the `build` command:
57+
58+
```shell
59+
spin build
60+
```
61+
62+
The `build` command creates a `dist` directory containing a wheel and sdist
63+
file.

doc/source/dev/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ Development
55
:maxdepth: 1
66

77
getting_the_code.md
8-
building_with_poetry.md
8+
building_with_spin.md
99
running_the_benchmarks.md
10+
building_the_docs.md
11+
checking_out_an_upstream_pr.md
1012

1113

1214
.. include:: ../_includes/release-notes.rst

0 commit comments

Comments
 (0)