Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pad directive not being fully converted #33

Open
gsingh93 opened this issue Apr 9, 2022 · 10 comments
Open

pad directive not being fully converted #33

gsingh93 opened this issue Apr 9, 2022 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@gsingh93
Copy link

gsingh93 commented Apr 9, 2022

If I have this in beancount:

2022-01-01 pad Assets:US:Chase:Checking Equity:Opening-Balances
2022-04-07 balance Assets:US:Chase:Checking 1000.00 USD

This tool outputs:

;; Pad: 2022-01-01 Assets:US:Chase:Checking Equity:Opening-Balances

2022-01-01 (Padding inserted for Balance of 1000.00 USD for difference 1000.00 USD)
  Assets:US:Chase:Checking                                      1000.00 USD

I expecting the output to also contain Equity:Opening-Balances -1000.00 USD, but this was missing and this causes the transaction to not balance.

@tbm
Copy link
Collaborator

tbm commented Apr 10, 2022

Thanks

@tbm tbm added the bug Something isn't working label Apr 14, 2022
@tbm tbm self-assigned this Apr 14, 2022
@tbm
Copy link
Collaborator

tbm commented Apr 14, 2022

Thanks, this revealed both a bug (the issue you pointed out) and a nicer way to do this (ledger has balance assignments, after all).

I'll get this done soon.

@tbm tbm closed this as completed in d773a0e Apr 22, 2022
@tbm
Copy link
Collaborator

tbm commented Apr 22, 2022

@gsingh93 sorry for the delay. I think the new behaviour is much better. Can you please give this a try and report any issues you see?

@tbm
Copy link
Collaborator

tbm commented Apr 22, 2022

Thanks, this revealed both a bug (the issue you pointed out) and a nicer way to do this (ledger has balance assignments, after all).

I've implemented the nicer way of doing things (using balance assignments), but I haven't looked at the underlying bug (which is no relevant here but which might still be relevant in other scenarios). Reopning for now.

@tbm tbm reopened this Apr 22, 2022
@tbm
Copy link
Collaborator

tbm commented Apr 28, 2022

@gsingh93 did you have a chance to test this change?

@gsingh93
Copy link
Author

Hi, sorry for the delayed response. I just got some time to test this, but I'm unable to install the package from Github. I'm testing this on macOS with Python 3.9. After uninstalling the currently released version, I ran this:

python3 -m pip install git+https://github.com/beancount/beancount2ledger

and I get this output:

Building wheels for collected packages: beancount2ledger
  Building wheel for beancount2ledger (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for beancount2ledger (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [43 lines of output]
      /usr/local/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/config/setupcfg.py:459: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/beancount2ledger
      copying beancount2ledger/hledger.py -> build/lib/beancount2ledger
      copying beancount2ledger/ledger.py -> build/lib/beancount2ledger
      copying beancount2ledger/__init__.py -> build/lib/beancount2ledger
      copying beancount2ledger/cli.py -> build/lib/beancount2ledger
      copying beancount2ledger/common.py -> build/lib/beancount2ledger
      running egg_info
      creating beancount2ledger.egg-info
      writing beancount2ledger.egg-info/PKG-INFO
      writing dependency_links to beancount2ledger.egg-info/dependency_links.txt
      writing entry points to beancount2ledger.egg-info/entry_points.txt
      writing requirements to beancount2ledger.egg-info/requires.txt
      writing top-level names to beancount2ledger.egg-info/top_level.txt
      writing manifest file 'beancount2ledger.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files found matching '.travis.yml'
      adding license file 'LICENSE'
      writing manifest file 'beancount2ledger.egg-info/SOURCES.txt'
      installing to build/bdist.macosx-12-x86_64/wheel
      running install
      running install_lib
      creating build/bdist.macosx-12-x86_64
      creating build/bdist.macosx-12-x86_64/wheel
      creating build/bdist.macosx-12-x86_64/wheel/beancount2ledger
      copying build/lib/beancount2ledger/hledger.py -> build/bdist.macosx-12-x86_64/wheel/beancount2ledger
      copying build/lib/beancount2ledger/ledger.py -> build/bdist.macosx-12-x86_64/wheel/beancount2ledger
      copying build/lib/beancount2ledger/__init__.py -> build/bdist.macosx-12-x86_64/wheel/beancount2ledger
      copying build/lib/beancount2ledger/cli.py -> build/bdist.macosx-12-x86_64/wheel/beancount2ledger
      copying build/lib/beancount2ledger/common.py -> build/bdist.macosx-12-x86_64/wheel/beancount2ledger
      running install_data
      creating build/bdist.macosx-12-x86_64/wheel/beancount2ledger-1.4.dev21+gd773a0e.data
      creating build/bdist.macosx-12-x86_64/wheel/beancount2ledger-1.4.dev21+gd773a0e.data/data
      creating build/bdist.macosx-12-x86_64/wheel/beancount2ledger-1.4.dev21+gd773a0e.data/data/share
      creating build/bdist.macosx-12-x86_64/wheel/beancount2ledger-1.4.dev21+gd773a0e.data/data/share/man
      creating build/bdist.macosx-12-x86_64/wheel/beancount2ledger-1.4.dev21+gd773a0e.data/data/share/man/man1
      error: can't copy 'docs/beancount2ledger.1': doesn't exist or not a regular file
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for beancount2ledger
Failed to build beancount2ledger
ERROR: Could not build wheels for beancount2ledger, which is required to install pyproject.toml-based projects

@simonmichael
Copy link

simonmichael commented Jan 20, 2023

Workarounds: install scdoc, and manually make docs/beancount2ledger.1 docs/beancount2ledger.5 before pip install .

@fterrier
Copy link

I can confirm that the pad directive gets correctly handled using a package built directly from head

@tbm
Copy link
Collaborator

tbm commented Jul 28, 2023

@fterrier out of interest, what do you use beancount2ledger for?

I have to find time and work on the outstanding issues...

@fterrier
Copy link

fterrier commented Jul 28, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants