Skip to content

Commit

Permalink
Set up development docs as rst files
Browse files Browse the repository at this point in the history
  • Loading branch information
melissawm committed Nov 28, 2023
1 parent d59958b commit 7bc729e
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 1 deletion.
64 changes: 64 additions & 0 deletions doc/source/doc_developer/building_with_poetry.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
====================
Building with poetry
====================

Installing poetry
=================

numpy-financial uses `poetry <https://python-poetry.org/>`__ to manage
dependencies, build wheels and sdists, and publish to PyPI this page documents
how to work with poetry.

To install poetry follow their `official guide <https://python-poetry.org/docs/#installing-with-the-official-installer>`__.
It is recommended to use the official installer for local development.

To check your installation try to check the version of poetry::

poetry -V


Setting up a virtual environment using poetry
=============================================

Once poetry is installed it is time to set up the virtual environment. To do
this, run::

poetry install


``poetry install`` looks for dependencies in the ``pyproject.toml`` file,
resolves them to the most recent version and installs the dependencies
in a virtual environment. It is now possible to launch an interactive REPL
by running the following command::

poetry run python

Running the test suite
======================

``numpy-financial``` has an extensive test suite, which can be run with the
following command::

poetry run pytest

Building distributions
======================

It is possible to manually build distributions for ``numpy-financial`` using
poetry. This is possible via the ``build`` command::

poetry build

The ``build`` command creates a ``dist`` directory containing a wheel and sdist
file.

Publishing to PyPI
==================

poetry provides support to publish packages to PyPI. This is possible using
the ``publish`` command::

poetry publish --build --username <your username> --password <your password>

Note that this builds the package before publishing it. You will need to
provide the correct username and password for PyPI.
48 changes: 48 additions & 0 deletions doc/source/doc_developer/getting_the_code.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
================
Getting the code
================

This document explains how to get the source code for NumPy-Financial using Git.

Code Location
=============

NumPy-Financial is hosted on GitHub. The repository URL is
https://github.com/numpy/numpy-financial.

Creating a fork
===============

To create a fork click the green "fork" button at the top right of the page.
This creates a new repository on your GitHub profile. This will have the URL:
``https://github.com/<your_username>/numpy-financial``.

Cloning the repository
======================

Now that you have forked the repository you will need to clone it. This copies
the repository from GitHub to the local machine. To clone a repository enter the
following commands in the terminal::

git clone https://github.com/<your_username>/numpy-financial.git

Hooray! You now have a working copy of NumPy-Financial.


Updating the code with other's changes
======================================

From time to time you may want to pull down the latest code. Do this with::

git fetch

The ``git fetch`` command downloads commits, files and refs from a remote repo
into your local repo.

Then run::

git merge --ff-only

The ``git merge`` command is Git's way of putting independent branches back
together. The ``--ff-only`` flag tells git to use ``fast-forward`` merges. This
is preferable as fast-forward merge avoids creating merge commits.
9 changes: 8 additions & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@ Functions
pv
rate

Development
===========

.. include:: release-notes.rst
.. toctree::
:maxdepth: 1

doc_developer/getting_the_code
doc_developer/building_with_poetry

.. include:: release-notes.rst


Index and Search
Expand Down

0 comments on commit 7bc729e

Please sign in to comment.