Unverified Commit ab04fc5f authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #261560 from natsukium/python311Packages-docx2python-update

python311Packages.docx2python: unstable-2020-11-15 -> 2.11.0 
parents cb8da9c1 19d40d80
Loading
Loading
Loading
Loading
+25 −12
Original line number Diff line number Diff line
{ lib, buildPythonPackage, fetchFromGitHub, pytestCheckHook }:
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, poetry-core
, lxml
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "docx2python";
  version = "unstable-2020-11-15";
  version = "2.11.0";
  pyproject = true;

  disabled = pythonOlder "3.8";

  # Pypi does not contain tests
  src = fetchFromGitHub {
    owner = "ShayHill";
    repo = pname;
    rev = "21b2edafc0a01a6cfb73aefc61747a65917e2cad";
    sha256 = "1nwg17ziwm9a2x7yxsscj8zgc1d383ifsk5w7qa2fws6gf627kyi";
    repo = "docx2python";
    rev = "refs/tags/${version}";
    hash = "sha256-SavRYnNbESRQh9Elk8qCt/qdI2x+sYZJFMYy+Gojg2k=";
  };

  preCheck = "cd test"; # Tests require the `test/resources` folder to be accessible
  nativeCheckInputs = [ pytestCheckHook ];
  disabledTests = [ # asserts related to file deletions fail
    "test_docx2python.py"
    "test_docx_context.py"
    "test_google_docs.py"
  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    lxml
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "docx2python" ];

  meta = with lib; {
    homepage = "https://github.com/ShayHill/docx2python";
    description = "Extract docx headers, footers, (formatted) text, footnotes, endnotes, properties, and images";
    changelog = "https://github.com/ShayHill/docx2python/blob/${src.rev}/CHANGELOG.md";
    maintainers = [ maintainers.ivar ];
    license = licenses.mit;
  };