Skip to content

Commit b656a8a

Browse files
Update documentation
1 parent 1e15302 commit b656a8a

File tree

373 files changed

+115099
-266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

373 files changed

+115099
-266
lines changed

docs/.nojekyll

Whitespace-only changes.

docs/Ticker.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/TickerBase.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/Tickers.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/_images/branches.png

40.8 KB
Loading
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
********************************
2+
Contributiong to yfinance
3+
********************************
4+
5+
`yfinance` relies on the community to investigate bugs and contribute code. Here’s how you can help:
6+
7+
Contributing
8+
------------
9+
10+
1. Fork the repository on GitHub.
11+
2. Clone your forked repository:
12+
13+
.. code-block:: bash
14+
15+
git clone https://github.com/your-username/yfinance.git
16+
17+
3. Create a new branch for your feature or bug fix:
18+
19+
.. code-block:: bash
20+
21+
git checkout -b feature-branch-name
22+
23+
4. Make your changes, commit them, and push your branch to GitHub. To keep the commit history and `network graph <https://github.com/ranaroussi/yfinance/network>`_ compact:
24+
25+
Use short summaries for commits
26+
27+
.. code-block:: shell
28+
29+
git commit -m "short summary" -m "full commit message"
30+
31+
**Squash** tiny or negligible commits with meaningful ones.
32+
33+
.. code-block:: shell
34+
35+
git rebase -i HEAD~2
36+
git push --force-with-lease origin <branch-name>
37+
38+
5. Open a pull request on the `yfinance` GitHub page.
39+
40+
For more information, see the `Developer Guide <https://github.com/ranaroussi/yfinance/discussions/1084>`_.
41+
42+
Branches
43+
---------
44+
45+
To support rapid development without breaking stable versions, this project uses a two-layer branch model:
46+
47+
.. image:: assets/branches.png
48+
:alt: Branching Model
49+
50+
`Inspiration <https://miro.medium.com/max/700/1*2YagIpX6LuauC3ASpwHekg.png>`_
51+
52+
- **dev**: New features and some bug fixes are merged here. This branch allows collective testing, conflict resolution, and further stabilization before merging into the stable branch.
53+
- **main**: Stable branch where PIP releases are created.
54+
55+
By default, branches target **main**, but most contributions should target **dev**.
56+
57+
**Exceptions**:
58+
Direct merges to **main** are allowed if:
59+
60+
- `yfinance` is massively broken
61+
- Part of `yfinance` is broken, and the fix is simple and isolated
62+
63+
Unit Tests
64+
----------
65+
66+
Tests are written using Python’s `unittest` module. Here are some ways to run tests:
67+
68+
- **Run all price tests**:
69+
70+
.. code-block:: shell
71+
72+
python -m unittest tests.test_prices
73+
74+
- **Run a subset of price tests**:
75+
76+
.. code-block:: shell
77+
78+
python -m unittest tests.test_prices.TestPriceRepair
79+
80+
- **Run a specific test**:
81+
82+
.. code-block:: shell
83+
84+
python -m unittest tests.test_prices.TestPriceRepair.test_ticker_missing
85+
86+
- **Run all tests**:
87+
88+
.. code-block:: shell
89+
90+
python -m unittest discover -s tests
91+
92+
Rebasing
93+
--------------
94+
95+
If asked to move your branch from **main** to **dev**:
96+
97+
1. Ensure all relevant branches are pulled.
98+
2. Run:
99+
100+
.. code-block:: shell
101+
102+
git checkout <your-branch>
103+
git rebase --onto dev main <branch-name>
104+
git push --force-with-lease origin <branch-name>
105+
106+
Running the GitHub Version of yfinance
107+
--------------------------------------
108+
109+
To download and run a GitHub version of `yfinance`, refer to `GitHub discussion <https://github.com/ranaroussi/yfinance/discussions/1080>`_
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
*************************************
2+
Contribution to the documentation
3+
*************************************
4+
5+
.. contents:: Documentation:
6+
:local:
7+
8+
About documentation
9+
------------------------
10+
* yfinance documentation is written in reStructuredText (rst) and built using Sphinx.
11+
* The documentation file is in `doc/source/..`.
12+
* Most of the notes under API References read from class and methods docstrings. These documentations, found in `doc/source/reference/api` is autogenerated by Sphinx and not included in git.
13+
14+
Building documentation locally
15+
-------------------------------
16+
To build the documentation locally, follow these steps:
17+
18+
1. **Install Required Dependencies**:
19+
20+
* Make sure `Sphinx` and any other dependencies are installed. If a `requirements.txt` file is available, you can install dependencies by running:
21+
22+
.. code-block:: console
23+
24+
pip install -r requirements.txt
25+
26+
27+
2. **Build with Sphinx**:
28+
29+
* After dependencies are installed, use the sphinx-build command to generate HTML documentation.
30+
* Go to `doc/` directory Run:
31+
32+
.. code-block:: console
33+
34+
make clean && make html
35+
36+
3. **View Documentation Locally**:
37+
38+
* Open `doc/build/html/index.html` in the browser to view the generated documentation.
39+
40+
Building documentation on main
41+
-------------------------------
42+
The documentation updates are built on merge to `main` branch. This is done via GitHub Actions workflow based on `/yfinance/.github/workflows/deploy_doc.yml`.
43+
44+
1. Reivew the changes locally and push to `dev`.
45+
46+
2. When `dev` gets merged to `main`, GitHub Actions workflow is automated to build documentation.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Development
2+
===============================
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
contributing
8+
documentation
9+
reporting_bug
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
********************************
2+
Reporting a Bug
3+
********************************
4+
5+
Open a new issue on our `GitHub <https://github.com/ranaroussi/yfinance/issues>`_.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Getting Started
2+
===============
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
installation
8+
quick_start
9+
legal

0 commit comments

Comments
 (0)