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

RFC: billwarrior install command #11

Open
jonafato opened this issue Sep 15, 2021 · 1 comment
Open

RFC: billwarrior install command #11

jonafato opened this issue Sep 15, 2021 · 1 comment

Comments

@jonafato
Copy link
Contributor

TL;DR: I'm proposing a billwarrior install command to copy config files into the proper locations instead of keeping this logic in setup.py.

Currently, billwarrior writes some config files via setup.py. This is a bit tricky, because according to the Python docs the data_files key is not meant for arbitrary installation locations (see below).

The directory should be a relative path. It is interpreted relative to the installation prefix (Python’s sys.prefix for system installations; site.USER_BASE for user installations). Distutils allows directory to be an absolute installation path, but this is discouraged since it is incompatible with the wheel packaging format.

Because of this limitation, relying on setup.py for putting files in the right place on the system limits distribution options. I'm opening this issue to suggest a new CLI command billwarrior install, which would do the following:

  1. Create the sample config file
  2. Copy the sample invoice templates to their proper location (failing or prompting if this action would overwrite an existing file)
  3. Install the billwarrior extension to the proper path by detecting the user's extensions path via timew extensions (this is detailed as a TODO in the readme, and I think it makes sense to include here)

I'm happy to put this together if you're open to the change. I wanted to open an issue first since it's a change to the UI as well as a breaking change to the existing billwarrior CLI script (which would need to get a new command for the existing behavior to accommodate this change).

@sw00
Copy link
Owner

sw00 commented Sep 15, 2021

Yes, I think that makes sense - setup.py should really only deal with package installation and not mess about with paths outside it.

Happy for you to proceed with billwarrior install and thanks for helping out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants