<commit_before>{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder

# runtime
, editables
, importlib-metadata # < 3.8
, packaging
, pathspec
, pluggy
, tomli

# tests
, build
, python
, requests
, toml
, virtualenv
}:

let
  pname = "hatchling";
  version = "0.18.0";
in
buildPythonPackage {
  inherit pname version;
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "ofek";
    repo = "hatch";
    rev = "${pname}-v${version}";
    hash = "sha256-kCaEAM0cY1yQcuHfvnaLs3smN9MKATjrrQTXpCfGmWc=";
  };

  prePatch = ''
    cd backend
  '';

  # listed in backend/src/hatchling/ouroboros.py
  propagatedBuildInputs = [
    editables
    packaging
    pathspec
    pluggy
    tomli
  ] ++ lib.optionals (pythonOlder "3.8") [
    importlib-metadata
  ];

  pythonImportsCheck = [
    "hatchling"
  ];

  # tries to fetch packages from the internet
  doCheck = false;

  # listed in /backend/tests/downstream/requirements.txt
  checkInputs = [
    build
    packaging
    requests
    toml
    virtualenv
  ];

  preCheck = ''
    export HOME=$TMPDIR
  '';

  checkPhase = ''
    runHook preCheck
    ${python.interpreter} tests/downstream/integrate.py
    runHook postCheck
  '';

  meta = with lib; {
    description = "Modern, extensible Python build backend";
    homepage = "https://ofek.dev/hatch/latest/";
    license = licenses.mit;
    maintainers = with maintainers; [ hexa ];
  };
}
<commit_msg>python3Packages.hatchling: 0.18.0 -> 0.20.0<commit_after>{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder

# runtime
, editables
, importlib-metadata # < 3.8
, packaging
, pathspec
, pluggy
, tomli

# tests
, build
, python
, requests
, toml
, virtualenv
}:

let
  pname = "hatchling";
  version = "0.20.0";
in
buildPythonPackage {
  inherit pname version;
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "ofek";
    repo = "hatch";
    rev = "${pname}-v${version}";
    hash = "sha256-Sm3utqkuofVDn815HPj501KEuypnaYKm06ehsu+m3i4=";
  };

  prePatch = ''
    cd backend
  '';

  # listed in backend/src/hatchling/ouroboros.py
  propagatedBuildInputs = [
    editables
    packaging
    pathspec
    pluggy
    tomli
  ] ++ lib.optionals (pythonOlder "3.8") [
    importlib-metadata
  ];

  pythonImportsCheck = [
    "hatchling"
  ];

  # tries to fetch packages from the internet
  doCheck = false;

  # listed in /backend/tests/downstream/requirements.txt
  checkInputs = [
    build
    packaging
    requests
    toml
    virtualenv
  ];

  preCheck = ''
    export HOME=$TMPDIR
  '';

  checkPhase = ''
    runHook preCheck
    ${python.interpreter} tests/downstream/integrate.py
    runHook postCheck
  '';

  meta = with lib; {
    description = "Modern, extensible Python build backend";
    homepage = "https://ofek.dev/hatch/latest/";
    license = licenses.mit;
    maintainers = with maintainers; [ hexa ];
  };
}

{'fraction_non_alphanumeric': 0.11942896935933148, 'fraction_numerical': 0.016016713091922007, 'mean_word_length': 2.9356164383561643, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '368224', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1030, 'n_words': 210}