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

rename package xivo to wazo #144

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/make -f
# -*- makefile -*-

export PYBUILD_NAME=xivo
export PYBUILD_NAME=wazo
export PYBUILD_DESTDIR_python3=debian/xivo-lib-python-python3/
export PYBUILD_DISABLE=test

Expand Down
4 changes: 2 additions & 2 deletions integration_tests/assets/bin/myservice.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright 2016-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2016-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

Expand All @@ -13,7 +13,7 @@
import requests
from flask import Flask, Response, jsonify

from xivo.consul_helpers import ServiceCatalogRegistration
from wazo.consul_helpers import ServiceCatalogRegistration

UUID = 'foobar'

Expand Down
4 changes: 2 additions & 2 deletions integration_tests/assets/bin/thread-exception.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
# Copyright 2018-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2018-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

import threading
import time
from typing import NoReturn

from xivo import xivo_logging
from wazo import xivo_logging

xivo_logging.setup_logging('/dev/null')

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tool:pytest]
testpaths=xivo
testpaths=wazo
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
# Copyright 2007-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2007-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later

from setuptools import find_packages, setup

setup(
name='xivo',
name='wazo',
version='1.0',
description='These are useful python libraries to be used with XIVO code',
description='These are useful python libraries to be used with Wazo code',
author='Wazo Authors',
author_email='[email protected]',
url='http://wazo.community',
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ envlist = py39, linters

[testenv]
commands =
pytest --junitxml=unit-tests.xml --cov=xivo --cov-report term --cov-report xml:coverage.xml xivo {posargs}
pytest --junitxml=unit-tests.xml --cov=wazo --cov-report term --cov-report xml:coverage.xml wazo {posargs}
deps =
-rrequirements.txt
-rtest-requirements.txt
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions xivo/agitb.py → wazo/agitb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later

"""More comprehensive traceback formatting for AGI in Python.
Expand Down Expand Up @@ -53,7 +53,7 @@
from typing import TYPE_CHECKING, Any, Callable, NamedTuple, NewType, TextIO

if TYPE_CHECKING:
from xivo.agi import AGI
from wazo.agi import AGI

Undefined = NewType('Undefined', list[str])

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions xivo/cli/command/exit.py → wazo/cli/command/exit.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

from typing import NoReturn

from xivo.cli.command.base import BaseCommand
from wazo.cli.command.base import BaseCommand


class ExitCommand(BaseCommand):
Expand Down
6 changes: 3 additions & 3 deletions xivo/cli/command/help.py → wazo/cli/command/help.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

from operator import attrgetter
from typing import TYPE_CHECKING

from xivo.cli.command.base import BaseCommand
from xivo.cli.exception import NoMatchingCommandError
from wazo.cli.command.base import BaseCommand
from wazo.cli.exception import NoMatchingCommandError

if TYPE_CHECKING:
from ..registry import CommandRegistry
Expand Down
4 changes: 2 additions & 2 deletions xivo/cli/command/unknown.py → wazo/cli/command/unknown.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright 2017-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2017-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

from typing import NoReturn

from xivo.cli.command.base import BaseCommand
from wazo.cli.command.base import BaseCommand


class _BaseUnknownCommand(BaseCommand):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

Expand All @@ -7,8 +7,8 @@

from hamcrest import assert_that, equal_to

from xivo.cli.completion.completer import CommandLineCompleter
from xivo.cli.registry import CommandRegistry
from wazo.cli.completion.completer import CommandLineCompleter
from wazo.cli.registry import CommandRegistry


class TestCompleter(unittest.TestCase):
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions xivo/cli/executor.py → wazo/cli/executor.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

from collections.abc import Iterable
from typing import TYPE_CHECKING

from xivo.cli.exception import UsageError
from wazo.cli.exception import UsageError

if TYPE_CHECKING:
from .command.base import BaseCommand
Expand Down
24 changes: 12 additions & 12 deletions xivo/cli/facade.py → wazo/cli/facade.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

import os.path
import sys
from typing import TYPE_CHECKING

from xivo.cli import history
from xivo.cli.command.exit import ExitCommand
from xivo.cli.command.help import HelpCommand
from xivo.cli.command.unknown import PrintingUnknownCommand, _BaseUnknownCommand
from xivo.cli.completion.completer import CommandLineCompleter
from xivo.cli.completion.readline import ReadlineCompletionHelper
from xivo.cli.errorhandler import PrintTracebackErrorHandler, ReRaiseErrorHandler
from xivo.cli.executor import Executor
from xivo.cli.parser import RawCommandLineParser
from xivo.cli.registry import CommandRegistry
from xivo.cli.source.input import InputRawCommandLineSource
from wazo.cli import history
from wazo.cli.command.exit import ExitCommand
from wazo.cli.command.help import HelpCommand
from wazo.cli.command.unknown import PrintingUnknownCommand, _BaseUnknownCommand
from wazo.cli.completion.completer import CommandLineCompleter
from wazo.cli.completion.readline import ReadlineCompletionHelper
from wazo.cli.errorhandler import PrintTracebackErrorHandler, ReRaiseErrorHandler
from wazo.cli.executor import Executor
from wazo.cli.parser import RawCommandLineParser
from wazo.cli.registry import CommandRegistry
from wazo.cli.source.input import InputRawCommandLineSource

if TYPE_CHECKING:
from .command.base import BaseCommand
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions xivo/cli/parser.py → wazo/cli/parser.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

from typing import TYPE_CHECKING

from xivo.cli.commandline import CommandLine
from xivo.cli.exception import NoMatchingCommandError
from wazo.cli.commandline import CommandLine
from wazo.cli.exception import NoMatchingCommandError

if TYPE_CHECKING:
from .registry import CommandRegistry
Expand Down
4 changes: 2 additions & 2 deletions xivo/cli/registry.py → wazo/cli/registry.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

from collections.abc import Sequence
from typing import TYPE_CHECKING, Any

from xivo.cli.exception import CommandAlreadyRegisteredError, NoMatchingCommandError
from wazo.cli.exception import CommandAlreadyRegisteredError, NoMatchingCommandError

if TYPE_CHECKING:
from .command.base import BaseCommand
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later


Expand All @@ -7,9 +7,9 @@

from hamcrest import assert_that, equal_to, none

from xivo.cli.exception import NoMatchingCommandError
from xivo.cli.parser import RawCommandLineParser
from xivo.cli.registry import CommandRegistry
from wazo.cli.exception import NoMatchingCommandError
from wazo.cli.parser import RawCommandLineParser
from wazo.cli.registry import CommandRegistry


class TestRawCommandLineParser(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later


Expand All @@ -7,8 +7,8 @@

from hamcrest import assert_that, contains_inanyorder, equal_to

from xivo.cli.exception import CommandAlreadyRegisteredError, NoMatchingCommandError
from xivo.cli.registry import CommandRegistry
from wazo.cli.exception import CommandAlreadyRegisteredError, NoMatchingCommandError
from wazo.cli.registry import CommandRegistry


class TestCommandRegistry(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions xivo/cli/tests/test_utils.py → wazo/cli/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later


import unittest

from xivo.cli.utils import compute_ids
from wazo.cli.utils import compute_ids


class TestComputeIDs(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions xivo/cli/utils.py → wazo/cli/utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations

import functools
from typing import Any, Callable, TypeVar

from xivo.cli.exception import UsageError
from wazo.cli.exception import UsageError

R = TypeVar('R')

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import pytest

from xivo.auth_verifier import Unauthorized, no_auth, required_acl, required_tenant
from xivo.http_exceptions import InvalidTokenAPIException
from wazo.auth_verifier import Unauthorized, no_auth, required_acl, required_tenant
from wazo.http_exceptions import InvalidTokenAPIException

from ..auth_verifier import AuthVerifierFlask

Expand All @@ -33,11 +33,11 @@ def decorated():
return s.result

with patch(
'xivo.flask.auth_verifier.extract_tenant_id_from_header',
'wazo.flask.auth_verifier.extract_tenant_id_from_header',
tenant_extractor,
):
with patch('xivo.flask.auth_verifier.g', mock_g):
with patch('xivo.tenant_flask_helpers.g', mock_g):
with patch('wazo.flask.auth_verifier.g', mock_g):
with patch('wazo.tenant_flask_helpers.g', mock_g):
result = decorated()

assert result == s.result
Expand Down Expand Up @@ -71,8 +71,8 @@ def test_verify_tenant_decorator(self):
def decorated():
return s.result

with patch('xivo.flask.auth_verifier.g', mock_g):
with patch('xivo.tenant_flask_helpers.g', mock_g):
with patch('wazo.flask.auth_verifier.g', mock_g):
with patch('wazo.tenant_flask_helpers.g', mock_g):
result = decorated()

assert result == s.result
Expand Down Expand Up @@ -108,8 +108,8 @@ def test_verify_tenant_when_invalid_token(self):
def decorated():
return s.result

with patch('xivo.flask.auth_verifier.g', mock_g):
with patch('xivo.tenant_flask_helpers.g', mock_g):
with patch('wazo.flask.auth_verifier.g', mock_g):
with patch('wazo.tenant_flask_helpers.g', mock_g):
with pytest.raises(Unauthorized) as exc_info:
decorated()

Expand Down
2 changes: 1 addition & 1 deletion xivo/http_exceptions.py → wazo/http_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import requests

from xivo import rest_api_helpers
from wazo import rest_api_helpers


class Unauthorized(rest_api_helpers.APIException):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from wazo_auth_client import Client as AuthClient
from werkzeug.local import LocalProxy

from xivo.tenant_helpers import Token, User
from wazo.tenant_helpers import Token, User

from . import tenant_helpers

Expand Down
4 changes: 2 additions & 2 deletions xivo/tenant_helpers.py → wazo/tenant_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import requests

from xivo import rest_api_helpers
from xivo.http_exceptions import AuthServerUnreachable, InvalidTokenAPIException
from wazo import rest_api_helpers
from wazo.http_exceptions import AuthServerUnreachable, InvalidTokenAPIException

# Necessary to avoid a dependency in provd
try:
Expand Down
Empty file added wazo/tests/__init__.py
Empty file.
File renamed without changes.
6 changes: 3 additions & 3 deletions xivo/tests/test_caller_id.py → wazo/tests/test_caller_id.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright 2013-2023 The Wazo Authors (see the AUTHORS file)
# Copyright 2013-2024 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later

import unittest

from hamcrest import assert_that, equal_to

from xivo import caller_id
from xivo.caller_id import extract_displayname, extract_number, is_complete_caller_id
from wazo import caller_id
from wazo.caller_id import extract_displayname, extract_number, is_complete_caller_id


class TestCallerID(unittest.TestCase):
Expand Down
File renamed without changes.
Loading