Unverified Commit 078fd588 authored by Jon Seager's avatar Jon Seager Committed by GitHub
Browse files

rockcraft: actually use sources for 1.7.0, add passthru.tests.version (#368933)

parents 617fb0e3 1d22a9aa
Loading
Loading
Loading
Loading
+19 −13
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@
  fetchFromGitHub,
  dpkg,
  nix-update-script,
  testers,
  rockcraft,
  cacert,
}:

python3Packages.buildPythonApplication rec {
@@ -13,18 +16,11 @@ python3Packages.buildPythonApplication rec {
  src = fetchFromGitHub {
    owner = "canonical";
    repo = "rockcraft";
    rev = "1d87e33cf207b3a2f16eb125743ec11546fa0cb1";
    hash = "sha256-QnW3BMu4Tuvj8PCt5eYJbNMiojXpyJ1uza6hpMxxSOE=";
    rev = version;
    hash = "sha256-2Bo3qtpSSfNvqszlt9cCc9/rurDNDMySAaqLbvRmjjw=";
  };

  postPatch = ''
    substituteInPlace rockcraft/__init__.py \
      --replace-fail "dev" "${version}"

    substituteInPlace rockcraft/utils.py \
      --replace-fail "distutils.util" "setuptools.dist"
  '';

  pyproject = true;
  build-system = with python3Packages; [ setuptools-scm ];

  dependencies = with python3Packages; [
@@ -32,6 +28,7 @@ python3Packages.buildPythonApplication rec {
    craft-archives
    craft-platforms
    spdx-lookup
    tabulate
  ];

  nativeCheckInputs =
@@ -42,7 +39,6 @@ python3Packages.buildPythonApplication rec {
      pytest-mock
      pytest-subprocess
      pytestCheckHook
      tabulate
    ]
    ++ [ dpkg ];

@@ -51,9 +47,19 @@ python3Packages.buildPythonApplication rec {
    export HOME="$(pwd)/check-phase"
  '';

  disabledTests = [ "test_expand_extensions" ];
  disabledTests = [
    "test_run_init_flask"
    "test_run_init_django"
  ];

  passthru.updateScript = nix-update-script { };
  passthru = {
    updateScript = nix-update-script { };
    tests.version = testers.testVersion {
      package = rockcraft;
      command = "env SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt HOME=$(mktemp -d) rockcraft --version";
      version = "rockcraft ${version}";
    };
  };

  meta = {
    mainProgram = "rockcraft";