Unverified Commit 6feeb58e authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

python312Packages.mike: unstable-2023-05-06 -> 2.1.3 (#377110)

parents ee8ac648 6166a666
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
{ python3Packages }: with python3Packages; toPythonApplication mike
+44 −23
Original line number Diff line number Diff line
@@ -2,59 +2,80 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  git,
  setuptools,
  importlib-metadata,
  importlib-resources,
  jinja2,
  mkdocs,
  pythonOlder,
  pyparsing,
  pyyaml,
  unittestCheckHook,
  pyyaml-env-tag,
  verspec,
  versionCheckHook,
  pytestCheckHook,
  git,
  shtab,
  stdenv,
}:

buildPythonPackage rec {
  pname = "mike";
  version = "unstable-2023-05-06";
  format = "setuptools";

  disabled = pythonOlder "3.7";
  version = "2.1.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "jimporter";
    repo = pname;
    rev = "300593c338b18f61f604d18457c351e166318020";
    hash = "sha256-Sjj2275IJDtLjG6uO9h4FbgxXTMgqD8c/rJj6iOxfuI=";
    repo = "mike";
    tag = "v${version}";
    hash = "sha256-eGUkYcPTrXwsZPqyDgHJlEFXzhMnenoZsjeHVGO/9WU=";
  };

  propagatedBuildInputs = [
  build-system = [
    setuptools
  ];

  dependencies = [
    importlib-metadata
    importlib-resources
    jinja2
    mkdocs
    pyparsing
    pyyaml
    pyyaml-env-tag
    verspec
  ];

  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgramArg = "--version";
  doInstallCheck = true;

  __darwinAllowLocalNetworking = true;

  nativeCheckInputs = [
    pytestCheckHook
    git
    unittestCheckHook
    mkdocs
    shtab
  ];

  preCheck = ''
  preCheck =
    ''
      export PATH=$out/bin:$PATH
    ''
    # "stat" on darwin results in "not permitted" instead of "does not exists"
    + lib.optionalString stdenv.hostPlatform.isDarwin ''
      substituteInPlace test/unit/test_git_utils.py \
        --replace-fail "/home/nonexist" "$(mktemp -d)"
    '';

  # Difficult to setup
  doCheck = false;

  pythonImportsCheck = [ "mike" ];

  meta = with lib; {
    description = "Manage multiple versions of your MkDocs-powered documentation";
    mainProgram = "mike";
  meta = {
    description = "Manage multiple versions of your MkDocs-powered documentation via Git";
    homepage = "https://github.com/jimporter/mike";
    license = licenses.bsd3;
    maintainers = [ ];
    changelog = "https://github.com/jimporter/mike/blob/v${version}/CHANGES.md";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ marcel ];
    mainProgram = "mike";
  };
}