summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Simple whitespace fixJohn Wiegley2020-03-271-1/+1
|
* Add link to Babel documentationMartin Michlmayr2020-03-271-3/+4
| | | | Fixes #1690
* require passing Python3 CIAndy Clayton2020-03-271-4/+0
|
* py3: ensure python output is not lostAndy Clayton2020-03-263-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* py3: fix builtin ledger module for python commandAndy Clayton2020-03-261-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* fix python3 command (argv) wchar_t conversionAndy Clayton2020-03-261-4/+6
| | | | | | | | | | 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.
* Revert expected test time value to correct valueAndy Clayton2020-03-251-1/+1
| | | | | | 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).
* fix setting TZ in testsAndy Clayton2020-03-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* docs: mention ! as an alternative to notMartin Michlmayr2020-03-191-1/+1
|
* docs: avoid confusion about types of operatorsMartin Michlmayr2020-03-191-1/+1
| | | | Fixes #1868
* Update branch informationMartin Michlmayr2020-03-111-3/+1
| | | | Thanks to Daraul Harris for pointing out this out-of-date info.
* Specify namespace of uintmax_takater2020-03-033-6/+6
| | | | | | | 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.
* Allow building dependencies on ubuntu-eoanDaraul2020-01-221-1/+18
|
* fix #1850: segfault when using ledger printTobias Pankrath2020-01-081-1/+1
|
* Remove reference to lisp from default.nixSteve Purcell2019-12-271-9/+0
| | | | | 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.
* Add test for --average-lot-pricesMartin Michlmayr2019-12-252-1/+16
|
* test: split value_py.test into py2/py3 versions.Dimitri John Ledkov2019-12-073-0/+32
|
* test: No baseline tests for average-lot-pricesDimitri John Ledkov2019-12-071-0/+1
|
* Allowed Python3 jobs to fail temporarilyJohn Wiegley2019-12-061-0/+4
|
* test: Unbreak one more test case with python3 bridgeDimitri John Ledkov2019-12-063-5/+5
| | | | | | | | | | | 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.
* Add --averaged-lot-pricesJohn Wiegley2019-12-064-0/+81
| | | | | This joins together lots of the same underlying, averaging the reported price and using the date of the oldest lot.
* travis: use the same python executable, as found by cmakeDimitri John Ledkov2019-12-061-1/+1
|
* Port to python3Dimitri John Ledkov2019-12-058-17/+63
|
* Remove dependency on other testAlexis Hildebrandt2019-12-051-3/+3
|
* Make tests scripts Python 3 compatibleAlexis Hildebrandt2019-12-0515-81/+137
|
* Use print functionOndřej Kuzník2019-12-052-8/+12
| | | | [ci skip]
* Enable py2 & py3 buildsDimitri John Ledkov2019-12-052-5/+9
|
* Modernize CMake using backported FindPython module.Dimitri John Ledkov2019-12-055-79/+28
|
* Adjust FindPython/Support.cmake for backportDimitri John Ledkov2019-12-051-1/+5
|
* Cherrypick FindPython module from cmake 3.15, introduced in 3.12.Dimitri John Ledkov2019-12-055-0/+2607
|
* Format annotations using format that can be parsedOleg Bulatov2019-11-276-6/+8
| | | | | | | | | | | | | | | | | I expect an output of `ledger print` to be consumable by ledger. But on the next journal ``` 2019/11/25 * test Foo 1 AAPL {1.00 EUR} [2019/11/24] Bar ``` it prints [19-Nov-24], which it does not understand with default options. With this patch it prints [2019/11/24].
* Add note regarding $account under --strict or --pedantic modesEnrico Lamperti2019-11-161-0/+6
| | | | | | | This change adds a warning in the documentation for users using automated transactions with `--strict` or `--pedantic`, as ledger will throw an error when `$account` is not defined explicitly (see #545).
* Fix a typo in the documentationChristian Egli2019-10-251-3/+4
| | | | | and add some cross references to more detailed documentation and examples.
* Correction to the way parens are parsed in query expressionsJohn Wiegley2019-09-172-9/+47
|
* Add Conda installation instructions to the READMETravis Wrightsman2019-09-091-0/+7
|
* Merge pull request #1819 from CandyAngel/know-ification_fixJohn Wiegley2019-08-283-22/+14
|\ | | | | Remove know-ification of elements due to post state
| * Remove know-ification of elements due to post stateCandyAngel2019-08-273-22/+14
|/
* Fix typosChen Rotem Levy2019-08-231-2/+2
|
* Switch from using utf8::is_bom to utf8::starts_with_bom (#1817)John Wiegley2019-08-191-1/+3
|\ | | | | Switch from using utf8::is_bom to utf8::starts_with_bom
| * Switch from using utf8::is_bom to utf8::starts_with_bomJohn Wiegley2019-08-181-1/+3
|/ | | | Fixes #1816
* option: fix typo in error messageChristian Dietrich2019-08-011-1/+1
|
* Remove use of balance --average since it doesn't work (#1810)John Wiegley2019-07-151-1/+1
|\ | | | | Remove use of balance --average since it doesn't work
| * Remove use of balance --average since it doesn't workRyan Nowakowski2019-07-151-1/+1
|/ | | | | | Currently the docs recommend the use of balance --average to help generate a budget. Apparently that doesn't work. Instead use the register command with --average.
* fix typo (#1808)John Wiegley2019-07-141-1/+1
|\ | | | | fix typo
| * fix typoliqlvnvn2019-07-141-1/+1
|/ | | Common misspelling of aforementioned.
* Change --invert to invert displayed amounts and totals, not amo… (#1804)John Wiegley2019-07-052-10/+2
|\ | | | | Change --invert to invert displayed amounts and totals, not amounts
| * Remove an unneeded commentJohn Wiegley2019-07-051-9/+0
| |
| * Change --invert to invert displayed amounts and totals, not amountsJohn Wiegley2019-07-051-1/+2
|/
* Add support for '%F' date format specifierMichael Budde2019-04-023-7/+31
| | | | | | | | | '%F' is equivalent to '%Y-%m-%d'. Using the '%F' format without this change this would not give any hard errors but instead give dates with wrong years because the 'has_year' trait would not be correctly detected and thus parsed dates would get set to the current year. Fixes #1775
* Remove dead codeMichael Budde2019-04-021-9/+0
|