Merge pull request #329849 from jnsgruk/charmcraft-3.1.1

charmcraft: 2.7.0 -> 3.1.1
This commit is contained in:
Jon Seager 2024-07-25 11:19:18 +01:00 committed by GitHub
commit 5a1496cb1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 75 additions and 10 deletions

View File

@ -30,7 +30,7 @@ let
in
python.pkgs.buildPythonApplication rec {
pname = "charmcraft";
version = "2.7.0";
version = "3.1.1";
pyproject = true;
@ -38,24 +38,22 @@ python.pkgs.buildPythonApplication rec {
owner = "canonical";
repo = "charmcraft";
rev = "refs/tags/${version}";
hash = "sha256-yMcGXi7OxEtfOv3zLEUlnZrR90TkFc0y9RB9jS34ZWs=";
hash = "sha256-oxNbAIf7ltdDYkGJj29zvNDNXT6vt1jWaIqHJoMr7gU=";
};
postPatch = ''
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"
substituteInPlace charmcraft/__init__.py --replace-fail "dev" "${version}"
'';
dependencies = with python.pkgs; [
craft-application
craft-cli
craft-parts
craft-platforms
craft-providers
craft-store
distro
docker
humanize
jinja2
jsonschema
@ -65,19 +63,22 @@ python.pkgs.buildPythonApplication rec {
requests
requests-toolbelt
requests-unixsocket
setuptools # see substituteInPlace above
snap-helpers
tabulate
urllib3
];
build-system = with python.pkgs; [ setuptools ];
build-system = with python.pkgs; [
setuptools
setuptools-scm
];
pythonRelaxDeps = [ "urllib3" ];
nativeCheckInputs =
with python.pkgs;
[
hypothesis
pyfakefs
pytest-check
pytest-mock

View File

@ -0,0 +1,62 @@
{
lib,
buildPythonPackage,
annotated-types,
distro,
fetchFromGitHub,
nix-update-script,
pytest-check,
pytestCheckHook,
pythonOlder,
setuptools,
setuptools-scm,
}:
buildPythonPackage rec {
pname = "craft-platforms";
version = "0.1.1";
pyproject = true;
disabled = pythonOlder "3.10";
src = fetchFromGitHub {
owner = "canonical";
repo = "craft-platforms";
rev = "refs/tags/${version}";
hash = "sha256-KzskmSw7NsH1CAYjPf2281Ob71Jd6AhWxtp5tR3IqyU=";
};
postPatch = ''
substituteInPlace craft_platforms/__init__.py --replace-fail "dev" "${version}"
'';
build-system = [
setuptools
setuptools-scm
];
dependencies = [
annotated-types
distro
];
nativeCheckInputs = [
pytestCheckHook
pytest-check
];
pythonImportsCheck = [ "craft_platforms" ];
pytestFlagsArray = [ "tests/unit" ];
passthru.updateScript = nix-update-script { };
meta = {
description = "Manage platforms and architectures for charm applications";
homepage = "https://github.com/canonical/craft-platforms";
changelog = "https://github.com/canonical/craft-platforms/releases/tag/${version}";
license = lib.licenses.lgpl3Only;
maintainers = with lib.maintainers; [ jnsgruk ];
platforms = lib.platforms.linux;
};
}

View File

@ -2569,6 +2569,8 @@ self: super: with self; {
craft-parts = callPackage ../development/python-modules/craft-parts { };
craft-platforms = callPackage ../development/python-modules/craft-platforms { };
craft-providers = callPackage ../development/python-modules/craft-providers { };
craft-store = callPackage ../development/python-modules/craft-store { };