Unverified Commit 94d355c5 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

Merge pull request #330805 from pyrox0/denose/mwtypes-and-mwxml

python312Packages.{mwtypes,mwxml}: drop nose dependency; modernize
parents e6e2deb1 e766541c
Loading
Loading
Loading
Loading
+24 −17
Original line number Diff line number Diff line
@@ -3,38 +3,45 @@
  buildPythonPackage,
  fetchPypi,
  jsonable,
  nose,
  pytestCheckHook,
  fetchpatch2,
  setuptools,
}:

buildPythonPackage rec {
  pname = "mwtypes";
  version = "0.3.2";
  format = "setuptools";
  version = "0.4.0";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-3BF2xZZWKcEj6FmzGa5hUdTjhVMemngWBMDUyjQ045k=";
    inherit version pname;
    hash = "sha256-PgcGUk/27cAIvzfLvRoVX2vHOCab59m+4bciDPmtlW8=";
  };

  propagatedBuildInputs = [ jsonable ];

  nativeCheckInputs = [
    nose
    pytestCheckHook
  patches = [
    # https://github.com/mediawiki-utilities/python-mwtypes/pull/6
    (fetchpatch2 {
      name = "nose-to-pytest.patch";
      url = "https://github.com/mediawiki-utilities/python-mwtypes/commit/58d7f59e4927aaa6278f84576794df713c673058.patch";
      hash = "sha256-jh1uEqqhIK2DyNvVN0XYGM7BXTmypnoC4VoB0V+9JmE=";
    })
  ];

  disabledTests = [
    "test_normalize_path_bad_extension"
    "test_open_file"
  ];
  build-system = [ setuptools ];

  dependencies = [ jsonable ];

  nativeCheckInputs = [ pytestCheckHook ];

  # Even with 7z included, this test does not pass
  disabledTests = [ "test_open_file" ];

  pythonImportsCheck = [ "mwtypes" ];

  meta = with lib; {
  meta = {
    description = "Set of classes for working with MediaWiki data types";
    homepage = "https://github.com/mediawiki-utilities/python-mwtypes";
    license = licenses.mit;
    maintainers = with maintainers; [ GaetanLepage ];
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}
+21 −14
Original line number Diff line number Diff line
@@ -2,43 +2,50 @@
  lib,
  buildPythonPackage,
  fetchPypi,
  fetchpatch2,
  jsonschema,
  mwcli,
  mwtypes,
  nose,
  pytestCheckHook,
  setuptools,
}:

buildPythonPackage rec {
  pname = "mwxml";
  version = "0.3.3";
  format = "setuptools";
  version = "0.3.4";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-CEjfDPLik3GPVUMRrPRxW9Z59jn05Sy+R9ggZYnbHTE=";
    hash = "sha256-ejf3RfdwcEp0Ge+96dORuHS5Bx28GSs7H4HD1LUnde4=";
  };

  propagatedBuildInputs = [
  patches = [
    # https://github.com/mediawiki-utilities/python-mwxml/pull/21
    (fetchpatch2 {
      name = "nose-to-pytest.patch";
      url = "https://github.com/mediawiki-utilities/python-mwxml/compare/2b477be6aa9794064d03b5be38c7759d1570488b...71bbfd2b309e0720a34a4e783b71169aebc571ef.patch";
      hash = "sha256-4XxNvda1Dj+kFbD9t9gzucrMjdfXcoqYlvecXO2B2R0=";
    })
  ];

  build-system = [ setuptools ];

  dependencies = [
    jsonschema
    mwcli
    mwtypes
  ];

  nativeCheckInputs = [
    nose
    pytestCheckHook
  ];

  disabledTests = [ "test_page_with_discussion" ];
  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "mwxml" ];

  meta = with lib; {
  meta = {
    description = "Set of utilities for processing MediaWiki XML dump data";
    mainProgram = "mwxml";
    homepage = "https://github.com/mediawiki-utilities/python-mwxml";
    license = licenses.mit;
    maintainers = with maintainers; [ GaetanLepage ];
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}