Unverified Commit 6deae3ab authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

python312Packages.more-properties: cleanup & disable on python >= 3.13 (#384354)

parents defe2d3d 34f82153
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  pythonOlder,
  pythonAtLeast,
  fetchFromGitHub,
  setuptools,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "more-properties";
  version = "1.1.1";
  pyproject = true;

  # upstream requires >= 3.6 but only 3.7 includes dataclasses
  disabled = pythonOlder "3.7";

  format = "setuptools";
  # All tests are failing with:
  # AssertionError: None != 'The type of the None singleton.'
  disabled = pythonAtLeast "3.13";

  src = fetchFromGitHub {
    owner = "madman-bob";
    repo = "python-more-properties";
    rev = version;
    tag = version;
    hash = "sha256-dKG97rw5IG19m7u3ZDBM2yGScL5cFaKBvGZxPVJaUTE=";
  };

  postPatch = ''
    mv pypi_upload/setup.py .
    substituteInPlace setup.py \
      --replace "project_root = Path(__file__).parents[1]" "project_root = Path(__file__).parents[0]"

    # dataclasses is included in Python 3.7
    substituteInPlace requirements.txt \
      --replace dataclasses ""
      --replace-fail "project_root = Path(__file__).parents[1]" "project_root = Path(__file__).parents[0]"
  '';

  build-system = [
    setuptools
  ];

  pythonRemoveDeps = [
    # dataclasses is included in Python since 3.7
    "dataclasses"
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "more_properties" ];