summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-02-13 02:36:20 +0100
committerGitHub <noreply@github.com>2021-02-13 02:36:20 +0100
commit1ca7cd20ace967b3740893231e1586069e223af5 (patch)
treee54d1f3cd7636e9bbde0a6d407d2d8ba082e5e89 /pkgs
parent279ce4bbed3c7e00ea2a8530fff138669dbca687 (diff)
parentd999a09b24679eb468308693b96660f23a48d63f (diff)
downloadnixpkgs-1ca7cd20ace967b3740893231e1586069e223af5.tar
nixpkgs-1ca7cd20ace967b3740893231e1586069e223af5.tar.gz
nixpkgs-1ca7cd20ace967b3740893231e1586069e223af5.tar.bz2
nixpkgs-1ca7cd20ace967b3740893231e1586069e223af5.tar.lz
nixpkgs-1ca7cd20ace967b3740893231e1586069e223af5.tar.xz
nixpkgs-1ca7cd20ace967b3740893231e1586069e223af5.tar.zst
nixpkgs-1ca7cd20ace967b3740893231e1586069e223af5.zip
Merge pull request #112949 from SuperSandro2000/codespell
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/aspell-python/default.nix31
-rw-r--r--pkgs/development/python-modules/codespell/default.nix32
-rw-r--r--pkgs/top-level/python-packages.nix2
3 files changed, 49 insertions, 16 deletions
diff --git a/pkgs/development/python-modules/aspell-python/default.nix b/pkgs/development/python-modules/aspell-python/default.nix
new file mode 100644
index 00000000000..1d6c7b45d15
--- /dev/null
+++ b/pkgs/development/python-modules/aspell-python/default.nix
@@ -0,0 +1,31 @@
+{ lib, buildPythonPackage, fetchPypi, isPy27, aspell, aspellDicts, python }:
+
+buildPythonPackage rec {
+  pname = "aspell-python";
+  version = "1.15";
+  disabled = isPy27;
+
+  src = fetchPypi {
+    inherit version;
+    pname = "aspell-python-py3";
+    extension = "tar.bz2";
+    sha256 = "13dk3jrvqmfvf2w9b8afj37d8bh32kcx295lyn3z7r8qch792hi0";
+  };
+
+  buildInputs = [ aspell ];
+
+  checkPhase = ''
+    export ASPELL_CONF="dict-dir ${aspellDicts.en}/lib/aspell"
+    export HOME=$(mktemp -d)
+    ${python.interpreter} test/unittests.py
+  '';
+
+  pythonImportsCheck = [ "aspell" ];
+
+  meta = with lib; {
+    description = "Python wrapper for aspell (C extension and python version)";
+    homepage = "https://github.com/WojciechMula/aspell-python";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ SuperSandro2000 ];
+  };
+}
diff --git a/pkgs/development/python-modules/codespell/default.nix b/pkgs/development/python-modules/codespell/default.nix
index 7efb08c2c67..e1aa8252d13 100644
--- a/pkgs/development/python-modules/codespell/default.nix
+++ b/pkgs/development/python-modules/codespell/default.nix
@@ -1,31 +1,31 @@
-{ lib, buildPythonApplication, fetchPypi, pytest, chardet }:
+{ lib, buildPythonApplication, fetchFromGitHub, pytestCheckHook, pytest-cov, pytest-dependency, aspell-python, aspellDicts, chardet }:
 
 buildPythonApplication rec {
   pname = "codespell";
   version = "2.0.0";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "dd9983e096b9f7ba89dd2d2466d1fc37231d060f19066331b9571341363c77b8";
+  src = fetchFromGitHub {
+    owner = "codespell-project";
+    repo = "codespell";
+    rev = "v${version}";
+    sha256 = "187g26s3wzjmvdx9vjabbnajpbg0s9klixyv6baymmgz9lrcv4ln";
   };
 
-  # no tests in pypi tarball
-  doCheck = false;
-  checkInputs = [ pytest chardet ];
-  checkPhase = ''
-    # We don't want to be affected by the presence of these
-    rm -r codespell_lib setup.cfg
-    # test_command assumes too much about the execution environment
-    pytest --pyargs codespell_lib.tests -k "not test_command"
+  checkInputs = [ aspell-python chardet pytestCheckHook pytest-cov pytest-dependency ];
+
+  preCheck = ''
+    export ASPELL_CONF="dict-dir ${aspellDicts.en}/lib/aspell"
   '';
 
+  # tries to run not rully installed script
+  disabledTests = [ "test_command" ];
+
   pythonImportsCheck = [ "codespell_lib" ];
 
-  meta = {
+  meta = with lib; {
     description = "Fix common misspellings in source code";
     homepage = "https://github.com/codespell-project/codespell";
-    license = with lib.licenses; [ gpl2 cc-by-sa-30 ];
-    maintainers = with lib.maintainers; [ johnazoidberg ];
-    platforms = lib.platforms.all;
+    license = with licenses; [ gpl2Only cc-by-sa-30 ];
+    maintainers = with maintainers; [ johnazoidberg SuperSandro2000 ];
   };
 }
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 17f6624c42e..cc0ab7e8c8f 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -461,6 +461,8 @@ in {
 
   asn1crypto = callPackage ../development/python-modules/asn1crypto { };
 
+  aspell-python = callPackage ../development/python-modules/aspell-python { };
+
   aspy-yaml = callPackage ../development/python-modules/aspy.yaml { };
 
   asteval = callPackage ../development/python-modules/asteval { };