Unverified Commit 2966d46f authored by éclairevoyant's avatar éclairevoyant Committed by GitHub
Browse files

Merge pull request #334030 from pbsds/migrate-replace-fail-1723410321

 treewide: modernize python packages
parents 046542e6 fc93476f
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  buildPythonPackage,
  fetchPypi,
  setuptools,
  setuptools-scm,
  fusepy,
  fuse,
@@ -11,7 +12,7 @@
buildPythonPackage rec {
  pname = "acme-tiny";
  version = "5.0.1";
  format = "setuptools";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
@@ -19,12 +20,15 @@ buildPythonPackage rec {
  };

  patchPhase = ''
    substituteInPlace acme_tiny.py --replace '"openssl"' '"${openssl.bin}/bin/openssl"'
    substituteInPlace tests/test_module.py --replace '"openssl"' '"${openssl.bin}/bin/openssl"'
    substituteInPlace tests/utils.py --replace /etc/ssl/openssl.cnf ${openssl.out}/etc/ssl/openssl.cnf
    substituteInPlace acme_tiny.py --replace-fail '"openssl"' '"${openssl.bin}/bin/openssl"'
    substituteInPlace tests/test_module.py --replace-fail '"openssl"' '"${openssl.bin}/bin/openssl"'
    substituteInPlace tests/utils.py --replace-fail /etc/ssl/openssl.cnf ${openssl.out}/etc/ssl/openssl.cnf
  '';

  buildInputs = [ setuptools-scm ];
  build-system = [
    setuptools
    setuptools-scm
  ];

  nativeCheckInputs = [
    fusepy
+7 −4
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
  buildPythonPackage,
  docopt,
  fetchFromGitHub,
  setuptools,
  jdk11,
  psutil,
  pythonOlder,
@@ -11,25 +12,27 @@
buildPythonPackage rec {
  pname = "adb-enhanced";
  version = "2.5.24";
  format = "setuptools";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "ashishb";
    repo = pname;
    repo = "adb-enhanced";
    rev = "refs/tags/${version}";
    hash = "sha256-0HxeL6VGM+HTiAxs3NFRcEFbmH9q+0/pJdGyF1hl4hU=";
  };

  propagatedBuildInputs = [
  build-system = [ setuptools ];

  dependencies = [
    psutil
    docopt
  ];

  postPatch = ''
    substituteInPlace adbe/adb_enhanced.py \
      --replace "cmd = 'java" "cmd = '${jdk11}/bin/java"
      --replace-fail "cmd = 'java" "cmd = '${jdk11}/bin/java"
  '';

  # Disable tests because they require a dedicated Android emulator
+6 −3
Original line number Diff line number Diff line
@@ -3,26 +3,29 @@
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  setuptools,
  pythonOlder,
}:

buildPythonPackage rec {
  pname = "aiolip";
  version = "1.1.6";
  format = "setuptools";
  pyproject = true;
  disabled = pythonOlder "3.5";

  src = fetchFromGitHub {
    owner = "bdraco";
    repo = pname;
    repo = "aiolip";
    rev = version;
    sha256 = "1bgmcl8q1p6f2xm3w2qylvla6vf6bd1p2hfwj4l8w6w0w04vr02g";
  };

  build-system = [ setuptools ];

  nativeCheckInputs = [ pytestCheckHook ];

  postPatch = ''
    substituteInPlace setup.py --replace "'pytest-runner'," ""
    substituteInPlace setup.py --replace-fail "'pytest-runner'," ""
  '';

  pythonImportsCheck = [ "aiolip" ];
+4 −4
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ buildPythonPackage rec {
  pname = "ambee";
  version = "0.4.0";
  disabled = pythonOlder "3.8";
  format = "pyproject";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "frenck";
@@ -25,9 +25,9 @@ buildPythonPackage rec {
    hash = "sha256-2wX2CLr6kdVw2AGPW6DmYI2OBfQFI/iWVorok2d3wx4=";
  };

  nativeBuildInputs = [ poetry-core ];
  build-system = [ poetry-core ];

  propagatedBuildInputs = [
  dependencies = [
    aiohttp
    yarl
  ];
@@ -42,7 +42,7 @@ buildPythonPackage rec {
  postPatch = ''
    # Upstream doesn't set a version for the pyproject.toml
    substituteInPlace pyproject.toml \
      --replace "0.0.0" "${version}"
      --replace-fail "0.0.0" "${version}"
  '';

  pythonImportsCheck = [ "ambee" ];
+9 −10
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
  poetry-core,
  pycryptodomex,
  pytestCheckHook,
  pytest-cov-stub,
  pythonOlder,
  sensor-state-data,
}:
@@ -13,31 +14,29 @@
buildPythonPackage rec {
  pname = "atc-ble";
  version = "0.1.0";
  format = "pyproject";
  pyproject = true;

  disabled = pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "Bluetooth-Devices";
    repo = pname;
    repo = "atc-ble";
    rev = "refs/tags/v${version}";
    hash = "sha256-rwOFKxUlbbNIDJRdCmZpHstXwxcTnvlExgcVDdGbIVY=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace " --cov=atc_ble --cov-report=term-missing:skip-covered" ""
  '';
  build-system = [ poetry-core ];

  nativeBuildInputs = [ poetry-core ];

  propagatedBuildInputs = [
  dependencies = [
    bluetooth-sensor-state-data
    pycryptodomex
    sensor-state-data
  ];

  nativeCheckInputs = [ pytestCheckHook ];
  nativeCheckInputs = [
    pytestCheckHook
    pytest-cov-stub
  ];

  pythonImportsCheck = [ "atc_ble" ];

Loading