Commit f4dcbabb authored by Fabian Affolter's avatar Fabian Affolter
Browse files

python313Packages.dom-toml: refactor

- add optional-dependencies
- don't run tests
parent 0cd78a32
Loading
Loading
Loading
Loading
+27 −14
Original line number Diff line number Diff line
{
  buildPythonPackage,
  fetchPypi,
  lib,
  attrs,
  buildPythonPackage,
  domdf-python-tools,
  fetchFromGitHub,
  flit-core,
  pytestCheckHook,
  setuptools,
  domdf-python-tools,
  tomli,
  tomli-w,
}:

buildPythonPackage rec {
  pname = "dom-toml";
  version = "2.2.0";
  pyproject = true;

  src = fetchPypi {
    inherit version;
    pname = "dom_toml";
    hash = "sha256-CY0Btma605qj2M2Rbuocc8Qxpp5iFRHTEZwAFgTyfZ8=";
  src = fetchFromGitHub {
    owner = "domdfcoding";
    repo = "dom_toml";
    tag = "v${version}";
    hash = "sha256-2kO/6spc+y/ltHf493JkSKI0vGuJu2a29fqsW/EDFxE=";
  };

  build-system = [ flit-core ];

  nativeBuildInputs = [ setuptools ];
  dependencies = [ domdf-python-tools ];

  dependencies = [
    domdf-python-tools
    tomli
  optional-dependencies = {
    all = [
      attrs
      tomli-w
    ];
    config = [
      attrs
      tomli-w
    ];
  };

  # Circular dependency whey -> domdf-python-tools -> coincidence
  doCheck = false;

  pythonImportsCheck = [ "dom_toml" ];

  meta = {
    description = "Dom's tools for Tom's Obvious, Minimal Language";
    homepage = "https://github.com/domdfcoding/dom_toml";
    changelog = "https://github.com/domdfcoding/dom_toml/releases/tag/v${version}";
    changelog = "https://github.com/domdfcoding/dom_toml/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ tyberius-prime ];
  };