about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2021-05-08 23:01:21 +0100
committerGitHub <noreply@github.com>2021-05-08 23:01:21 +0100
commit83c134bed198f9d38cc08bedab554d8b02b2a9d3 (patch)
tree145c13b18dec0a52e18fe6f31192addb3c5469da /pkgs
parent78c97f07c8b912373b2cb957e6478b0d80ca3bf6 (diff)
parente6d1079b9b9901865e5730127698fd29c6668fc8 (diff)
Merge pull request #121648 from AluisioASG/aasg/jupytext-1.11.2
python3Packages.markdown-it-py: 0.6.2 -> 1.0.0; python3Packages.jupytext: 1.11.0 -> 1.11.2
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/jupytext/default.nix43
-rw-r--r--pkgs/development/python-modules/linkify-it-py/default.nix34
-rw-r--r--pkgs/development/python-modules/markdown-it-py/default.nix31
-rw-r--r--pkgs/development/python-modules/mdit-py-plugins/default.nix35
-rw-r--r--pkgs/development/python-modules/pytest-regressions/default.nix59
-rw-r--r--pkgs/development/python-modules/uc-micro-py/default.nix31
-rw-r--r--pkgs/top-level/python-packages.nix8
7 files changed, 208 insertions, 33 deletions
diff --git a/pkgs/development/python-modules/jupytext/default.nix b/pkgs/development/python-modules/jupytext/default.nix
index eedfcfbcb6e98..e3de451cfe1fa 100644
--- a/pkgs/development/python-modules/jupytext/default.nix
+++ b/pkgs/development/python-modules/jupytext/default.nix
@@ -1,39 +1,52 @@
-{ lib, buildPythonPackage, fetchPypi, isPy27
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, GitPython
+, jupyter-packaging
+, jupyter_client
+, jupyterlab
 , markdown-it-py
+, mdit-py-plugins
 , nbformat
-, pytest
+, notebook
+, pytestCheckHook
 , pyyaml
 , toml
 }:
 
 buildPythonPackage rec {
   pname = "jupytext";
-  version = "1.11.0";
+  version = "1.11.2";
+  format = "pyproject";
 
-  disabled = isPy27;
+  disabled = pythonOlder "3.6";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "9062d001baaa32430fbb94a2c9394ac906db0a58da94e7aa4e414b73fd7d51bc";
+  src = fetchFromGitHub {
+    owner = "mwouts";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-S2SKAC2oT4VIVMMDbu/Puo87noAgnQs1hh88JphutA8=";
   };
 
+  buildInputs = [ jupyter-packaging jupyterlab ];
   propagatedBuildInputs = [
     markdown-it-py
+    mdit-py-plugins
     nbformat
     pyyaml
     toml
   ];
 
   checkInputs = [
-    pytest
+    pytestCheckHook
+    GitPython
+    jupyter_client
+    notebook
   ];
-
-  # requires test notebooks which are not shipped with the pypi release
-  # also, pypi no longer includes tests
-  doCheck = false;
-  checkPhase = ''
-    pytest
-  '';
+  # pre-commit tests require a Git repository.
+  pytestFlagsArray = [ "--ignore-glob='tests/test_pre_commit_*.py'" ];
+  pythonImportsCheck = [ "jupytext" "jupytext.cli" ];
 
   meta = with lib; {
     description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts";
diff --git a/pkgs/development/python-modules/linkify-it-py/default.nix b/pkgs/development/python-modules/linkify-it-py/default.nix
new file mode 100644
index 0000000000000..b9511bd5f35b7
--- /dev/null
+++ b/pkgs/development/python-modules/linkify-it-py/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, pytestCheckHook
+, uc-micro-py
+}:
+
+buildPythonPackage rec {
+  pname = "linkify-it-py";
+  version = "1.0.1";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = "tsutsu3";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-gd51no6VqvIiW9fbCdp30zHG/us6by7FLHV2ul/XJAM=";
+  };
+
+  propagatedBuildInputs = [ uc-micro-py ];
+
+  checkInputs = [ pytestCheckHook ];
+  pythonImportsCheck = [ "linkify_it" ];
+
+  meta = with lib; {
+    description = "Links recognition library with full unicode support";
+    homepage = "https://github.com/tsutsu3/linkify-it-py";
+    license = licenses.mit;
+    maintainers = with maintainers; [ AluisioASG ];
+  };
+}
diff --git a/pkgs/development/python-modules/markdown-it-py/default.nix b/pkgs/development/python-modules/markdown-it-py/default.nix
index c7a8a3e17f3e7..322c4ac533d22 100644
--- a/pkgs/development/python-modules/markdown-it-py/default.nix
+++ b/pkgs/development/python-modules/markdown-it-py/default.nix
@@ -1,41 +1,36 @@
 { lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook, pythonOlder
 , attrs
-, coverage
+, linkify-it-py
 , psutil
 , pytest-benchmark
+, pytest-regressions
+, typing-extensions
 }:
 
 buildPythonPackage rec {
   pname = "markdown-it-py";
-  version = "0.6.2";
+  version = "1.0.0";
+  format = "pyproject";
 
-  disabled = pythonOlder "3.7";
+  disabled = pythonOlder "3.6";
 
   src = fetchFromGitHub {
     owner = "executablebooks";
-    repo = "markdown-it-py";
+    repo = pname;
     rev = "v${version}";
-    sha256 = "1g9p8pdnvjya436lii63r5gjajhmbhmyh9ngbjqf9dqny05nagz1";
+    hash = "sha256-GA7P2I8N+i2ISsVgx58zyhrfKMcZ7pL4X9T/trbsr1Y=";
   };
 
-  propagatedBuildInputs = [ attrs ];
+  propagatedBuildInputs = [ attrs linkify-it-py ]
+    ++ lib.optional (pythonOlder "3.8") typing-extensions;
 
   checkInputs = [
-    coverage
-    pytest-benchmark
     psutil
+    pytest-benchmark
+    pytest-regressions
     pytestCheckHook
   ];
-
-  disabledTests = [
-    # Requires the unpackaged pytest-regressions fixture plugin
-    "test_amsmath"
-    "test_container"
-    "test_deflist"
-    "test_dollarmath"
-    "test_spec"
-    "test_texmath"
-  ];
+  pytestImportsCheck = [ "markdown_it" ];
 
   meta = with lib; {
     description = "Markdown parser done right";
diff --git a/pkgs/development/python-modules/mdit-py-plugins/default.nix b/pkgs/development/python-modules/mdit-py-plugins/default.nix
new file mode 100644
index 0000000000000..9c5705dbc4083
--- /dev/null
+++ b/pkgs/development/python-modules/mdit-py-plugins/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, markdown-it-py
+, pytest-regressions
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "mdit-py-plugins";
+  version = "0.2.8";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = "executablebooks";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-MXQjaVDuguGbmby6BQnrTdpq6Mih3HabXuyFxf9jB18=";
+  };
+
+  propagatedBuildInputs = [ markdown-it-py ];
+
+  checkInputs = [ pytestCheckHook pytest-regressions ];
+  pythonImportsCheck = [ "mdit_py_plugins" ];
+
+  meta = with lib; {
+    description = "Collection of core plugins for markdown-it-py";
+    homepage = "https://github.com/executablebooks/mdit-py-plugins";
+    license = licenses.mit;
+    maintainers = with maintainers; [ AluisioASG ];
+  };
+}
diff --git a/pkgs/development/python-modules/pytest-regressions/default.nix b/pkgs/development/python-modules/pytest-regressions/default.nix
new file mode 100644
index 0000000000000..90b72c886eac7
--- /dev/null
+++ b/pkgs/development/python-modules/pytest-regressions/default.nix
@@ -0,0 +1,59 @@
+{ lib
+, buildPythonPackage
+, fetchpatch
+, fetchPypi
+, pythonOlder
+, matplotlib
+, numpy
+, pandas
+, pillow
+, pytest
+, pytest-datadir
+, pytestCheckHook
+, pyyaml
+, setuptools-scm
+}:
+
+buildPythonPackage rec {
+  pname = "pytest-regressions";
+  version = "2.2.0";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "15a71f77cb266dd4ca94331abe4c339ad056b2b2175e47442711c98cf6d65716";
+  };
+
+  patches = [
+    # Make pytest-regressions compatible with NumPy 1.20.
+    # Should be part of the next release.
+    (fetchpatch {
+      url = "https://github.com/ESSS/pytest-regressions/commit/ffad2c7fd1d110f420f4e3ca3d39d90cae18a972.patch";
+      sha256 = "sha256-bUna7MnMV6u9oEaZMsFnr4gE28rz/c0O2+Hyk291+l0=";
+    })
+  ];
+
+  nativeBuildInputs = [ setuptools-scm ];
+  buildInputs = [ pytest ];
+  propagatedBuildInputs = [ numpy pandas pillow pytest-datadir pyyaml ];
+
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
+  checkInputs = [ pytestCheckHook matplotlib ];
+  pythonImportsCheck = [ "pytest_regressions" "pytest_regressions.plugin" ];
+
+  meta = with lib; {
+    description = "Pytest fixtures to write regression tests";
+    longDescription = ''
+      pytest-regressions makes it simple to test general data, images,
+      files, and numeric tables by saving expected data in a data
+      directory (courtesy of pytest-datadir) that can be used to verify
+      that future runs produce the same data.
+    '';
+    homepage = "https://github.com/ESSS/pytest-regressions";
+    license = licenses.mit;
+    maintainers = with maintainers; [ AluisioASG ];
+  };
+}
diff --git a/pkgs/development/python-modules/uc-micro-py/default.nix b/pkgs/development/python-modules/uc-micro-py/default.nix
new file mode 100644
index 0000000000000..9b20e2251165c
--- /dev/null
+++ b/pkgs/development/python-modules/uc-micro-py/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "uc-micro-py";
+  version = "1.0.1";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = "tsutsu3";
+    repo = "uc.micro-py";
+    rev = "v${version}";
+    hash = "sha256-23mKwoRGjtxpCOC26V8bAN5QEHLDOoSqPeTlUuIrxZ0=";
+  };
+
+  checkInputs = [ pytestCheckHook ];
+  pythonImportsCheck = [ "uc_micro" ];
+
+  meta = with lib; {
+    description = "Micro subset of unicode data files for linkify-it-py";
+    homepage = "https://github.com/tsutsu3/uc.micro-py";
+    license = licenses.mit;
+    maintainers = with maintainers; [ AluisioASG ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 0f50609528e71..08fdc92407187 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -3895,6 +3895,8 @@ in {
 
   line_profiler = callPackage ../development/python-modules/line_profiler { };
 
+  linkify-it-py = callPackage ../development/python-modules/linkify-it-py { };
+
   linode-api = callPackage ../development/python-modules/linode-api { };
 
   linode = callPackage ../development/python-modules/linode { };
@@ -4115,6 +4117,8 @@ in {
 
   md2gemini = callPackage ../development/python-modules/md2gemini { };
 
+  mdit-py-plugins = callPackage ../development/python-modules/mdit-py-plugins { };
+
   MDP = callPackage ../development/python-modules/mdp { };
 
   measurement = callPackage ../development/python-modules/measurement { };
@@ -6398,6 +6402,8 @@ in {
 
   pytest-random-order = callPackage ../development/python-modules/pytest-random-order { };
 
+  pytest-regressions = callPackage ../development/python-modules/pytest-regressions { };
+
   pytest-relaxed = callPackage ../development/python-modules/pytest-relaxed { };
 
   pytest-remotedata = callPackage ../development/python-modules/pytest-remotedata { };
@@ -8315,6 +8321,8 @@ in {
 
   uarray = callPackage ../development/python-modules/uarray { };
 
+  uc-micro-py = callPackage ../development/python-modules/uc-micro-py { };
+
   ueberzug = callPackage ../development/python-modules/ueberzug {
     inherit (pkgs.xorg) libX11 libXext;
   };