31 buildPythonPackage rec {
32 pname = "craft-application";
36 disabled = pythonOlder "3.10";
38 src = fetchFromGitHub {
40 repo = "craft-application";
42 hash = "sha256-rKeEi9z5eQfjn0Q4FR6CVIz9YDS7Ejg4cqcor5wtz0s=";
46 substituteInPlace pyproject.toml \
47 --replace-fail "setuptools==75.2.0" "setuptools"
50 build-system = [ setuptools-scm ];
84 export HOME=$(mktemp -d)
86 # Tests require access to /etc/os-release, which isn't accessible in
87 # the test environment, so create a fake file, and modify the code
89 echo 'ID=nixos' > $HOME/os-release
90 echo 'NAME=NixOS' >> $HOME/os-release
91 echo 'VERSION_ID="24.05"' >> $HOME/os-release
93 substituteInPlace craft_application/util/platforms.py \
94 --replace-fail "os_utils.OsRelease()" "os_utils.OsRelease(os_release_file='$HOME/os-release')"
97 pythonImportsCheck = [ "craft_application" ];
99 pytestFlagsArray = [ "tests/unit" ];
104 # Tests expecting pytest-time
105 "test_monitor_builds_success"
106 # Temporary fix until new release to support Python 3.13
107 "test_grammar_aware_part_error"
108 "test_grammar_aware_part_error[part2]"
109 "test_grammar_aware_project_error[project0]"
111 ++ lib.optionals stdenv.hostPlatform.isAarch64 [
112 # These tests have hardcoded "amd64" strings which fail on aarch64
113 "test_process_grammar_build_for"
114 "test_process_grammar_platform"
115 "test_process_grammar_default"
118 passthru.updateScript = nix-update-script { };
121 description = "Basis for Canonical craft applications";
122 homepage = "https://github.com/canonical/craft-application";
123 changelog = "https://github.com/canonical/craft-application/blob/${src.tag}/docs/reference/changelog.rst";
124 license = lib.licenses.lgpl3Only;
125 maintainers = with lib.maintainers; [ jnsgruk ];
126 platforms = lib.platforms.linux;