Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

charmcraft: 2.7.0 -> 3.1.1 #329849

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions pkgs/by-name/ch/charmcraft/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,30 @@ let
in
python.pkgs.buildPythonApplication rec {
pname = "charmcraft";
version = "2.7.0";
version = "3.1.1";

pyproject = true;

src = fetchFromGitHub {
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
Expand All @@ -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
Expand Down
62 changes: 62 additions & 0 deletions pkgs/development/python-modules/craft-platforms/default.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2567,6 +2567,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 { };
Expand Down