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

pythonPackages: Add OpenStack Octavia client and Neutron bindings #322593

Merged
merged 7 commits into from
Sep 1, 2024
1 change: 1 addition & 0 deletions maintainers/team-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ with lib.maintainers;
members = [
SuperSandro2000
anthonyroussel
vinetos
];
scope = "Maintain the ecosystem around OpenStack";
shortName = "OpenStack";
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/doc8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ buildPythonPackage rec {

nativeCheckInputs = [ pytestCheckHook ];

pythonRelaxDeps = [ "docutils" ];

pythonImportsCheck = [ "doc8" ];

meta = with lib; {
Expand Down
62 changes: 62 additions & 0 deletions pkgs/development/python-modules/os-client-config/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
lib,
buildPythonPackage,
fetchPypi,
fixtures,
hacking,
jsonschema,
openstacksdk,
oslotest,
python-glanceclient,
setuptools,
stestr,
subunit,
testscenarios,
testtools,
}:

buildPythonPackage rec {
pname = "os-client-config";
version = "2.1.0";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-q8OKNR+MAG009+5fP2SN5ePs9kVcxdds/YidKRzfP04=";
};

build-system = [ setuptools ];

dependencies = [
openstacksdk
python-glanceclient
];

nativeCheckInputs = [
hacking
fixtures
jsonschema
subunit
oslotest
stestr
testscenarios
testtools
];

checkPhase = ''
runHook preCheck

stestr run

runHook postCheck
'';

pythonImportsCheck = [ "os_client_config" ];

meta = with lib; {
homepage = "https://opendev.org/openstack/os-client-config";
description = "Collect client configuration for using OpenStack in consistent and comprehensive manner";
license = licenses.asl20;
maintainers = teams.openstack.members;
};
}
51 changes: 51 additions & 0 deletions pkgs/development/python-modules/osprofiler/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
lib,
buildPythonPackage,
fetchPypi,
netaddr,
oslo-concurrency,
oslo-serialization,
oslo-utils,
prettytable,
requests,
setuptools,
webob,
}:

buildPythonPackage rec {
pname = "osprofiler";
version = "4.1.0";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-V4N7YgWBsTREouIFZHddT8c+/2fHiIr5mUftWC/lFLA=";
};

build-system = [ setuptools ];

dependencies = [
netaddr
Vinetos marked this conversation as resolved.
Show resolved Hide resolved
oslo-concurrency
oslo-serialization
oslo-utils
prettytable
requests
webob
];

# NOTE(vinetos): OSProfiler depends on jeager-client which use opentracing
# Opentracing and jeager-client are archived since 2022.
# As this package is made only to support old OpenStack clients and bindings,
# We do not really care
doCheck = false;

pythonImportsCheck = [ "osprofiler" ];

meta = with lib; {
description = "OpenStack Library to profile request between all involved services";
homepage = "https://opendev.org/openstack/osprofiler/";
license = licenses.asl20;
maintainers = teams.openstack.members;
};
}
98 changes: 98 additions & 0 deletions pkgs/development/python-modules/python-neutronclient/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
# Build and Runtime
pbr,
cliff,
debtcollector,
iso8601,
netaddr,
openstacksdk,
osc-lib,
oslo-i18n,
oslo-log,
oslo-serialization,
oslo-utils,
os-client-config,
keystoneauth1,
python-keystoneclient,
requests,
hacking,
# Tests
fixtures,
oslotest,
osprofiler,
python-openstackclient,
subunit,
requests-mock,
stestr,
testtools,
testscenarios,
tempest,
}:

buildPythonPackage rec {
pname = "python-neutronclient";
version = "11.3.1";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-U82ZI/Q6OwdypA41YfdGVa3IA4+QJhqz3gW2IR0S7cs=";
};

build-system = [
setuptools
pbr
];

dependencies = [
cliff
debtcollector
iso8601
netaddr
openstacksdk
osc-lib
oslo-i18n
oslo-log
oslo-serialization
oslo-utils
os-client-config
keystoneauth1
python-keystoneclient
requests
];

nativeCheckInputs = [
hacking
fixtures
oslotest
osprofiler
python-openstackclient
subunit
requests-mock
stestr
testtools
testscenarios
tempest
];

checkPhase = ''
runHook preCheck

stestr run

runHook postCheck
'';

pythonImportsCheck = [ "neutronclient" ];

meta = with lib; {
description = "Python bindings for the OpenStack Networking API";
homepage = "https://opendev.org/openstack/python-neutronclient/";
license = licenses.asl20;
maintainers = teams.openstack.members;
};
}
89 changes: 89 additions & 0 deletions pkgs/development/python-modules/python-octaviaclient/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
lib,
buildPythonPackage,
cliff,
doc8,
docutils,
fetchPypi,
hacking,
keystoneauth1,
openstackclient,
openstackdocstheme,
osc-lib,
oslotest,
oslo-serialization,
oslo-utils,
pbr,
pygments,
python-neutronclient,
requests,
requests-mock,
setuptools,
sphinx,
sphinxcontrib-apidoc,
stestr,
subunit,
testscenarios,
}:

buildPythonPackage rec {
pname = "python-octaviaclient";
version = "3.7.0";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-wAGxByeRBOwdWZg2DwVpt1yGi5er3KQ/qhyRVAwaKe4=";
};

build-system = [
setuptools
pbr
];

nativeBuildInputs = [
openstackdocstheme
Vinetos marked this conversation as resolved.
Show resolved Hide resolved
sphinx
sphinxcontrib-apidoc
];

dependencies = [
cliff
keystoneauth1
python-neutronclient
openstackclient
Vinetos marked this conversation as resolved.
Show resolved Hide resolved
osc-lib
oslo-serialization
oslo-utils
requests
];

nativeCheckInputs = [
hacking
requests-mock
doc8
docutils
pygments
subunit
oslotest
stestr
testscenarios
];

checkPhase = ''
runHook preCheck

stestr run

runHook postCheck
'';

pythonImportsCheck = [ "octaviaclient" ];

meta = with lib; {
description = "OpenStack Octavia Command-line Client";
homepage = "https://opendev.org/openstack/python-octaviaclient/";
license = licenses.asl20;
maintainers = teams.openstack.members;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
python-ironicclient,
python-keystoneclient,
python-manilaclient,
python-neutronclient,
python-openstackclient,
requests-mock,
requests,
Expand Down Expand Up @@ -73,6 +74,7 @@ buildPythonPackage rec {
python-heatclient
python-ironicclient
python-manilaclient
python-neutronclient
];
};
tests.version = testers.testVersion {
Expand Down
8 changes: 8 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9715,6 +9715,8 @@ self: super: with self; {

orvibo = callPackage ../development/python-modules/orvibo { };

os-client-config = callPackage ../development/python-modules/os-client-config { };

os-service-types = callPackage ../development/python-modules/os-service-types { };

osc = callPackage ../development/python-modules/osc { };
Expand Down Expand Up @@ -9761,6 +9763,8 @@ self: super: with self; {

ospd = callPackage ../development/python-modules/ospd { };

osprofiler = callPackage ../development/python-modules/osprofiler { };

osqp = callPackage ../development/python-modules/osqp { };

oss2 = callPackage ../development/python-modules/oss2 { };
Expand Down Expand Up @@ -10587,6 +10591,8 @@ self: super: with self; {

python-motionmount = callPackage ../development/python-modules/python-motionmount { };

python-octaviaclient = callPackage ../development/python-modules/python-octaviaclient { };

python-otbr-api = callPackage ../development/python-modules/python-otbr-api { };

python-openems = callPackage ../development/python-modules/python-openems { };
Expand Down Expand Up @@ -13015,6 +13021,8 @@ self: super: with self; {

python-mystrom = callPackage ../development/python-modules/python-mystrom { };

python-neutronclient = callPackage ../development/python-modules/python-neutronclient { };

python-nest = callPackage ../development/python-modules/python-nest { };

pythonnet = callPackage ../development/python-modules/pythonnet { };
Expand Down