-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
pythonPackages.toggl-cli: init at 2.1.0 (and its dependencies) #63092
Conversation
@GrahamcOfBorg build pythonPackages.togglCli |
@GrahamcOfBorg build python3Packages.togglCli |
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.
Hi @mmahut, what follows is a general review and then a more detailed
one for each commit.
Each package should reference its depedencies directly instead of
using pythonPackages
. And in general we need to enable tests
which may require fetching from github.
pythonPackages.PTable: init at 0.9.2
Please normalize the attribute name to ptable
and also pname
.
note you'll need to manually give fetchPypi
the non normalized pname
The commit msg should reflect this change.
Also we should build from the latest commit on GitHub, see kxxoling/PTable#27.
You'll then will be able to enable the tests.
pythonPackages.inquirer: init at 2.6.3
Please enable tests.
Looking at requirements-dev.txt and the Makefile will be helpful.
pythonPackages.readchar: init at 2.0.1
Fetching from PyPi's wheels appear to be to complex and it won't be automatically updated.
Please use fetchFromGitHub
and enable tests. The setup_requires
will need to be in nativeBuildInputs
btw.
pythonPackages.validate_email: init at 1.3
Please normalize the attribute name to validate-email
and also pname
.
The commit msg should reflect this change.
pythonPackages.togglCli: init at 2.1.0
Please normalize the attribute name to toggle-cli
and also pname
.
The commit msg should reflect this change.
We also need to correct the dependency declaration for the setup_requires
pbr
and twine
.
They should be nativeBuildInputs
and pbr
should also be a checkInputs
because we need it for tests.
And on the topic of tests we should enable them.
Adding pythonPackages.{togglCli,validate_email,readchar,PTable,inquirer}
Unfortunately this is going to require some git rewriting because each commit that
init
s should also add itself to python-packages.nix
.
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.
I've built everything successfully for all interpreters in nixpkgs ❇️
Managed to fix the tests for toggl-cli
by skipping one's that still somehow needed network access
(probably needs to be fixed upstream)
diff --git a/pkgs/development/python-modules/toggl-cli/default.nix b/pkgs/development/python-modules/toggl-cli/default.nix
index c44b42b6f2a..5c851fdb475 100644
--- a/pkgs/development/python-modules/toggl-cli/default.nix
+++ b/pkgs/development/python-modules/toggl-cli/default.nix
@@ -24,11 +24,18 @@ buildPythonPackage rec {
nativeBuildInputs = [ pbr twine ];
checkInputs = [ pbr pytest pytestcov pytest-mock faker factory_boy ];
- # FIXME: fix tests
- doCheck = false;
+ preCheck = ''
+ export TOGGL_API_TOKEN=your_api_token
+ export TOGGL_PASSWORD=toggl_password
+ export TOGGL_USERNAME=user@example.com
+ '';
checkPhase = ''
- pytest -m "not premium" tests/unit
+ runHook preCheck
+
+ pytest -k "not premium and not TestDateTimeType and not TestDateTimeField" tests/unit --maxfail=20
+
+ runHook postCheck
'';
propagatedBuildInputs = [
Also pr'd something for the readchar pin in inquirer magmax/python-inquirer#77
Following comments are just some expression cleanup.
@worldofpeace you are amazing - thank you for your review! Pushed the new changes. |
Great work here @mmahut ✨ I think this is complete, can you squash the commits? |
The package name has been normalized to ptable from PTable.
The package name has been normalized to validate-email from validate_email.
@worldofpeace thank you! Done! |
Motivation for this change
And its dependencies:
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)