Unverified Commit 2b39c582 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

python3Packages.python-aodhclient: fix package build (#496954)

parents fac19a2f 98841c3e
Loading
Loading
Loading
Loading
+43 −20
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  cliff,
  fetchFromGitHub,
  keystoneauth1,
  openstackdocstheme,
  pbr,
  setuptools,

  # direct
  cliff,
  osc-lib,
  oslo-i18n,
  oslo-serialization,
  oslo-utils,
  oslotest,
  osprofiler,
  pbr,
  keystoneauth1,
  pyparsing,
  setuptools,

  # tests
  stestrCheckHook,
  versionCheckHook,
  openstacksdk,
  oslotest,
  tempest,
  testtools,
  pifpaf,

  # docs
  sphinxHook,
  stestr,
  openstackdocstheme,
}:

buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
  pname = "python-aodhclient";
  version = "3.10.1";
  pyproject = true;
@@ -26,11 +37,11 @@ buildPythonPackage rec {
  src = fetchFromGitHub {
    owner = "openstack";
    repo = "python-aodhclient";
    tag = version;
    tag = finalAttrs.version;
    hash = "sha256-xm42ZicdBxxm4LTDHPhEIeNU6evBZtp2PGvGy6V2t8c=";
  };

  env.PBR_VERSION = version;
  env.PBR_VERSION = finalAttrs.version;

  build-system = [
    pbr
@@ -44,6 +55,10 @@ buildPythonPackage rec {

  sphinxBuilders = [ "man" ];

  patches = [
    ./fix-pyproject.patch
  ];

  dependencies = [
    cliff
    keystoneauth1
@@ -57,23 +72,31 @@ buildPythonPackage rec {
  ];

  nativeCheckInputs = [
    stestrCheckHook
    openstacksdk
    oslotest
    stestr
    tempest
    testtools
    pifpaf
  ];

  checkPhase = ''
    runHook preCheck
    stestr run
    runHook postCheck
  '';
  nativeInstallCheckInputs = [ versionCheckHook ];
  doInstallCheck = true;

  pythonImportsCheck = [ "aodhclient" ];
  pythonImportsCheck = [
    "aodhclient"
    "aodhclient.v2"
    "aodhclient.tests"
    "aodhclient.tests.functional"
    "aodhclient.tests.unit"
  ];

  meta = {
    homepage = "https://github.com/openstack/python-aodhclient";
    description = "Client library for OpenStack Aodh API";
    description = "Client library for OpenStack AOodh API";
    homepage = "https://docs.openstack.org/python-aodhclient/latest/";
    downloadPage = "https://github.com/openstack/python-aodhclientz /releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.asl20;
    mainProgram = "aodh";
    teams = [ lib.teams.openstack ];
  };
}
})
+18 −0
Original line number Diff line number Diff line
diff --git a/pyproject.toml b/pyproject.toml
index 877242f..b5707c0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -33,10 +33,9 @@ classifiers = [
 Homepage = "https://docs.openstack.org/python-aodhclient"
 Repository = "https://opendev.org/openstack/python-aodhclient"
 
-[tool.setuptools]
-packages = [
-    "aodhclient"
-]
+[tool.setuptools.packages.find]
+where = ["."]
+include = ["aodhclient*"]
 
 [project.scripts]
 aodh = "aodhclient.shell:main"