From 7bc729e3ef6add8c285013c859406841cd8bfdb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Tue, 28 Nov 2023 13:50:18 +0000 Subject: [PATCH] Set up development docs as rst files --- .../doc_developer/building_with_poetry.rst | 64 +++++++++++++++++++ doc/source/doc_developer/getting_the_code.rst | 48 ++++++++++++++ doc/source/index.rst | 9 ++- 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 doc/source/doc_developer/building_with_poetry.rst create mode 100644 doc/source/doc_developer/getting_the_code.rst diff --git a/doc/source/doc_developer/building_with_poetry.rst b/doc/source/doc_developer/building_with_poetry.rst new file mode 100644 index 0000000..36cb88c --- /dev/null +++ b/doc/source/doc_developer/building_with_poetry.rst @@ -0,0 +1,64 @@ +==================== +Building with poetry +==================== + +Installing poetry +================= + +numpy-financial uses `poetry `__ 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 `__. +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 --password + +Note that this builds the package before publishing it. You will need to +provide the correct username and password for PyPI. diff --git a/doc/source/doc_developer/getting_the_code.rst b/doc/source/doc_developer/getting_the_code.rst new file mode 100644 index 0000000..99a771e --- /dev/null +++ b/doc/source/doc_developer/getting_the_code.rst @@ -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//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//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. \ No newline at end of file diff --git a/doc/source/index.rst b/doc/source/index.rst index 0898fe6..f8fb19e 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -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