|
| 1 | +# Building with poetry |
| 2 | + |
| 3 | +## Installing poetry |
| 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 poetry |
| 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. |
0 commit comments