Tyler Goodlet
14418b4c5c
Rework `.config` routines to use `pathlib.Path`
...
Been meaning to do this port for a while and since it makes passing
around file handles (presumably alongside the in mem obj form) a lot
simpler/nicer and the implementations of all the config file handling
much more terse with less presumptions about the form of filename/dir
`str` values all over the place B)
moar technically, let's us:
- drop remaining `.config` usage of `os.path`.
- return `Path`s from most routines.
- adds a special case to `get_conf_path()` such that if the input name
contains a `pps.` pattern, we avoid validating the name; this is going
to be used by new `.accounting.open_pps()` code which will instead
write a separate TOML file for each account B)
2023-04-14 15:58:53 -04:00
Tyler Goodlet
5aaa7f47dc
Pull testing config dir from `tractor` runtime vars
...
Provides a more correct solution (particularly for distributed testing)
to override the `piker` configuration directory by reading the path from
a specific `tractor._state._runtime_vars` entry that can be provided by
the test harness.
Also fix some typing and comments.
2023-03-09 15:37:43 -05:00
Guillermo Rodriguez
d704b153ca
Fix mayor bug found by fomo, sym info getting stored incorrectly on pps.toml causing it to load pp wrong on second open, also fix header leak bug
2023-03-01 21:06:52 -03:00
jaredgoldman
61296bbdfc
Minor formatting, removing whitespace
2023-02-28 13:51:47 -05:00
jaredgoldman
3e83764b5b
Remove whitespace, uneeded comments
2023-02-25 18:59:40 -05:00
jaredgoldman
3a6fbabaf8
Minor formatting
2023-02-25 18:59:40 -05:00
jaredgoldman
4c2e776e01
Ensure to cleanup by passing fixture in paper_test signature
2023-02-25 18:59:40 -05:00
jaredgoldman
1e748f11ef
Ensure config path is being updated with _testing correctly during testing
2023-02-25 18:59:40 -05:00
jaredgoldman
e54d928405
Reformat fake fill in paper engine,
...
Ensure tests pass, refactor test wrapper
2023-02-25 18:59:40 -05:00
algorandpa
db2e2ed78f
Use constants value for test config dir path
2023-02-25 18:59:39 -05:00
algorandpa
3bc54e308f
Use Path.mkdir instead of os.mkdir
2023-02-25 18:59:39 -05:00
algorandpa
8c9c165e0a
Remove broken import
2023-02-25 18:59:39 -05:00
algorandpa
7bd8019876
Add back cleanup fixture
2023-02-25 18:59:39 -05:00
algorandpa
7142a6a7ca
Add hacky cleanup solution for _testng data
2023-02-25 18:59:39 -05:00
algorandpa
b180602a3e
Make config grab _testing dir in pytest env,
...
- Remove print statements
2023-02-25 18:59:39 -05:00
algorandpa
b67d020e23
add basic func to load paper_trades file
2023-02-25 18:59:39 -05:00
Tyler Goodlet
c088963cf2
Always touch config file dir if dne
2023-01-10 11:09:19 -05:00
Tyler Goodlet
16b2937d23
Passthrough toml lib kwargs
2022-06-28 10:07:56 -04:00
Tyler Goodlet
5d774bef90
Move `open_trade_ledger()` to pp mod, add `get_pps()`
2022-06-28 10:07:56 -04:00
Tyler Goodlet
2a641ab8b4
Call it `pps.toml`, allows toml passthrough kwargs
2022-06-28 10:07:56 -04:00
Tyler Goodlet
eb2bad5138
Make our `Symbol` a `msgspec.Struct`
2022-06-28 10:07:56 -04:00
Tyler Goodlet
450009ff9c
Add `open_trade_ledger()` for writing `<confdir>/ledgers/trades_<broker>_<acct>.toml` files
2022-06-28 10:07:56 -04:00
Tyler Goodlet
08c83afa90
Rejig config helpers for arbitrary named files
2022-06-05 22:13:36 -04:00
Tyler Goodlet
9203ebe044
Drop import, it's got madness with and SIGINT?
2022-05-09 11:15:13 -04:00
Tyler Goodlet
1cdb94374c
Extract non-sudo user for config dir path
2022-05-09 11:15:13 -04:00
wattygetlood
c0082e15bc
Fix default `brokers.toml` copying since module move
2022-02-10 10:26:52 -05:00
Tyler Goodlet
71afce69d0
Append paper account last when loading
2021-09-10 11:35:30 -04:00
Tyler Goodlet
87bca9aae1
Tweak accounts schema to be per-provider
2021-09-09 10:46:39 -04:00
Tyler Goodlet
0d2cddec9a
Return accounts in `bidict`
2021-09-08 14:01:54 -04:00
Tyler Goodlet
15025d6047
Move config module to top level
2021-09-06 21:26:28 -04:00