Skip to content

Commit 6faaffd

Browse files
Merge branch 'develop' into feature_1463_pandas_future_warnings
2 parents f519e80 + d1cd6ca commit 6faaffd

File tree

16 files changed

+227
-200
lines changed

16 files changed

+227
-200
lines changed

.github/workflows/os-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ jobs:
2424

2525
- name: Install dependencies
2626
run: |
27-
python -m pip install --upgrade pip setuptools wheel
28-
pip install -r requirements.txt
27+
python -m pip install --upgrade pip setuptools
28+
python -m pip install .

.github/workflows/quick-test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ jobs:
2525

2626
- name: Install dependencies
2727
run: |
28-
python -m pip install --upgrade pip setuptools wheel
29-
pip install pytest
30-
pip install -r requirements.txt
28+
python -m pip install --upgrade pip setuptools
29+
python -m pip install '.[dev]'
3130
3231
- name: Test with pytest
3332
run: |

.github/workflows/slow-test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ jobs:
2525

2626
- name: Install dependencies
2727
run: |
28-
python -m pip install pip setuptools wheel
29-
pip install pytest
30-
pip install -r requirements.txt
28+
python -m pip install --upgrade pip setuptools
29+
python -m pip install '.[dev]'
3130
3231
- name: Test with pytest
3332
run: |

README.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,26 @@ My live production system is always on the latest release. I make, and eat, my o
5757

5858
## Dependencies
5959

60-
See [requirements.txt](requirements.txt) for full details.
60+
See the `project.dependencies` section in [pyproject.toml](pyproject.toml) for full details.
6161

62-
Make sure you get the python3 versions of the relevant packages, i.e. use: (in linux)
63-
64-
```
65-
sudo pip3 install ....
66-
```
67-
68-
(Your machine may not need pip3 if python3 is the default python on your machine)
6962

7063
## Installation
7164

72-
This package isn't hosted on pip. So to get the code the easiest way is to use git:
65+
This package isn't hosted on pypi.org. So to get the code the easiest way is to use git:
7366

7467
```
75-
git clone https://github.com/robcarver17/pysystemtrade.git
76-
#
77-
# then one of:
78-
#
79-
python3 setup.py install # normal
80-
python3 setup.py develop # required if using ipython so sessions can see files inside subdirectories which would otherwise be inaccessible.
81-
python3 setup.py install --user # avoids use of sudo
82-
```
68+
# clone the repo to your local filesystem
69+
$ git clone https://github.com/robcarver17/pysystemtrade.git
70+
71+
# navigate to the project directory
72+
$ cd pysystemtrade
8373
84-
Again, you may be okay with python rather than python3.
74+
# either install pysystemtrade normally
75+
$ python -m pip install .
76+
77+
# or install in editable mode, with development dependencies
78+
$ python -m pip install --editable '.[dev]'
79+
```
8580

8681
There is a more complete installation guide [here](docs/installation.md)
8782

docs/installation.md

Lines changed: 115 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,37 @@
22

33
## Introduction
44

5-
This guide shows the quickest and easiest way to install the project in a virtual environment
5+
This guide shows a couple of ways to install the project in a virtual environment.
6+
7+
## project files
8+
9+
Install the project files by cloning the GitHub repository. If you intend to contribute to the project, or run your own instance, you will likely want to clone your own fork
10+
11+
```
12+
git clone https://github.com/<your_git_hub_id>/pysystemtrade.git
13+
```
14+
15+
otherwise, you'll want the main repo
16+
17+
```
18+
git clone https://github.com/robcarver17/pysystemtrade.git
19+
```
620

721

8-
## pyenv
22+
## Option 1: pyenv + venv
923

10-
pyenv allows easy installation of multiple versions of Python on the same machine. It allows the version of python used to be defined at the user and project level. It is a great tool, easy to use, and does its one job very well. It is worth reading the introduction to have an overview of how it works at a high level. It's not necessary to understand the technical internals
24+
### pyenv
25+
26+
pyenv is a tool that makes it easy to manage multiple versions of Python on the same machine. It allows the version of python used to be defined at the user and project level. It is a great tool, easy to use, and does its one job very well. It is worth reading the introduction to have an overview of how it works at a high level. It's not necessary to understand the technical internals
1127

1228
https://github.com/pyenv/pyenv#how-it-works
1329

1430
Installation instructions for pyenv are here:
1531

1632
https://github.com/pyenv/pyenv#installation
1733

18-
## Python 3.10
1934

20-
pysystemtrade currently requires Python 3.10, so once pyenv is installed, the first step is to get that. Get the latest 3.10.x version, at the time of writing it is 3.10.13
35+
First install Python itself. pysystemtrade currently requires Python 3.10 or newer
2136

2237
```
2338
$ pyenv install 3.10
@@ -31,170 +46,153 @@ $ pyenv versions
3146
3.7.14
3247
3.8.5
3348
3.8.6
34-
3.8.10
35-
3.8.13
36-
3.8.15
3749
3.8.16
3850
3.9.6
3951
3.9.13
4052
3.10.4
41-
* 3.10.13
53+
* 3.10.15
4254
```
4355

4456
Your output will be different, it's just an example
4557

58+
### venv
4659

47-
## project files
60+
https://docs.python.org/3.10/library/venv.html
4861

49-
Once we have the correct version of Python, it's time to get the project files.
62+
Now we want to create a virtual environment (venv) for the project. Doing this will keep all the dependencies for pysystemtrade separate from your other python projects
5063

51-
If you intend to contribute to the project, or run your own instance, you will likely want to clone your own fork
64+
```
65+
$ cd pysystemtrade
66+
$ python -m venv .venv
67+
```
68+
69+
This will create a brand new, isolated Python environment *inside the pysystemtrade project* at the directory
70+
`<your_path>/pysystemtrade/.venv`. You can give your environment any name (the *.venv* bit).
71+
72+
Now activate the virtual environment
5273

5374
```
54-
git clone https://github.com/<your_git_hub_id>/pysystemtrade.git
75+
source .venv/bin/activate
5576
```
5677

57-
otherwise, you'll want the main repo
78+
Once your virtual env is activated, the prompt will change. It will look something like
5879

5980
```
60-
git clone https://github.com/robcarver17/pysystemtrade.git
81+
(.venv) $
6182
```
83+
This reminds you that your venv is active. You can exit the venv at any time by running `deactivate`
6284

6385
Now we will want to let pyenv know that we want to use Python 3.10 for this project
6486

6587
```
66-
cd pysystemtrade
67-
pyenv local 3.10.13
88+
pyenv local 3.10.15
6889
```
6990

70-
this creates a file at the top level of the project `.python-version` that lets the Python execution environment know to use version 3.10.13. We can check this by running python
91+
this creates a file at the top level of the project `.python-version` that lets the Python execution environment know to use version 3.10.15. We can check this by running python
7192

7293
```
7394
$ python
74-
Python 3.10.13 (main, Nov 27 2023, 11:13:49) [Clang 14.0.0 (clang-1400.0.29.202)]
95+
Python 3.10.15 (main, Nov 27 2023, 11:13:49) [Clang 14.0.0 (clang-1400.0.29.202)]
7596
Type "help", "copyright", "credits" or "license" for more information.
7697
>>>
7798
< ctrl-D to exit >
7899
```
79100

80-
## venv
101+
### dependencies
81102

82-
https://docs.python.org/3.10/library/venv.html
83-
84-
Now we want to create a virtual env (venv) for the project. Doing this will keep all the dependencies for pysystemtrade separate from your other python projects
103+
Now it's time to start setting up the venv. First update the basic tools
85104

86105
```
87-
$ python -m venv venv/3.10.13
106+
(.venv) $ pip install --upgrade pip setuptools
88107
```
89108

90-
This will create a brand new, isolated Python environment *inside the pysystemtrade project* at the directory
91-
`<your_path>/pysystemtrade/venv/3.10.13`. You can give your environment any name (the *venv/3.10.13* bit).
92-
93-
Now activate the virtual environment
109+
And now install the project and its dependencies
94110

95111
```
96-
source venv/3.10.13/bin/activate
112+
(.venv) $ python -m pip install .
97113
```
98114

99-
Once your virtual env is activated, the prompt will change. It will look something like
115+
Or, if you intend to contribute to the project, you will need the optional development dependencies too, and will want to install in *editable* mode
100116

101117
```
102-
(3.10.13) $
118+
(.venv) $ python -m pip install --editable '.[dev]'
103119
```
104-
This reminds you that you're in a venv. (You can exit the venv at any time by running `deactivate`)
105-
106-
107-
## dependencies
108-
109-
Now it's time to start setting up the venv. First check to see what is there
110-
111-
```
112-
(3.10.13) $ pip list
113-
```
114-
115-
You will probably be prompted to update pip at this time. Do whatever command it suggests.
116-
117-
And now install the dependencies
118-
119-
```
120-
(3.10.13) $ pip install -r requirements.txt
121-
```
122-
123-
### MacOS (ARM)
124-
125-
If you're running MacOS on one of the new ARM chips, the process is more complex. You'll need Homebrew and the Apple XCode Commandline Development Tools, configured for ARM. Doing that is beyond the scope of this document, type `homebrew apple xcode command line tools` into your favourite search engine. Once installed and configured, run installation script:
126-
127-
```
128-
chmod u+x install_dependencies_apple_silicon.sh
129-
./install_dependencies_apple_silicon.sh
130-
131-
```
132-
Note: this may (unfortunately) become out of date and require some tweaking.
133-
134-
### Check dependencies
135120

136121
Check what is installed, should look something like
137122

138123
```
139-
(3.10.13) % pip list
140-
Package Version
141-
--------------- ------------
142-
blinker 1.7.0
143-
click 8.1.7
144-
contourpy 1.2.0
145-
cycler 0.12.1
146-
eventkit 1.0.3
147-
exceptiongroup 1.2.0
148-
Flask 3.0.1
149-
fonttools 4.47.2
150-
ib-insync 0.9.86
151-
iniconfig 2.0.0
152-
itsdangerous 2.1.2
153-
Jinja2 3.1.3
154-
joblib 1.3.2
155-
kiwisolver 1.4.5
156-
MarkupSafe 2.1.4
157-
matplotlib 3.8.2
158-
nest-asyncio 1.6.0
159-
numpy 1.26.3
160-
packaging 23.2
161-
pandas 2.1.3
162-
patsy 0.5.6
163-
pillow 10.2.0
164-
pip 23.3.2
165-
pluggy 1.3.0
166-
psutil 5.6.6
167-
pyarrow 15.0.0
168-
pymongo 3.11.3
169-
pyparsing 3.1.1
170-
PyPDF2 3.0.1
171-
pytest 7.4.4
172-
python-dateutil 2.8.2
173-
pytz 2023.3.post1
174-
PyYAML 5.3.1
175-
scikit-learn 1.4.0
176-
scipy 1.12.0
177-
setuptools 65.5.0
178-
six 1.16.0
179-
statsmodels 0.14.0
180-
threadpoolctl 3.2.0
181-
tomli 2.0.1
182-
tzdata 2023.4
183-
Werkzeug 3.0.1
184-
```
185-
186-
## pysystemtrade
187-
188-
And finally, install the project itself
189-
190-
```
191-
(3.10.13) $ python setup.py develop
192-
```
124+
(.venv) % pip list
125+
Package Version
126+
----------------- -----------
127+
black 23.11.0
128+
blinker 1.8.2
129+
click 8.1.7
130+
contourpy 1.3.0
131+
cycler 0.12.1
132+
decorator 5.1.1
133+
enum-compat 0.0.3
134+
eventkit 1.0.3
135+
exceptiongroup 1.2.2
136+
Flask 3.0.3
137+
fonttools 4.54.1
138+
ib-insync 0.9.86
139+
iniconfig 2.0.0
140+
itsdangerous 2.2.0
141+
Jinja2 3.1.4
142+
joblib 1.4.2
143+
kiwisolver 1.4.7
144+
lz4 4.3.3
145+
MarkupSafe 2.1.5
146+
matplotlib 3.9.2
147+
mock 5.1.0
148+
mockextras 1.0.2
149+
mypy-extensions 1.0.0
150+
nest-asyncio 1.6.0
151+
numpy 1.26.4
152+
packaging 24.1
153+
pandas 2.1.3
154+
pathspec 0.12.1
155+
patsy 0.5.6
156+
pillow 10.4.0
157+
pip 24.3.1
158+
platformdirs 4.3.6
159+
pluggy 1.5.0
160+
psutil 5.6.7
161+
pyarrow 17.0.0
162+
pymongo 3.11.3
163+
pyparsing 3.1.4
164+
PyPDF2 3.0.1
165+
pysystemtrade 1.8.2
166+
pytest 8.3.3
167+
python-dateutil 2.9.0.post0
168+
pytz 2023.3
169+
PyYAML 6.0.1
170+
scikit-learn 1.5.2
171+
scipy 1.14.1
172+
setuptools 65.5.0
173+
six 1.16.0
174+
statsmodels 0.14.0
175+
threadpoolctl 3.5.0
176+
tomli 2.0.1
177+
typing_extensions 4.12.2
178+
tzdata 2024.2
179+
tzlocal 5.2
180+
Werkzeug 3.0.4
181+
```
182+
183+
## Option 2: uv
184+
185+
[uv](https://github.com/astral-sh/uv) is packaging tool that combines the functionality of pip, pyenv, venv and more; read about it [here](https://docs.astral.sh/uv/). It is written in Rust and **extremely** fast
186+
187+
TBD
188+
189+
190+
## test
193191

194192
Check stuff works
195193

196194
```
197-
(3.10.13) $ python
195+
(.venv) $ python
198196
>>>
199197
>>> from sysdata.sim.csv_futures_sim_data import csvFuturesSimData
200198
Configuring sim logging

0 commit comments

Comments
 (0)