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

aenum: make tests pass #33805

Merged
merged 2 commits into from Jan 16, 2018
Merged

aenum: make tests pass #33805

merged 2 commits into from Jan 16, 2018

Conversation

yrashk
Copy link
Contributor

@yrashk yrashk commented Jan 12, 2018

For Python 2, tests were failing because they depended on a particular
way of executing the tests module as it defined a global variable
and created a temporary file. Running it through setup.py didn't work.
Invoking it directly solved the issue.

For Python 3, aenum tests were disabled, however, they did't have to
fail. Configuring UTF8 locale resolved the failure that was happening
after the above fix for Python 2 was applied.

Motivation for this change

Couldn't build another derivation that had to depend on aenum, even on Python 2, as the tests were failing.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

I tried to use nox-review wip, however, I got a failure on the dbf derivation, however, at least for me, building dbf fails for Python 2.7 on master nixpkgs anyway (because aenum's tests fail). Any advice on this will be highly appreciated.

cc @vrthra

For Python 2, tests were failing because they depended on a particular
way of executing the tests module as it defined a global variable
and created a temporary file. Running it through setup.py didn't work.
Invoking it directly solved the issue.

For Python 3, aenum tests were disabled, however, they did't have to
fail. Configuring UTF8 locale resolved the failure that was happening
after the above fix for Python 2 was applied.

checkPhase = ''
runHook preCheck
${if isPy3k then "export LC_ALL=en_US.UTF-8" else ""}
Copy link
Member

@Mic92 Mic92 Jan 13, 2018

Choose a reason for hiding this comment

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

You can export this unconditionally. It won't hurt on python2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I get that. The reason to do it this way was to be more indicative of the fact that this tweak is ONLY necessary on Python 3 and avoid signalling that maybe Python 2 requires that, too.

@Mic92 Mic92 merged commit 91e9989 into NixOS:master Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants