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
ledger-autosync: init at 1.0.0 #53261
Conversation
Also your commit messages should be formatted like
See: https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md#submitting-changes |
Force push or new pr? |
Force push for sure, though I would do all of that after you're sure you've addressed the review. |
Yeah I was planning on resolving everything and then squashing into commits with the proper names after everything was resolved. Fixes coming after I finish work today. |
@worldofpeace could you take a look at this one more time before I squash into properly named commits? |
I looked at the source code and they want either the Though I'm not sure if users would want both of them? I did notice that there's both Also I figured a way to get tests "working" after reading https://github.com/egh/ledger-autosync/tree/ddb24c11c26ee36b4b96eac31665eda0d34621e6#testing Adding
should work. |
I opened an issue yesterday about the license inconsistency in ledger-autosync. The author responded and confirmed that is is in fact GPL3 egh/ledger-autosync#60 (comment) |
I did this but also ran it against ledger. The two programs differ in output, but ledger-autosync can talk to them both. I think its best to test against both as the default test suite does. |
@worldofpeace thanks for all your feedback on this. I've learned a lot! Can I get a final thumbs-up before I squash and force-push? |
# Checks require ledger as a python package, | ||
# ledger does not support python3 while ledger-autosync requires it. | ||
checkInputs = with python3Packages; [ ledger hledger nose mock ]; | ||
checkPhase = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get a comment here also stating that we've omitted the ledger-python
tests because they're broken?
It's for the same reason stated above but it's not obvious we're omitting a test here.
@eamsden You're very welcome 😄 One concern left unaddressed is
We'd like to explicitly declare this dependency and not rely on any global state. So what we could do is add an optional parameter to Maybe like? diff --git a/pkgs/applications/office/ledger-autosync/default.nix b/pkgs/applications/office/ledger-autosync/default.nix
index 4cddf5c904b..98f90934de8 100644
--- a/pkgs/applications/office/ledger-autosync/default.nix
+++ b/pkgs/applications/office/ledger-autosync/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python3Packages, fetchFromGitHub, ledger, hledger }:
+{ stdenv, python3Packages, fetchFromGitHub, ledger, hledger, withLedger ? true, withHledger ? false }:
python3Packages.buildPythonApplication rec {
pname = "ledger-autosync";
@@ -31,7 +31,8 @@ python3Packages.buildPythonApplication rec {
pycparser
secretstorage
six
- ];
+ ] ++ stdenv.lib.optionals withLedger [ ledger ]
+ ++ stdenv.lib.optionals withHledger [ hledger ];
# Checks require ledger as a python package,
# ledger does not support python3 while ledger-autosync requires it. Though I think that could look simpler. |
I'm having trouble finding documentation for the |
They could do this on NixOS for example environment.systemPackages = [
(pkgs.ledger-autosync.override {
withLedger = false;
withHledger = true;
})
]; |
Would it be ok to take ledger and hledger as arguments, but check if they are non-null before adding them to the dependency list? Then the user could opt against either by overriding e.g. |
But we need both for the checks... |
Right. OK I'll put in the flag inputs a bit later today. |
Conflict with master here is 4094d4c because other prs were needing this. |
Sorry to take so long ot get back on to this. I added the flags and merged with master to pick up the fuzzywuzzy derivation there. @worldofpeace |
e31e909
to
92713b4
Compare
@GrahamcOfBorg build ledger-autosync |
@eamsden Finished that up for you 😄 Thanks for contributing. |
Motivation for this change
ledger-autosync is a useful utility for ledger and hledger which allows journal files to be synchronized with OFX and CSV transaction data without duplication.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)