Unverified Commit 7b8b14a8 authored by Robert Schütz's avatar Robert Schütz Committed by GitHub
Browse files

Merge pull request #329667 from dotlambda/python3Packages.python-apt

python312Packages.python-apt: 2.7.6 -> 2.8.0
parents 127fd4df 33019e7e
Loading
Loading
Loading
Loading
+29 −5
Original line number Diff line number Diff line
{
  lib,
  git,
  python3Packages,
  python3,
  fetchFromGitHub,
  nix-update-script,
}:

python3Packages.buildPythonApplication rec {
let
  python = python3.override {
    packageOverrides = self: super: {
      pydantic-yaml = super.pydantic-yaml.overridePythonAttrs (old: rec {
        version = "0.11.2";
        src = fetchFromGitHub {
          owner = "NowanIlfideme";
          repo = "pydantic-yaml";
          rev = "refs/tags/v${version}";
          hash = "sha256-AeUyVav0/k4Fz69Qizn4hcJKoi/CDR9eUan/nJhWsDY=";
        };
        dependencies = with self; [
          deprecated
          importlib-metadata
          pydantic_1
          ruamel-yaml
          types-deprecated
        ];
      });
    };
  };
in
python.pkgs.buildPythonApplication rec {
  pname = "charmcraft";
  version = "2.7.0";

@@ -23,11 +45,12 @@ python3Packages.buildPythonApplication rec {
    substituteInPlace setup.py \
      --replace-fail 'version=determine_version()' 'version="${version}"'

    # TODO remove setuptools from dependencies once this is removed
    substituteInPlace charmcraft/env.py \
      --replace-fail "distutils.util" "setuptools.dist"
  '';

  propagatedBuildInputs = with python3Packages; [
  dependencies = with python.pkgs; [
    craft-cli
    craft-parts
    craft-providers
@@ -42,17 +65,18 @@ python3Packages.buildPythonApplication rec {
    requests
    requests-toolbelt
    requests-unixsocket
    setuptools # see substituteInPlace above
    snap-helpers
    tabulate
    urllib3
  ];

  nativeBuildInputs = with python3Packages; [ setuptools ];
  build-system = with python.pkgs; [ setuptools ];

  pythonRelaxDeps = [ "urllib3" ];

  nativeCheckInputs =
    with python3Packages;
    with python.pkgs;
    [
      pyfakefs
      pytest-check
+45 −7
Original line number Diff line number Diff line
{
  lib,
  python3Packages,
  python3,
  fetchFromGitHub,
  dpkg,
  nix-update-script,
  python3,
}:

python3Packages.buildPythonApplication rec {
let
  python = python3.override {
    packageOverrides = self: super: {
      craft-application = super.craft-application.overridePythonAttrs (old: rec {
        version = "1.2.1";
        src = fetchFromGitHub {
          owner = "canonical";
          repo = "craft-application";
          rev = "refs/tags/${version}";
          hash = "sha256-CXZEWVoE66dlQJp4G8tinufjyaDJaH1Muxz/qd/81oA=";
        };
        postPatch = ''
          substituteInPlace pyproject.toml \
            --replace-fail "setuptools==67.7.2" "setuptools"
        '';
        preCheck = ''
          export HOME=$(mktemp -d)
        '';
      });
      pydantic-yaml = super.pydantic-yaml.overridePythonAttrs (old: rec {
        version = "0.11.2";
        src = fetchFromGitHub {
          owner = "NowanIlfideme";
          repo = "pydantic-yaml";
          rev = "refs/tags/v${version}";
          hash = "sha256-AeUyVav0/k4Fz69Qizn4hcJKoi/CDR9eUan/nJhWsDY=";
        };
        dependencies = with self; [
          deprecated
          importlib-metadata
          pydantic_1
          ruamel-yaml
          types-deprecated
        ];
      });
    };
  };
in
python.pkgs.buildPythonApplication rec {
  pname = "rockcraft";
  version = "1.2.3";

@@ -26,20 +63,21 @@ python3Packages.buildPythonApplication rec {
      --replace-fail "distutils.util" "setuptools.dist"
  '';

  propagatedBuildInputs = with python3Packages; [
    craft-application-1
  build-system = with python.pkgs; [ setuptools-scm ];

  dependencies = with python.pkgs; [
    craft-application
    craft-archives
    spdx-lookup
  ];

  nativeCheckInputs =
    with python3Packages;
    with python.pkgs;
    [
      pytest-check
      pytest-mock
      pytest-subprocess
      pytestCheckHook
      setuptools
    ]
    ++ [ dpkg ];

+51 −16
Original line number Diff line number Diff line
@@ -5,26 +5,49 @@
  lib,
  makeWrapper,
  nix-update-script,
  python3Packages,
  python3,
  squashfsTools,
  stdenv,
}:
python3Packages.buildPythonApplication rec {

let
  python = python3.override {
    packageOverrides = self: super: {
      pydantic = self.pydantic_1;
      pydantic-yaml = super.pydantic-yaml.overridePythonAttrs (old: rec {
        version = "0.11.2";
        src = fetchFromGitHub {
          owner = "NowanIlfideme";
          repo = "pydantic-yaml";
          rev = "refs/tags/v${version}";
          hash = "sha256-AeUyVav0/k4Fz69Qizn4hcJKoi/CDR9eUan/nJhWsDY=";
        };
        dependencies = with self; [
          deprecated
          importlib-metadata
          pydantic_1
          ruamel-yaml
          types-deprecated
        ];
      });
      versioningit = super.versioningit.overridePythonAttrs (old: rec {
        # incompatible with pydantic_1
        doCheck = false;
      });
    };
  };
in
python.pkgs.buildPythonApplication rec {
  pname = "snapcraft";
  version = "8.2.12";
  version = "8.3.1";

  pyproject = true;

  # Somewhere deep in the dependency tree is 'versioningit', which depends
  # on pydantic 2. Snapcraft will soon migrate to pydantic 2, and disabling
  # this doesn't seem to affect the functionality of the application.
  catchConflicts = false;

  src = fetchFromGitHub {
    owner = "canonical";
    repo = "snapcraft";
    rev = "refs/tags/${version}";
    hash = "sha256-1PwIbMweeYGi+jLfhFB3LYThqaN2VW7zdyzjD1m57ow=";
    hash = "sha256-cdRlUY9hAJ8US93aiJymzsV27JVPY7lWCK7IUdjDmYE=";
  };

  patches = [
@@ -68,13 +91,14 @@ python3Packages.buildPythonApplication rec {
      --replace-fail 'arch_linker_path = Path(arch_config.dynamic_linker)' \
      'return str(Path("${glibc}/lib/ld-linux-x86-64.so.2"))'

    substituteInPlace snapcraft_legacy/internal/xattrs.py \
      --replace-fail 'distutils.util' 'setuptools.dist'
    substituteInPlace pyproject.toml \
      --replace-fail '"pytest-cov>=4.0",' "" \
      --replace-fail "--cov=snapcraft" ""
  '';

  buildInputs = [ makeWrapper ];
  nativeBuildInputs = [ makeWrapper ];

  propagatedBuildInputs = with python3Packages; [
  dependencies = with python.pkgs; [
    attrs
    catkin-pkg
    click
@@ -93,27 +117,38 @@ python3Packages.buildPythonApplication rec {
    lxml
    macaroonbakery
    mypy-extensions
    overrides
    packaging
    progressbar
    pyelftools
    pygit2
    pylxd
    pymacaroons
    python-apt
    python-gnupg
    pyxdg
    pyyaml
    raven
    requests-toolbelt
    requests-unixsocket
    simplejson
    snap-helpers
    tabulate
    toml
    tinydb
    typing-extensions
    urllib3
    validators
  ];

  nativeBuildInputs = with python3Packages; [ setuptools ];
  build-system = with python.pkgs; [ setuptools ];

  pythonRelaxDeps = [
    "docutils"
    "jsonschema"
    "pygit2"
    "urllib3"
    "validators"
  ];

  postInstall = ''
@@ -121,10 +156,9 @@ python3Packages.buildPythonApplication rec {
  '';

  nativeCheckInputs =
    with python3Packages;
    with python.pkgs;
    [
      pytest-check
      pytest-cov
      pytest-mock
      pytest-subprocess
      pytestCheckHook
@@ -148,6 +182,7 @@ python3Packages.buildPythonApplication rec {
    "test_classic_linter_filter"
    "test_classic_linter"
    "test_complex_snap_yaml"
    "test_core24_try_command"
    "test_get_base_configuration_snap_channel"
    "test_get_base_configuration_snap_instance_name_default"
    "test_get_base_configuration_snap_instance_name_not_running_as_snap"
+0 −80
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  nix-update-script,
  craft-cli,
  craft-parts,
  craft-providers,
  pydantic-yaml-0,
  pyyaml,
  setuptools,
  setuptools-scm,
  pytestCheckHook,
  pytest-check,
  pytest-mock,
  hypothesis,
}:

buildPythonPackage rec {
  pname = "craft-application-1";
  version = "1.2.1";

  pyproject = true;

  src = fetchFromGitHub {
    owner = "canonical";
    repo = "craft-application";
    rev = "refs/tags/${version}";
    hash = "sha256-CXZEWVoE66dlQJp4G8tinufjyaDJaH1Muxz/qd/81oA=";
  };

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

    substituteInPlace pyproject.toml \
      --replace-fail "setuptools==67.7.2" "setuptools"
  '';

  nativeBuildInputs = [
    setuptools
    setuptools-scm
  ];

  propagatedBuildInputs = [
    craft-cli
    craft-parts
    craft-providers
    pydantic-yaml-0
    pyyaml
  ];

  pythonImportsCheck = [ "craft_application" ];

  nativeCheckInputs = [
    hypothesis
    pytest-check
    pytest-mock
    pytestCheckHook
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  pytestFlagsArray = [ "tests/unit" ];

  disabledTests = [ "test_to_yaml_file" ];

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Basis for Canonical craft applications";
    homepage = "https://github.com/canonical/craft-application";
    changelog = "https://github.com/canonical/craft-application/releases/tag/${version}";
    license = lib.licenses.lgpl3Only;
    maintainers = with lib.maintainers; [ jnsgruk ];
    platforms = lib.platforms.linux;
  };
}
+9 −13
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
  git,
  hypothesis,
  nix-update-script,
  pydantic-yaml-0,
  pydantic-yaml,
  pyfakefs,
  pygit2,
  pytest-check,
@@ -27,7 +27,7 @@

buildPythonPackage rec {
  pname = "craft-application";
  version = "2.8.0";
  version = "3.2.0";
  pyproject = true;

  disabled = pythonOlder "3.10";
@@ -36,21 +36,17 @@ buildPythonPackage rec {
    owner = "canonical";
    repo = "craft-application";
    rev = "refs/tags/${version}";
    hash = "sha256-COcZgl2XzPWknSKMUZgZBEMzkDdwK2PouIEuWKOP8dc=";
    hash = "sha256-2JfCe7FJtuObC/4miA+OC/ctGy1fhdgI7DsowNYjQk8=";
  };

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

    substituteInPlace pyproject.toml \
      --replace-fail "setuptools==" "setuptools>="
      --replace-fail "setuptools==70.1.0" "setuptools"
  '';

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

  pythonRelaxDeps = [ "requests" ];

  dependencies = [
    craft-archives
@@ -58,7 +54,7 @@ buildPythonPackage rec {
    craft-grammar
    craft-parts
    craft-providers
    pydantic-yaml-0
    pydantic-yaml
    pygit2
    pyyaml
    snap-helpers
@@ -110,7 +106,7 @@ buildPythonPackage rec {
  meta = {
    description = "Basis for Canonical craft applications";
    homepage = "https://github.com/canonical/craft-application";
    changelog = "https://github.com/canonical/craft-application/releases/tag/${version}";
    changelog = "https://github.com/canonical/craft-application/blob/${src.rev}/docs/reference/changelog.rst";
    license = lib.licenses.lgpl3Only;
    maintainers = with lib.maintainers; [ jnsgruk ];
    platforms = lib.platforms.linux;
Loading