Skip to content

Commit

Permalink
Merge pull request #214 from atlanticwave-sdx/213.rename-swagger-server
Browse files Browse the repository at this point in the history
Rename `swagger_server` to `sdx_controller`
  • Loading branch information
sajith authored Jan 30, 2024
2 parents 07f876f + a7c9167 commit 05e3e5c
Show file tree
Hide file tree
Showing 50 changed files with 95 additions and 95 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
steps:

- name: Check out sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip" # cache pip dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# Collect metadata for container image tags
# See https://github.com/docker/metadata-action
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:
steps:

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # cache pip dependencies
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ dmypy.json
/*.sqlite3-wal

/db/*
/swagger_server/_version.py
/sdx_controller/_version.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ $ python3 -m venv venv --upgrade-deps
$ source ./venv/bin/activate
$ pip3 install [--editable] .
$ source .env
$ python3 -m swagger_server
$ python3 -m sdx_controller
```

### Test topology files and connection requests
Expand Down
Empty file removed db/.empty
Empty file.
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = [
"setuptools >= 61.0",
# "setuptools-scm >= 6.2",
"setuptools-scm >= 6.2",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -53,31 +53,31 @@ lint = [
where = "swagger_server"

[tool.setuptools]
packages = ["swagger_server", "bapm_server"]
packages = ["sdx_controller", "bapm_server"]

[tool.setuptools_scm]
# Write version info collected from git to a file. This happens when
# we run `python -m build`.
write_to = "swagger_server/_version.py"
# during package build step.
write_to = "sdx_controller/_version.py"

[tool.black]
include = '\.py?$'

[tool.isort]
profile = "black"
src_paths = ["swagger_server", "bapm_server"]
src_paths = ["sdx_controller", "bapm_server"]

[tool.coverage.run]
branch = true
omit = [ "swagger_server/test/*" ]
omit = [ "sdx_controller/test/*" ]
relative_files = true

# The section below will let us have relative paths in test coverage
# report. See https://hynek.me/articles/testing-packaging/
[tool.coverage.paths]
source = [
# In checkouts.
"swagger_server/",
"sdx_controller/",
"bapm_server/",
# In installed paths.
"**/site-packages/",
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions swagger_server/__main__.py → sdx_controller/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import connexion
from sdx_pce.topology.manager import TopologyManager

from swagger_server import encoder
from swagger_server.messaging.rpc_queue_consumer import RpcConsumer
from swagger_server.utils.db_utils import DbUtils
from sdx_controller import encoder
from sdx_controller.messaging.rpc_queue_consumer import RpcConsumer
from sdx_controller.utils.db_utils import DbUtils

logger = logging.getLogger(__name__)
logging.getLogger("pika").setLevel(logging.WARNING)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import connexion

from swagger_server.handlers.connection_handler import ConnectionHandler
from swagger_server.utils.db_utils import DbUtils
from sdx_controller.handlers.connection_handler import ConnectionHandler
from sdx_controller.utils.db_utils import DbUtils

LOG_FORMAT = (
"%(levelname) -10s %(asctime)s %(name) -30s %(funcName) "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from sdx_pce.topology.grenmlconverter import GrenmlConverter
from sdx_pce.topology.manager import TopologyManager

from swagger_server.utils.db_utils import DbUtils
from sdx_controller.utils.db_utils import DbUtils

# Get DB connection and tables set up.
db_instance = DbUtils()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import connexion

from swagger_server.models.user import User # noqa: E501
from sdx_controller.models.user import User # noqa: E501


def create_user(body): # noqa: E501
Expand Down
2 changes: 1 addition & 1 deletion swagger_server/encoder.py → sdx_controller/encoder.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import six
from connexion.apps.flask_app import FlaskJSONEncoder

from swagger_server.models.base_model_ import Model
from sdx_controller.models.base_model_ import Model


class JSONEncoder(FlaskJSONEncoder):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from sdx_pce.load_balancing.te_solver import TESolver
from sdx_pce.topology.temanager import TEManager

from swagger_server.messaging.topic_queue_producer import TopicQueueProducer
from swagger_server.models.simple_link import SimpleLink
from swagger_server.utils.parse_helper import ParseHelper
from sdx_controller.messaging.topic_queue_producer import TopicQueueProducer
from sdx_controller.models.simple_link import SimpleLink
from sdx_controller.utils.parse_helper import ParseHelper

logger = logging.getLogger(__name__)
logging.getLogger("pika").setLevel(logging.WARNING)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json
import logging

from swagger_server.handlers.connection_handler import ConnectionHandler
from swagger_server.utils.parse_helper import ParseHelper
from sdx_controller.handlers.connection_handler import ConnectionHandler
from sdx_controller.utils.parse_helper import ParseHelper

logger = logging.getLogger(__name__)

Expand Down
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 pika

from swagger_server.handlers.lc_message_handler import LcMessageHandler
from swagger_server.utils.parse_helper import ParseHelper
from sdx_controller.handlers.lc_message_handler import LcMessageHandler
from sdx_controller.utils.parse_helper import ParseHelper

MQ_HOST = os.environ.get("MQ_HOST")
# subscribe to the corresponding queue
Expand Down
14 changes: 14 additions & 0 deletions sdx_controller/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# coding: utf-8

# flake8: noqa
from __future__ import absolute_import

# import models into model package
from sdx_controller.models.api_response import ApiResponse
from sdx_controller.models.connection import Connection
from sdx_controller.models.link import Link
from sdx_controller.models.location import Location
from sdx_controller.models.node import Node
from sdx_controller.models.port import Port
from sdx_controller.models.topology import Topology
from sdx_controller.models.user import User
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from datetime import date, datetime # noqa: F401
from typing import Dict, List # noqa: F401

from swagger_server import util
from swagger_server.models.base_model_ import Model
from sdx_controller import util
from sdx_controller.models.base_model_ import Model


class ApiResponse(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import six

from swagger_server import util
from sdx_controller import util

T = typing.TypeVar("T")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from datetime import date, datetime # noqa: F401
from typing import Dict, List # noqa: F401

from swagger_server import util
from swagger_server.models.base_model_ import Model
from swagger_server.models.port import Port # noqa: F401,E501
from sdx_controller import util
from sdx_controller.models.base_model_ import Model
from sdx_controller.models.port import Port # noqa: F401,E501


class Connection(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from datetime import date, datetime # noqa: F401
from typing import Dict, List # noqa: F401

from swagger_server import util
from swagger_server.models.base_model_ import Model
from swagger_server.models.port import Port # noqa: F401,E501
from sdx_controller import util
from sdx_controller.models.base_model_ import Model
from sdx_controller.models.port import Port # noqa: F401,E501


class Link(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from datetime import date, datetime # noqa: F401
from typing import Dict, List # noqa: F401

from swagger_server import util
from swagger_server.models.base_model_ import Model
from sdx_controller import util
from sdx_controller.models.base_model_ import Model


class Location(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from datetime import date, datetime # noqa: F401
from typing import Dict, List # noqa: F401

from swagger_server import util
from swagger_server.models.base_model_ import Model
from swagger_server.models.location import Location # noqa: F401,E501
from swagger_server.models.port import Port # noqa: F401,E501
from sdx_controller import util
from sdx_controller.models.base_model_ import Model
from sdx_controller.models.location import Location # noqa: F401,E501
from sdx_controller.models.port import Port # noqa: F401,E501


class Node(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from datetime import date, datetime # noqa: F401
from typing import Dict, List # noqa: F401

from swagger_server import util
from swagger_server.models.base_model_ import Model
from sdx_controller import util
from sdx_controller.models.base_model_ import Model


class Port(Model):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from datetime import date, datetime # noqa: F401
from typing import Dict, List # noqa: F401

from swagger_server import util
from swagger_server.models.base_model_ import Model
from swagger_server.models.link import Link # noqa: F401,E501
from swagger_server.models.node import Node # noqa: F401,E501
from sdx_controller import util
from sdx_controller.models.base_model_ import Model
from sdx_controller.models.link import Link # noqa: F401,E501
from sdx_controller.models.node import Node # noqa: F401,E501


class Topology(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from datetime import date, datetime # noqa: F401
from typing import Dict, List # noqa: F401

from swagger_server import util
from swagger_server.models.base_model_ import Model
from sdx_controller import util
from sdx_controller.models.base_model_ import Model


class User(Model):
Expand Down
Loading

0 comments on commit 05e3e5c

Please sign in to comment.