--- /dev/null
+# Copyright ETSI Contributors and others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+__pycache__
+*.pyc
+.tox/
+dist/
+.cache/
+.local/
+.eggs
+osm_lcm.egg-info/
+.coverage
+cover
+coverage.xml
+.tox
+nosetests.xml
+.cache
+.vscode/
+.project
+.settings
+.pydevproject
+pyvenv.cfg
+venv/
--- /dev/null
+# Copyright Contributors to ETSI OSM
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+include:
+ - project: 'devops/cicd'
+ file: '/templates/osm-base.yml'
-# Copyright 2018 Telefonica S.A.
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
-# This Dockerfile is intented for devops and deb package generation
+########################################################################################
+# This Dockerfile is intented for devops testing and deb package generation
+#
+# To run stage 2 locally:
+#
+# docker build -t stage2 .
+# docker run -ti -v `pwd`:/work -w /work --entrypoint /bin/bash stage2
+# devops-stages/stage-test.sh
+# devops-stages/stage-build.sh
#
-# Use Dockerfile.local for running osm/LCM in a docker container from source
-
FROM ubuntu:18.04
-RUN apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get --yes install git tox make debhelper wget \
- python-all python3 python3-pip python3-all apt-utils && \
- DEBIAN_FRONTEND=noninteractive pip3 install -U setuptools setuptools-version-command stdeb
-
-# TODO delete if not needed:
-# libcurl4-gnutls-dev libgnutls-dev python-dev python3-dev python-setuptools
-
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get -y install \
+ debhelper \
+ git \
+ python3 \
+ python3-all \
+ python3-dev \
+ python3-setuptools
-# Uncomment this block to generate automatically a debian package and show info
-# # Set the working directory to /app
-# WORKDIR /app
-# # Copy the current directory contents into the container at /app
-# ADD . /app
-# CMD /app/devops-stages/stage-build.sh && find -name "*.deb" -exec dpkg -I {} ";"
+RUN python3 -m easy_install pip==21.0.1
+RUN pip3 install tox==3.22.0
+ENV LC_ALL C.UTF-8
+ENV LANG C.UTF-8
# limitations under the License.
include README.rst
-recursive-include osm_lcm *.py *.xml *.sh lcm.cfg
+recursive-include osm_lcm *.py *.xml *.sh lcm.cfg *.txt
recursive-include devops-stages *
+++ /dev/null
-# Copyright 2018 Telefonica S.A.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-all: clean package
-
-clean:
- rm -rf dist deb_dist osm_lcm-*.tar.gz osm_lcm.egg-info .eggs
-
-package:
- python3 setup.py --command-packages=stdeb.command sdist_dsc
- cp debian/python3-osm-lcm.postinst deb_dist/osm-lcm*/debian
- # cd deb_dist/osm-lcm*/debian && echo "osm-common python3-osm-common" > py3dist-overrides
- # cd deb_dist/osm-lcm*/debian && echo "pip3 python3-pip" >> py3dist-overrides
- cd deb_dist/osm-lcm*/ && dpkg-buildpackage -rfakeroot -uc -us
-
+++ /dev/null
-#!/bin/bash
-
-##
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# For those usages not covered by the Apache License, Version 2.0 please
-# contact with: OSM_TECH@list.etsi.org
-##
-
-echo "POST INSTALL OSM-LCM"
-echo "Installing python dependencies grpcio-tools grpclib via pip..."
-echo
-python3 -m pip install -U pip
-python3 -m pip install grpcio-tools grpclib
-
-# Creation of log folder
-# mkdir -p /var/log/osm
-
# under the License.
##
-# For the moment it is not needed any post-intall action, so tox instead of Makefile is used
-
-make clean package
+rm -rf dist deb_dist osm*.tar.gz *.egg-info .eggs
+tox -e dist
\ No newline at end of file
# License for the specific language governing permissions and limitations
# under the License.
##
-rm -f nosetests.xml
-tox # flake8 unittest
+
+OUTPUT=$(TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto)
+printf "$OUTPUT"
--- /dev/null
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+git+https://osm.etsi.org/gerrit/osm/common.git@v9.0#egg=osm-common
+-r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=v9.0
+
+git+https://osm.etsi.org/gerrit/osm/N2VC.git@v9.0#egg=n2vc
+-r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
--- /dev/null
+aiokafka==0.7.0
+ # via -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=v9.0
+async-timeout==3.0.1
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # retrying-async
+bcrypt==3.2.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # paramiko
+cachetools==4.2.1
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # google-auth
+certifi==2020.12.5
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # kubernetes
+ # requests
+cffi==1.14.5
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # bcrypt
+ # cryptography
+ # pynacl
+chardet==4.0.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # requests
+cryptography==3.4.7
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # paramiko
+dataclasses==0.6
+ # via -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=v9.0
+google-auth==1.28.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # kubernetes
+idna==2.10
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # requests
+juju==2.8.4
+ # via -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+jujubundlelib==0.5.6
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # theblues
+kafka-python==2.0.2
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # aiokafka
+kubernetes==10.0.1
+ # via -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+macaroonbakery==1.3.1
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # juju
+ # theblues
+motor==1.3.1
+ # via -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+mypy-extensions==0.4.3
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # typing-inspect
+git+https://osm.etsi.org/gerrit/osm/N2VC.git@v9.0#egg=n2vc
+ # via -r requirements-dev.in
+oauthlib==3.1.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # requests-oauthlib
+git+https://osm.etsi.org/gerrit/osm/common.git@v9.0#egg=osm-common
+ # via -r requirements-dev.in
+paramiko==2.7.2
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # juju
+protobuf==3.15.6
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # macaroonbakery
+pyasn1-modules==0.2.8
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # google-auth
+pyasn1==0.4.8
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # juju
+ # pyasn1-modules
+ # rsa
+pycparser==2.20
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # cffi
+pycrypto==2.6.1
+ # via -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=v9.0
+pymacaroons==0.13.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # macaroonbakery
+pymongo==3.11.3
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # motor
+pynacl==1.4.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # macaroonbakery
+ # paramiko
+ # pymacaroons
+pyrfc3339==1.1
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # juju
+ # macaroonbakery
+python-dateutil==2.8.1
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # kubernetes
+pytz==2021.1
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # pyrfc3339
+pyyaml==5.4.1
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # -r https://osm.etsi.org/gitweb/?p=osm/common.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # juju
+ # jujubundlelib
+ # kubernetes
+requests-oauthlib==1.3.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # kubernetes
+requests==2.25.1
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # kubernetes
+ # macaroonbakery
+ # requests-oauthlib
+ # theblues
+retrying-async==1.2.0
+ # via -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+rsa==4.7.2
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # google-auth
+six==1.15.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # bcrypt
+ # google-auth
+ # kubernetes
+ # macaroonbakery
+ # protobuf
+ # pymacaroons
+ # pynacl
+ # python-dateutil
+ # websocket-client
+theblues==0.5.2
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # juju
+toposort==1.6
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # juju
+typing-extensions==3.7.4.3
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # typing-inspect
+typing-inspect==0.6.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # juju
+urllib3==1.26.4
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # kubernetes
+ # requests
+websocket-client==0.58.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # kubernetes
+websockets==7.0
+ # via
+ # -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=v9.0
+ # juju
+
+# The following packages are considered to be unsafe in a requirements file:
+# setuptools
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
--- /dev/null
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+stdeb
+setuptools-version-command
\ No newline at end of file
--- /dev/null
+setuptools-version-command==2.2
+ # via -r requirements-dist.in
+stdeb==0.10.0
+ # via -r requirements-dist.in
+
+# The following packages are considered to be unsafe in a requirements file:
+# setuptools
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
--- /dev/null
+# Copyright 2018 Telefonica S.A.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+asynctest
+coverage
+mock
+nose2
\ No newline at end of file
--- /dev/null
+asynctest==0.13.0
+ # via -r requirements-test.in
+coverage==5.5
+ # via
+ # -r requirements-test.in
+ # nose2
+mock==4.0.3
+ # via -r requirements-test.in
+nose2==0.10.0
+ # via -r requirements-test.in
+six==1.15.0
+ # via nose2
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
--- /dev/null
+##
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+##
+
+aiohttp
+grpcio-tools
+grpclib
+idna==2.10
+jinja2
+pyyaml
-##
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
+aiohttp==3.7.4.post0
+ # via -r requirements.in
+async-timeout==3.0.1
+ # via aiohttp
+attrs==20.3.0
+ # via aiohttp
+chardet==4.0.0
+ # via aiohttp
+grpcio-tools==1.36.1
+ # via -r requirements.in
+grpcio==1.36.1
+ # via grpcio-tools
+grpclib==0.4.1
+ # via -r requirements.in
+h2==4.0.0
+ # via grpclib
+hpack==4.0.0
+ # via h2
+hyperframe==6.0.0
+ # via h2
+idna==2.10
+ # via
+ # -r requirements.in
+ # yarl
+jinja2==2.11.3
+ # via -r requirements.in
+markupsafe==1.1.1
+ # via jinja2
+multidict==5.1.0
+ # via
+ # aiohttp
+ # grpclib
+ # yarl
+protobuf==3.15.6
+ # via grpcio-tools
+pyyaml==5.4.1
+ # via -r requirements.in
+six==1.15.0
+ # via
+ # grpcio
+ # protobuf
+typing-extensions==3.7.4.3
+ # via aiohttp
+yarl==1.6.3
+ # via aiohttp
+
+# The following packages are considered to be unsafe in a requirements file:
+# setuptools
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-pyyaml
-aiohttp>=2.3.10
-jinja2
-grpcio-tools
-grpclib
-git+https://osm.etsi.org/gerrit/osm/common.git@v9.0#egg=osm-common
-git+https://osm.etsi.org/gerrit/osm/N2VC.git@v9.0#egg=n2vc
-
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
# version is at first line of osm_lcm/html_public/version
here = os.path.abspath(os.path.dirname(__file__))
# VERSION = "4.0.1rc1"
-with open(os.path.join(here, 'README.rst')) as readme_file:
+with open(os.path.join(here, "README.rst")) as readme_file:
README = readme_file.read()
setup(
name=_name,
- description='OSM Life Cycle Management module',
+ description="OSM Life Cycle Management module",
long_description=README,
- version_command=('git describe --match v* --tags --long --dirty', 'pep440-git-full'),
+ version_command=(
+ "git describe --match v* --tags --long --dirty",
+ "pep440-git-full",
+ ),
# version=VERSION,
# python_requires='>3.5.0',
- author='ETSI OSM',
- author_email='alfonso.tiernosepulveda@telefonica.com',
- maintainer='Alfonso Tierno',
- maintainer_email='alfonso.tiernosepulveda@telefonica.com',
- url='https://osm.etsi.org/gitweb/?p=osm/LCM.git;a=summary',
- license='Apache 2.0',
-
+ author="ETSI OSM",
+ author_email="osmsupport@etsi.org",
+ maintainer="ETSI OSM",
+ maintainer_email="osmsupport@etsi.org",
+ url="https://osm.etsi.org/gitweb/?p=osm/LCM.git;a=summary",
+ license="Apache 2.0",
packages=[_name],
include_package_data=True,
- # data_files=[('/etc/osm/', ['osm_lcm/lcm.cfg']),
- # ('/etc/systemd/system/', ['osm_lcm/osm-lcm.service']),
- # ],
- install_requires=[
- # 'pymongo',
- 'PyYAML',
- 'aiohttp>=2.3.10',
- 'osm-common',
- 'n2vc',
- 'jinja2',
- 'grpcio-tools',
- 'grpclib',
- # TODO this is version installed by 'apt python3-aiohttp' on Ubuntu Sserver 14.04
- # version installed by pip 3.3.2 is not compatible. Code should be migrated to this version and use pip3
- ],
- setup_requires=['setuptools-version-command'],
+ setup_requires=["setuptools-version-command"],
)
##
[DEFAULT]
X-Python3-Version : >= 3.6
-Depends3: python3-osm-common, python3-n2vc, python3-yaml, python3-aiohttp, python3-jinja2, python3-pip
+++ /dev/null
-# Copyright 2018 Telefonica S.A.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-flake8<3.0
-asynctest
-
-# Copyright 2018 Telefonica S.A.
+#######################################################################################
+# Copyright ETSI Contributors and Others.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+#######################################################################################
[tox]
-envlist = cover, flake8
+envlist = black, cover, flake8, pylint, safety
+
+[tox:jenkins]
+toxworkdir = /tmp/.tox
[testenv]
usedevelop = True
basepython = python3
-install_command = python3 -m pip install -r requirements.txt -U {opts} {packages}
+setenv = VIRTUAL_ENV={envdir}
+ PYTHONDONTWRITEBYTECODE = 1
+deps = -r{toxinidir}/requirements.txt
+
+#######################################################################################
+[testenv:black]
+deps = black
+skip_install = true
+commands =
+ - black --check --diff osm_lcm/
+ - black --check --diff setup.py
+
+#######################################################################################
[testenv:cover]
-basepython = python3
-deps =
- nose2
- nose2-cov
- coverage
- -rrequirements.txt
- -rtest-requirements.txt
+deps = {[testenv]deps}
+ -r{toxinidir}/requirements-dev.txt
+ -r{toxinidir}/requirements-test.txt
commands =
- coverage erase
- nose2 -C --coverage osm_lcm --plugin nose2.plugins.junitxml -s osm_lcm/tests
- coverage report --omit='*tests*'
- coverage html -d ./cover --omit='*tests*'
- coverage xml -o coverage.xml --omit='*tests*'
+ sh -c 'rm -f nosetests.xml'
+ coverage erase
+ nose2 -C --coverage osm_lcm
+ coverage report --omit='*tests*'
+ coverage html -d ./cover --omit='*tests*'
+ coverage xml -o coverage.xml --omit=*tests*
+whitelist_externals = sh
+
+#######################################################################################
[testenv:flake8]
-basepython = python3
-deps =
- flake8
- -rrequirements.txt
-commands = flake8 osm_lcm --max-line-length 120 \
- --exclude .svn,CVS,.gz,.git,__pycache__,.tox,local,temp,frontend_grpc.py,frontend_pb2.py \
- --ignore W291,W293,E226,W504
-
-[testenv:build]
-basepython = python3
-deps = stdeb
- setuptools-version-command
-commands = python3 setup.py --command-packages=stdeb.command bdist_deb
+deps = flake8
+commands =
+ flake8 osm_lcm/ setup.py
+
+
+#######################################################################################
+[testenv:pylint]
+deps = {[testenv]deps}
+ -r{toxinidir}/requirements-dev.txt
+ -r{toxinidir}/requirements-test.txt
+ pylint
+commands =
+ - pylint -E osm_lcm
+
+
+#######################################################################################
+[testenv:safety]
+setenv =
+ LC_ALL=C.UTF-8
+ LANG=C.UTF-8
+deps = {[testenv]deps}
+ safety
+commands =
+ - safety check --full-report
+
+
+#######################################################################################
+[testenv:pip-compile]
+deps = pip-tools==5.5.0
+commands =
+ - sh -c 'for file in requirements*.in ; do pip-compile -rU --no-header $file ;\
+ out=`echo $file | sed "s/.in/.txt/"` ; \
+ head -16 tox.ini >> $out ;\
+ done'
+whitelist_externals = sh
+
+
+#######################################################################################
+[testenv:dist]
+deps = {[testenv]deps}
+ -r{toxinidir}/requirements-dist.txt
+
+# In the commands, we copy the requirements.txt to be presented as a source file (.py)
+# so it gets included in the .deb package for others to consume
+commands =
+ sh -c 'cp requirements.txt osm_lcm/requirements.txt'
+ python3 setup.py --command-packages=stdeb.command sdist_dsc
+ sh -c 'cd deb_dist/osm-lcm*/ && dpkg-buildpackage -rfakeroot -uc -us'
+ sh -c 'rm osm_lcm/requirements.txt'
+whitelist_externals = sh
+#######################################################################################
+[flake8]
+ignore =
+ W291,
+ W293,
+ W503,
+ E123,
+ E125,
+ E226,
+ E241,
+# Temporary until code can be reformatted
+ E121,
+ E122,
+ E203,
+ E303,
+ E501
+ W504
+exclude =
+ .git,
+ __pycache__,
+ .tox,
+max-line-length = 120
+show-source = True
+builtins = _