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

coursera-dl: init at 0.10.0 #39338

Merged
merged 1 commit into from Apr 24, 2018
Merged

coursera-dl: init at 0.10.0 #39338

merged 1 commit into from Apr 24, 2018

Conversation

alexfmpe
Copy link
Member

Motivation for this change

New package

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.

@Mic92
Copy link
Member

Mic92 commented Apr 22, 2018

@GrahamcOfBorg build coursera-dl

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: coursera-dl

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: coursera-dl

Partial log (click to expand)

reading manifest file 'coursera_dl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'coursera_dl.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/290wcfaaacwf2yiqqjyggpqz5byfin2p-coursera-dl-0.10.0

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: coursera-dl

Partial log (click to expand)

reading manifest file 'coursera_dl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'coursera_dl.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/ld398h1y23xldsywm6fs29zkk6594ngz-coursera-dl-0.10.0

@Mic92
Copy link
Member

Mic92 commented Apr 22, 2018

The following will enable tests:

diff --git a/pkgs/applications/misc/coursera-dl/default.nix b/pkgs/applications/misc/coursera-dl/default.nix
index 1f5d7107aa4..419d91c5709 100644
--- a/pkgs/applications/misc/coursera-dl/default.nix
+++ b/pkgs/applications/misc/coursera-dl/default.nix
@@ -1,8 +1,7 @@
-{ stdenv, fetchFromGitHub, fetchurl, pandoc, python2 }:
+{ stdenv, fetchFromGitHub, fetchurl, pandoc, python3, glibcLocales }:
 let
-  pythonPackages = python2.pkgs;
-
+  pythonPackages = python3.pkgs;
 in pythonPackages.buildPythonApplication rec {
   name = "coursera-dl-${version}";
   version = "0.10.0";
@@ -14,10 +13,23 @@ in pythonPackages.buildPythonApplication rec {
     sha256 = "0m3f6ly8c3mkb8yy2y398afswqgy17rz159s1054wzxpb4f85zlb";
   };
-  buildInputs = with pythonPackages; [ beautifulsoup4 ConfigArgParse keyring mock pandoc pytest requests urllib3 ];
+  nativeBuildInputs = with pythonPackages; [ pandoc ];
+
+  buildInputs = [ glibcLocales ];
   propagatedBuildInputs = with pythonPackages; [ beautifulsoup4 ConfigArgParse keyring pyasn1 requests six urllib3 ];
+  checkInputs = with pythonPackages; [ pytest mock ];
+
+  preConfigure = ''
+    export LC_ALL=en_US.utf-8
+  '';
+
+  checkPhase = ''
+    # requires dbus service
+    py.test -k 'not test_get_credentials_with_keyring' .
+  '';
+
   meta = with stdenv.lib; {
     description = "CLI for downloading Coursera.org videos and naming them";
     homepage = https://github.com/coursera-dl/coursera-dl;

@alexfmpe
Copy link
Member Author

Thanks. I updated the PR with your feedback.
That fixes the UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 under python 3, but I do get a warning in NixOS:
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)

@Mic92
Copy link
Member

Mic92 commented Apr 24, 2018

This is probably related to: #38991

@Mic92
Copy link
Member

Mic92 commented Apr 24, 2018

@GrahamcOfBorg build coursera-dl

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: coursera-dl

Partial log (click to expand)

coursera/test/test_credentials.py .......                                [ 44%]
coursera/test/test_downloaders.py ....................                   [ 58%]
coursera/test/test_filter.py .                                           [ 58%]
coursera/test/test_parsing.py sss.                                       [ 61%]
coursera/test/test_utils.py ....................................ss..s... [ 91%]
                                                                         [ 91%]
coursera/test/test_workflow.py ............                              [100%]

============= 137 passed, 9 skipped, 1 deselected in 1.71 seconds ==============
/nix/store/cpnx241pdrmhvrwaracf639wc9p5a04z-coursera-dl-0.10.0

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: coursera-dl

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: coursera-dl

Partial log (click to expand)

coursera/test/test_credentials.py .......                                [ 44%]
coursera/test/test_downloaders.py ....................                   [ 58%]
coursera/test/test_filter.py .                                           [ 58%]
coursera/test/test_parsing.py sss.                                       [ 61%]
coursera/test/test_utils.py ....................................ss..s... [ 91%]
                                                                         [ 91%]
coursera/test/test_workflow.py ............                              [100%]

============= 137 passed, 9 skipped, 1 deselected in 1.51 seconds ==============
/nix/store/vh4pg1825lvr99385fb9gg1b0f8i3556-coursera-dl-0.10.0

@Mic92 Mic92 merged commit 04a15a6 into NixOS:master Apr 24, 2018
@alexfmpe alexfmpe deleted the coursera-dl branch May 11, 2018 13:40
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