| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Missed the readme in a413a072. +universal does not seem to work on recent mac
versions.
|
|
|
|
|
|
|
| |
This tool has limited usefulness and depends on CSVReader.cs whose
license is not 100% clear.
Fixes #1758
|
|
|
|
|
|
|
|
| |
The directive `apply account` and similar directives (fixed, year...)
require an argument. Ensure that an argument is given.
Fixes #553
Fixes #1854
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- commodity_price(NAME, DATE)
- set_commodity_price(NAME, DATE)
Using these two I am able to compute rate of return over a period of
transactions, taking additional deposits and withdrawals into account, using
the following automated transactions:
P 2019-12-31 12:00:00 ROI $1.00
2020-01-01 Start of record
(ROI) 0 ROI
= expr date >= [2020/01/01] && account =~ /Broker:Cash$/ and any(account =~ /Assets:Checking/)
(ROI) (1 ROI * (amount / commodity_price(1 ROI, date)))
= expr date >= [2020/01/01] && account =~ /:Capital:/
(ROI) (set_commodity_price(1 ROI, date, ((commodity_price(1 ROI, date) * account("ROI").amount) - amount) / account("ROI").amount) || 0 ROI)
|
|
|
|
| |
Brew changed boost-python3 to 3.8 but that isn't on the path by default.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without these changes, whether an account's balance is virtual
or real is not considered when asserting it's balance. This lead
to situations where the user must consider their virtual postings
when attemping to assert the real balance of the account. See
test/regress/543_a.test for that testcase, taken from the original
issue. This commit also includes other, fringe, situations that I
noticed while working on the fix. It essentially just adds a separate
attribute to the account class(?) that hold's the account's "real"
balance, which is only updated when the user attempts an assertion on a
real account. The virtual account's balance is updated the way it always
was.
|
|
|
|
|
|
|
|
|
|
| |
10.14+ does not support universal builds:
Error: python27 cannot be installed for the configured universal_archs 'x86_64 i386' because the arch(s) 'i386' are not supported.
From https://trac.macports.org/ticket/57369#comment:6
You just can't install ports universal on Mojave, so don't try to do so. Don't specify +universal on the command line
|
|
|
|
| |
Fixes #1877
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ledger supports precompiling headers as a build speed optimization.
This is provided via a custom add_pch_rule macro. Similar functionality
is now built-in to CMake starting with the 3.16 release in November
2019. Let's use this when available to fix #1774 and start towards not
needing to maintain our own implementation.
I originally considered removing the macro fallback but in my tests it
saves enough build time that I think it is worth keeping for now.
Fixes #1774
|
| |
|
|
|
|
|
| |
Update python-dev dependency, although arguably it could be dropped
since libboost-python-dev depends on it already.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes #1690
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unbuffer python's stdio to avoid output getting stuck in buffer when
stdout is not a TTY. Normally buffers are flushed by `Py_Finalize` but
Boost has a long-standing issue preventing the proper shutdown of the
interpreter with `Py_Finalize` when embedded [1].
This applies the same fix as 139beba but to any ledger usage rather than
only the test suite. I removed `PYTHONUNBUFFERED=1` from tests as there
is no expectation that users should need to have this set for ledger to
function.
For example without this fix piping ledger into cat usually loses any
output (unless the output is large enough to cause the buffer to flush):
$ ./ledger -f "test/baseline/feat-value_py3.test" reg
<class 'bool'> True
[...]
$ ./ledger -f "test/baseline/feat-value_py3.test" reg | cat
$
Interestingly `--verify` causes `python_interpreter_t` to be destroyed
-- it doesn't appear to be otherwise -- which does call `Py_Finalize`.
As expected this fixes the issue but can also crash due to the boost
issue mentioned above:
$ ./ledger -f "test/baseline/feat-value_py3.test" --verify reg
<class 'bool'> True
[...]
Segmentation fault (core dumped)
$ ./ledger -f "test/baseline/feat-value_py3.test" --verify reg | cat
<class 'bool'> True
[...]
$
1. https://www.boost.org/doc/libs/1_62_0/libs/python/doc/html/tutorial/tutorial/embedding.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With python3 the `python` ledger command wound up loading the ledger
module shared library rather than using the builtin module as intended.
This resulted in duplicated initialization and crashing on cleanup. It
was also visible as duplicate converter warnings when importing ledger:
$ ./ledger --no-pager python
Python 3.7.5 (default, Nov 20 2019, 09:21:52)
[...]
>>> import ledger
/usr/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: to-Python converter for boost::posix_time::ptime already registered; second conversion method ignored.
[...]
/usr/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: to-Python converter for ledger::xact_t already registered; second conversion method ignored.
[...]
>>> ledger
<module 'ledger' from '/home/q/src/ledger/ledger.so'>
>>> exit()
Segmentation fault (core dumped)
After this change:
Python 3.7.5 (default, Nov 20 2019, 09:21:52)
[...]
>>> import ledger
>>> ledger
<module 'ledger' (built-in)>
>>> exit()
$
Switches to PyImport_AppendInittab from python::detail::init_module
because 1) that is what the boost docs and examples show and 2)
init_module appears to be undocumented and not intended for outside use.
Fixes #1867
|
|
|
|
|
|
|
|
|
|
| |
Ensure strings passed to Py_Main have a terminating null character by
including the extra character allocated for terminating null in the size
passed to mbstowcs.
Fix argv index so all arguments are not copied to argv[0]. Fixes
potential buffer overflow due to passing argv[0] as destination with
argv[i + 1] src and size to mbstowcs.
|
|
|
|
|
|
| |
This was changed to be specific to the author's local TZ in 139beba.
With the test TZ override fixed, revert this back to the value that is
correct across all environments (including travis).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was regressed in 139beba which set `PYTHONUNBUFFERED` to fix other
test issues. When setting multiple environment variables in this way
they need to be delimited with semicolons rather than spaces. As it is
`PYTHONUNBUFFERED` is being set to `1 TZ=America/Chicago`. The CMake docs
are not as clear about this as they probably should be.
This can be verified by throwing together a CTestTestfile.cmake:
add_test(incorrect_env "printenv" "PYTHONUNBUFFERED" "TZ")
set_tests_properties(incorrect_env PROPERTIES ENVIRONMENT "PYTHONUNBUFFERED=1 TZ=America/Chicago")
add_test(correct_env "printenv" "PYTHONUNBUFFERED" "TZ")
set_tests_properties(correct_env PROPERTIES ENVIRONMENT "PYTHONUNBUFFERED=1;TZ=America/Chicago")
When run with `ctest -V`:
1: Test command: /usr/bin/printenv "PYTHONUNBUFFERED" "TZ"
1: Environment variables:
1: PYTHONUNBUFFERED=1 TZ=America/Chicago
1: Test timeout computed to be: 10000000
1: 1 TZ=America/Chicago
1/2 Test #1: incorrect_env ....................***Failed 0.00 sec
test 2
Start 2: correct_env
2: Test command: /usr/bin/printenv "PYTHONUNBUFFERED" "TZ"
2: Environment variables:
2: PYTHONUNBUFFERED=1
2: TZ=America/Chicago
2: Test timeout computed to be: 10000000
2: 1
2: America/Chicago
2/2 Test #2: correct_env ...................... Passed 0.00 sec
|
| |
|
|
|
|
| |
Fixes #1868
|
|
|
|
| |
Thanks to Daraul Harris for pointing out this out-of-date info.
|
|
|
|
|
|
|
| |
This fixes #1833 for me. @jwiegley said it's reasonable change, and
nobody else took action so here it goes.
The patch is the same as proposed originally, modulo whitespace.
|
| |
|
| |
|
|
|
|
|
| |
There is no longer a submodule which provides elisp, so the `cp` portion of this expression fails.
Also remove obsolete comment about presence of gitmodules.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
python3 has buffered output by default, hence testcase option_py
returned no output when executed under test harness. I think this is a
real problem in the way python interpreter is embeded, and i.e. stdout
is not flushed until after test case has died. However, running things
unbuffered seems to make everything work.
But for some reason I had to adjust 1057.test slightly. I have no idea
what those numbers mean, and if running things unbuffered break stuff.
|
|
|
|
|
| |
This joins together lots of the same underlying, averaging the reported price
and using the date of the oldest lot.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
[ci skip]
|
| |
|
| |
|
| |
|
| |
|