-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up development docs as rst files
- Loading branch information
Showing
3 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters