Skip to content

test-driver: add mypy support#73033

Merged
Mic92 merged 1 commit intoNixOS:masterfrom
Mic92:mypy
Nov 12, 2019
Merged

test-driver: add mypy support#73033
Mic92 merged 1 commit intoNixOS:masterfrom
Mic92:mypy

Conversation

@Mic92
Copy link
Copy Markdown
Member

@Mic92 Mic92 commented Nov 8, 2019

It's a good idea to expand this in future to test code as well,
so we get type checking there as well.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@Mic92
Copy link
Copy Markdown
Member Author

Mic92 commented Nov 8, 2019

Tested running borgbackup.nix

@Mic92
Copy link
Copy Markdown
Member Author

Mic92 commented Nov 8, 2019

cc @worldofpeace @flokli @marijanp

@ofborg ofborg bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Nov 8, 2019
@marijanp
Copy link
Copy Markdown
Contributor

marijanp commented Nov 8, 2019

@tfc

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Nov 8, 2019
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe bring the correct type forward, so m = bool(re.search(regex, text)) instead of the return m is not None

Copy link
Copy Markdown
Contributor

@marijanp marijanp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mic92 I'm getting a Syntax Error in test-driver.py with your changes: SyntaxError: annotated name 'log' can't be global. (line 786)
Edit: It seems to be caused by the forward references. After commenting it out I don't get the syntax error anymore.

@Mic92
Copy link
Copy Markdown
Member Author

Mic92 commented Nov 11, 2019

@marijanp fixed

It's a good idea to expand this in future to test code as well,
so we get type checking there as well.
@Mic92
Copy link
Copy Markdown
Member Author

Mic92 commented Nov 12, 2019

@GrahamcOfBorg test borgbackup

@Mic92 Mic92 merged commit 550f508 into NixOS:master Nov 12, 2019
@Mic92 Mic92 deleted the mypy branch November 12, 2019 15:43
@domenkozar
Copy link
Copy Markdown
Member

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants