Skip to content

Commit b22892e

Browse files
authored
Merge pull request #88 from melissawm/setup-docs
Set up development docs as rst files
2 parents d59958b + 7bc729e commit b22892e

File tree

3 files changed

+120
-1
lines changed

3 files changed

+120
-1
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
====================
2+
Building with poetry
3+
====================
4+
5+
Installing poetry
6+
=================
7+
8+
numpy-financial uses `poetry <https://python-poetry.org/>`__ to manage
9+
dependencies, build wheels and sdists, and publish to PyPI this page documents
10+
how to work with poetry.
11+
12+
To install poetry follow their `official guide <https://python-poetry.org/docs/#installing-with-the-official-installer>`__.
13+
It is recommended to use the official installer for local development.
14+
15+
To check your installation try to check the version of poetry::
16+
17+
poetry -V
18+
19+
20+
Setting up a virtual environment using poetry
21+
=============================================
22+
23+
Once poetry is installed it is time to set up the virtual environment. To do
24+
this, run::
25+
26+
poetry install
27+
28+
29+
``poetry install`` looks for dependencies in the ``pyproject.toml`` file,
30+
resolves them to the most recent version and installs the dependencies
31+
in a virtual environment. It is now possible to launch an interactive REPL
32+
by running the following command::
33+
34+
poetry run python
35+
36+
Running the test suite
37+
======================
38+
39+
``numpy-financial``` has an extensive test suite, which can be run with the
40+
following command::
41+
42+
poetry run pytest
43+
44+
Building distributions
45+
======================
46+
47+
It is possible to manually build distributions for ``numpy-financial`` using
48+
poetry. This is possible via the ``build`` command::
49+
50+
poetry build
51+
52+
The ``build`` command creates a ``dist`` directory containing a wheel and sdist
53+
file.
54+
55+
Publishing to PyPI
56+
==================
57+
58+
poetry provides support to publish packages to PyPI. This is possible using
59+
the ``publish`` command::
60+
61+
poetry publish --build --username <your username> --password <your password>
62+
63+
Note that this builds the package before publishing it. You will need to
64+
provide the correct username and password for PyPI.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
================
2+
Getting the code
3+
================
4+
5+
This document explains how to get the source code for NumPy-Financial using Git.
6+
7+
Code Location
8+
=============
9+
10+
NumPy-Financial is hosted on GitHub. The repository URL is
11+
https://github.com/numpy/numpy-financial.
12+
13+
Creating a fork
14+
===============
15+
16+
To create a fork click the green "fork" button at the top right of the page.
17+
This creates a new repository on your GitHub profile. This will have the URL:
18+
``https://github.com/<your_username>/numpy-financial``.
19+
20+
Cloning the repository
21+
======================
22+
23+
Now that you have forked the repository you will need to clone it. This copies
24+
the repository from GitHub to the local machine. To clone a repository enter the
25+
following commands in the terminal::
26+
27+
git clone https://github.com/<your_username>/numpy-financial.git
28+
29+
Hooray! You now have a working copy of NumPy-Financial.
30+
31+
32+
Updating the code with other's changes
33+
======================================
34+
35+
From time to time you may want to pull down the latest code. Do this with::
36+
37+
git fetch
38+
39+
The ``git fetch`` command downloads commits, files and refs from a remote repo
40+
into your local repo.
41+
42+
Then run::
43+
44+
git merge --ff-only
45+
46+
The ``git merge`` command is Git's way of putting independent branches back
47+
together. The ``--ff-only`` flag tells git to use ``fast-forward`` merges. This
48+
is preferable as fast-forward merge avoids creating merge commits.

doc/source/index.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,16 @@ Functions
5959
pv
6060
rate
6161

62+
Development
63+
===========
6264

63-
.. include:: release-notes.rst
65+
.. toctree::
66+
:maxdepth: 1
6467

68+
doc_developer/getting_the_code
69+
doc_developer/building_with_poetry
70+
71+
.. include:: release-notes.rst
6572

6673

6774
Index and Search

0 commit comments

Comments
 (0)