You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Only do the next part if you are installing globally
37
-
>
38
-
> If you are installing for 1 specific project, then you can skip this step
39
-
> and just `git clone` in the project directory
40
-
41
-
2: Add download location to Python search path
42
-
43
-
Two different ways, choose one:
44
-
45
-
`. Add path to PYTHONPATH environment variable
46
-
1. Add to top of Python file:
47
-
```python
48
-
import sys
49
-
sys.path.insert(0, "path/to/downloaded/yfinance")
14
+
pip install git+ranaroussi/yfinance.git@dev # dev branch
50
15
```
51
16
52
-
3: Verify
53
-
54
-
```python
55
-
import yfinance
56
-
print(yfinance)
57
-
```
58
-
59
-
Output should be:
60
-
61
-
`<module 'yfinance' from 'path/to/downloaded/yfinance/yfinance/__init__.py'>`
62
-
63
-
If output looks like this then you did step 2 wrong
64
-
65
-
`<module 'yfinance' from '.../lib/python3.10/site-packages/yfinance/__init__.py'>`
66
-
17
+
For more information, see the [Developer Guide](https://ranaroussi.github.io/yfinance/development/running.html).
67
18
68
19
## Branches
69
20
70
-
To support rapid development without breaking stable versions, this project uses a two-layer branch model:  ([inspiration](https://miro.medium.com/max/700/1*2YagIpX6LuauC3ASpwHekg.png))
71
-
72
-
***dev** : new features & some bug-fixes merged here, tested together, conflicts fixed, etc. Once stable, can merge to ...
73
-
74
-
***main**: stable branch. Where PIP releases are created
75
-
76
-
77
-
Most of the time you want to target the **dev** branch, but default is **main** so remember to switch to **dev**.
78
-
79
-
**Exception:** can straight merge into **main** if:
21
+
YFinance uses a two-layer branch model:
80
22
81
-
* yfinance is massively broken
82
-
83
-
* or part of yfinance is broken and the fix is simple and clearly doesn't affect anything else
84
-
85
-
* or not editing part of the code (e.g. editing this file)
23
+
***dev**: new features & some bug-fixes merged here, tested together, conflicts fixed, etc.
24
+
***main**: stable branch where PIP releases are created.
86
25
26
+
> [!NOTE]
27
+
> By default, branches target **main**, but most contributions should target **dev**.
28
+
> Direct merges to **main** are allowed if:
29
+
> *`yfinance` is massively broken
30
+
> * Part of `yfinance` is broken, and the fix is simple and isolated
31
+
> * Not updating the code (e.g. docs)
87
32
33
+
> [!NOTE]
34
+
> For more information, see the [Developer Guide](https://ranaroussi.github.io/yfinance/development/branches.html).
88
35
89
36
### I'm a GitHub newbie, how do I contribute code?
90
37
@@ -94,43 +41,28 @@ Most of the time you want to target the **dev** branch, but default is **main**
94
41
95
42
3. Create a Pull Request, from your fork to this project. If addressing an Issue, link to it
96
43
44
+
> [!NOTE]
45
+
> See the [Developer Guide](https://ranaroussi.github.io/yfinance/development/contributing.html) for more information.
97
46
98
-
### [How to download & run a GitHub version of yfinance](https://github.com/ranaroussi/yfinance/discussions/1080)
47
+
### [How to download & run a GitHub version of yfinance](#Running-a-branch)
99
48
100
49
## Documentation website
101
50
102
-
The new docs website [ranaroussi.github.io/yfinance/index.html](https://ranaroussi.github.io/yfinance/index.html) is generated automatically from code. When you fetch a branch or PR, probably it also has changes to docs - to generate and view this:
51
+
The new docs website [ranaroussi.github.io/yfinance/index.html](https://ranaroussi.github.io/yfinance/index.html) is generated automatically from code.
> See the [Developer Guide](https://ranaroussi.github.io/yfinance/development/documentation.html) for more information
55
+
> Including how to build and run the docs locally.
111
56
112
57
## Unit tests
113
58
114
59
Tests have been written using the built-in Python module `unittest`. Examples:
115
60
116
-
* Run all price tests: `python -m unittest tests.test_prices`
117
-
118
-
* Run sub-set of price tests: `python -m unittest tests.test_prices.TestPriceRepair`
119
-
120
-
* Run a specific test: `python -m unittest tests.test_prices.TestPriceRepair.test_ticker_missing`
121
-
122
-
* Run all tests: `python -m unittest discover -s tests`
61
+
#### Run all tests: `python -m unittest discover -s tests`
123
62
124
63
> [!NOTE]
125
-
> The tests are currently failing already
126
-
>
127
-
> Standard result:
128
-
>
129
-
> **Failures:** 11
130
-
>
131
-
> **Errors:** 93
132
64
>
133
-
> **Skipped:** 1
65
+
> See the [Developer Guide](https://ranaroussi.github.io/yfinance/development/testing.html) for more information.
134
66
135
67
## Git stuff
136
68
### commits
@@ -139,20 +71,7 @@ To keep the Git commit history and [network graph](https://github.com/ranaroussi
139
71
140
72
* For long commit messages use this: `git commit -m "short sentence summary" -m "full commit message"`
141
73
142
-
*`squash` tiny/negligible commits back with meaningful commits, or to combine successive related commits. [Guide](https://docs.gitlab.com/ee/topics/git/git_rebase.html#interactive-rebase) but basically it's:
74
+
*`squash` tiny/negligible commits back with meaningful commits, or to combine successive related commits
143
75
144
-
145
-
```bash
146
-
git rebase -i HEAD~2
147
-
git push --force-with-lease origin <branch-name>
148
-
```
149
-
150
-
### rebase
151
-
152
-
You might be asked to move your branch from `main` to `dev`. Make sure you have pulled **all** relevant branches then run:
153
-
154
-
```bash
155
-
git checkout <your branch>
156
-
git rebase --onto dev main <branch-name>
157
-
git push --force-with-lease origin <branch-name>
158
-
```
76
+
> [!NOTE]
77
+
> See the [Developer Guide](https://ranaroussi.github.io/yfinance/development/contributing.html#GIT-STUFF) for more information.
- **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.
12
+
- **main**: Stable branch where PIP releases are created.
13
+
14
+
By default, branches target **main**, but most contributions should target **dev**.
15
+
16
+
**Exceptions**:
17
+
Direct merges to **main** are allowed if:
18
+
19
+
- `yfinance` is massively broken
20
+
- Part of `yfinance` is broken, and the fix is simple and isolated
21
+
- Not updating the code (e.g. docs)
22
+
23
+
Rebasing
24
+
--------
25
+
26
+
If asked to move your branch from **main** to **dev**:
3. Create a new branch for your feature or bug fix:
18
18
19
19
.. code-block:: bash
20
20
21
-
git checkout -b feature-branch-name
21
+
git checkout -b {branch}
22
22
23
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:
- **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:
To keep the Git commit history and [network graph](https://github.com/ranaroussi/yfinance/network) compact please follow these two rules:
94
44
95
-
If asked to move your branch from **main** to **dev**:
45
+
- For long commit messages use this: `git commit -m "short sentence summary" -m "full commit message"`
96
46
97
-
1. Ensure all relevant branches are pulled.
98
-
2. Run:
47
+
- `squash` tiny/negligible commits back with meaningful commits, or to combine successive related commits. [Guide](https://docs.gitlab.com/ee/topics/git/git_rebase.html#interactive-rebase) but basically it's:
99
48
100
-
.. code-block:: shell
49
+
.. code-block:: bash
50
+
git rebase -i HEAD~2
51
+
git push --force-with-lease origin {branch}
101
52
102
-
git checkout <your-branch>
103
-
git rebase --onto dev main <branch-name>
104
-
git push --force-with-lease origin <branch-name>
105
53
106
-
Running the GitHub Version of yfinance
107
-
--------------------------------------
54
+
### rebase
55
+
56
+
You might be asked to move your branch from `main` to `dev`. Make sure you have pulled **all** relevant branches then run:
108
57
109
-
To download and run a GitHub version of `yfinance`, refer to `GitHub discussion <https://github.com/ranaroussi/yfinance/discussions/1080>`_
0 commit comments