From 3099aef9191c839ebdac502324b50e03656c205f Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 1 Oct 2025 10:56:51 +0200 Subject: [PATCH] Upgrade python version to 3.13 Change-Id: Iac995c4cf6521a33207e9ec228f49a53c3a23ec8 Signed-off-by: garciadeblas --- .gitignore | 2 + Dockerfile | 43 ++++--------- MANIFEST.in | 9 ++- devops-stages/stage-archive.sh | 7 +- devops-stages/stage-build.sh | 4 +- entrypoint.sh | 34 ++++++++++ pyproject.toml | 41 ++++++++++++ requirements-dist.in | 4 +- requirements-dist.txt | 16 +++-- requirements-test.txt | 6 -- setup.py | 45 ------------- {osm_common => src/osm_common}/__init__.py | 13 ---- .../osm_common}/common_utils.py | 0 {osm_common => src/osm_common}/dbbase.py | 0 {osm_common => src/osm_common}/dbmemory.py | 0 {osm_common => src/osm_common}/dbmongo.py | 0 {osm_common => src/osm_common}/fsbase.py | 0 {osm_common => src/osm_common}/fslocal.py | 0 {osm_common => src/osm_common}/fsmongo.py | 0 {osm_common => src/osm_common}/msgbase.py | 0 {osm_common => src/osm_common}/msgkafka.py | 0 {osm_common => src/osm_common}/msglocal.py | 0 src/osm_common/requirements.txt | 40 ++++++++++++ .../osm_common}/sol004_package.py | 0 .../osm_common}/sol007_package.py | 0 {osm_common => src/osm_common}/sol_package.py | 0 stdeb.cfg | 3 +- .../Definitions/invalid_package_vnfd.yaml | 0 .../Scripts/charms/simple/src/charm.py | 0 .../Scripts/cloud_init/cloud-config.txt | 62 +++++++++--------- .../TOSCA-Metadata/TOSCA.meta | 0 .../packages/invalid_package_vnf/manifest.mf | 0 .../Definitions/native_charm_vnfd.yaml | 0 .../Files/Changelog.txt | 0 .../Files/Licenses/License.lic | 0 .../Scripts/charms/simple/actions.yaml | 0 .../Scripts/charms/simple/config.yaml | 0 .../Scripts/charms/simple/hooks/install | 0 .../Scripts/charms/simple/hooks/start | 0 .../Scripts/charms/simple/metadata.yaml | 0 .../Scripts/charms/simple/src/charm.py | 0 .../Scripts/cloud_init/cloud-config.txt | 64 +++++++++---------- .../TOSCA-Metadata/TOSCA.meta | 0 .../manifest.mf | 0 .../ChangeLog.txt | 0 .../Licenses/License.lic | 0 .../Scripts/charms/simple/actions.yaml | 0 .../Scripts/charms/simple/config.yaml | 0 .../Scripts/charms/simple/hooks/install | 0 .../Scripts/charms/simple/hooks/start | 0 .../Scripts/charms/simple/metadata.yaml | 0 .../Scripts/charms/simple/src/charm.py | 0 .../Scripts/cloud_init/cloud-config.txt | 64 +++++++++---------- .../native_charm_vnfd.mf | 0 .../native_charm_vnfd.yaml | 0 {osm_common/tests => tests}/test_dbbase.py | 0 {osm_common/tests => tests}/test_dbmemory.py | 0 {osm_common/tests => tests}/test_dbmongo.py | 0 {osm_common/tests => tests}/test_fsbase.py | 0 {osm_common/tests => tests}/test_fslocal.py | 0 {osm_common/tests => tests}/test_fsmongo.py | 0 {osm_common/tests => tests}/test_msgbase.py | 0 {osm_common/tests => tests}/test_msglocal.py | 0 tox.ini | 26 ++------ 64 files changed, 256 insertions(+), 227 deletions(-) create mode 100755 entrypoint.sh create mode 100644 pyproject.toml delete mode 100644 setup.py rename {osm_common => src/osm_common}/__init__.py (63%) rename {osm_common => src/osm_common}/common_utils.py (100%) rename {osm_common => src/osm_common}/dbbase.py (100%) rename {osm_common => src/osm_common}/dbmemory.py (100%) rename {osm_common => src/osm_common}/dbmongo.py (100%) rename {osm_common => src/osm_common}/fsbase.py (100%) rename {osm_common => src/osm_common}/fslocal.py (100%) rename {osm_common => src/osm_common}/fsmongo.py (100%) rename {osm_common => src/osm_common}/msgbase.py (100%) rename {osm_common => src/osm_common}/msgkafka.py (100%) rename {osm_common => src/osm_common}/msglocal.py (100%) create mode 100644 src/osm_common/requirements.txt rename {osm_common => src/osm_common}/sol004_package.py (100%) rename {osm_common => src/osm_common}/sol007_package.py (100%) rename {osm_common => src/osm_common}/sol_package.py (100%) rename {osm_common/tests => tests}/packages/invalid_package_vnf/Definitions/invalid_package_vnfd.yaml (100%) rename {osm_common/tests => tests}/packages/invalid_package_vnf/Scripts/charms/simple/src/charm.py (100%) rename {osm_common/tests => tests}/packages/invalid_package_vnf/Scripts/cloud_init/cloud-config.txt (96%) rename {osm_common/tests => tests}/packages/invalid_package_vnf/TOSCA-Metadata/TOSCA.meta (100%) rename {osm_common/tests => tests}/packages/invalid_package_vnf/manifest.mf (100%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/Definitions/native_charm_vnfd.yaml (100%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/Files/Changelog.txt (100%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/Files/Licenses/License.lic (100%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/actions.yaml (100%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/config.yaml (100%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/hooks/install (100%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/hooks/start (100%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/metadata.yaml (100%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/src/charm.py (100%) rename {osm_common/tests/packages/native_charm_without_metadata_dir_vnf => tests/packages/native_charm_with_metadata_dir_vnf}/Scripts/cloud_init/cloud-config.txt (96%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/TOSCA-Metadata/TOSCA.meta (100%) rename {osm_common/tests => tests}/packages/native_charm_with_metadata_dir_vnf/manifest.mf (100%) rename {osm_common/tests => tests}/packages/native_charm_without_metadata_dir_vnf/ChangeLog.txt (100%) rename {osm_common/tests => tests}/packages/native_charm_without_metadata_dir_vnf/Licenses/License.lic (100%) rename {osm_common/tests => tests}/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/actions.yaml (100%) rename {osm_common/tests => tests}/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/config.yaml (100%) rename {osm_common/tests => tests}/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/hooks/install (100%) rename {osm_common/tests => tests}/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/hooks/start (100%) rename {osm_common/tests => tests}/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/metadata.yaml (100%) rename {osm_common/tests => tests}/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/src/charm.py (100%) rename {osm_common/tests/packages/native_charm_with_metadata_dir_vnf => tests/packages/native_charm_without_metadata_dir_vnf}/Scripts/cloud_init/cloud-config.txt (96%) rename {osm_common/tests => tests}/packages/native_charm_without_metadata_dir_vnf/native_charm_vnfd.mf (100%) rename {osm_common/tests => tests}/packages/native_charm_without_metadata_dir_vnf/native_charm_vnfd.yaml (100%) rename {osm_common/tests => tests}/test_dbbase.py (100%) rename {osm_common/tests => tests}/test_dbmemory.py (100%) rename {osm_common/tests => tests}/test_dbmongo.py (100%) rename {osm_common/tests => tests}/test_fsbase.py (100%) rename {osm_common/tests => tests}/test_fslocal.py (100%) rename {osm_common/tests => tests}/test_fsmongo.py (100%) rename {osm_common/tests => tests}/test_msgbase.py (100%) rename {osm_common/tests => tests}/test_msglocal.py (100%) diff --git a/.gitignore b/.gitignore index a022457..4f898ba 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,5 @@ __pycache__/ .pydevproject deb_dist *.tar.gz + +src/osm_common/_version.py diff --git a/Dockerfile b/Dockerfile index 27ab273..9907797 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,6 @@ +####################################################################################### +# 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 @@ -10,36 +13,18 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. -######################################################################################## -# 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 -# +####################################################################################### +FROM 31z4/tox -FROM ubuntu:22.04 +USER root -ARG APT_PROXY -RUN if [ ! -z $APT_PROXY ] ; then \ - echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\ - echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\ - fi +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends patch wget libmagic-dev; \ + rm -rf /var/lib/apt/lists/* -RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get -y install \ - debhelper \ - dh-python \ - git \ - python3 \ - python3-all \ - python3-dev \ - python3-setuptools \ - python3-pip \ - tox +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh -ENV LC_ALL C.UTF-8 -ENV LANG C.UTF-8 +ENTRYPOINT ["/entrypoint.sh"] +CMD ["devops-stages/stage-test.sh"] diff --git a/MANIFEST.in b/MANIFEST.in index e8fc479..14121eb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -16,6 +16,11 @@ # contact: bdiaz@whitestack.com or glavado@whitestack.com ## +graft src +graft tests +#graft docs + include README.rst -recursive-include osm_common *.py *.xml *.sh *.txt -recursive-include devops-stages * \ No newline at end of file +include tox.ini +recursive-include devops-stages * + diff --git a/devops-stages/stage-archive.sh b/devops-stages/stage-archive.sh index 34a613c..4d80eca 100755 --- a/devops-stages/stage-archive.sh +++ b/devops-stages/stage-archive.sh @@ -13,9 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -MDG=common -rm -rf pool -rm -rf dists -mkdir -p pool/$MDG -mv deb_dist/*.deb pool/$MDG/ - +echo "Nothing to be done" diff --git a/devops-stages/stage-build.sh b/devops-stages/stage-build.sh index 05b232e..4d80eca 100755 --- a/devops-stages/stage-build.sh +++ b/devops-stages/stage-build.sh @@ -13,6 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -rm -rf dist deb_dist osm_common-*.tar.gz osm_common.egg-info .eggs .tox - -tox -e dist +echo "Nothing to be done" diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..072028b --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +####################################################################################### +# 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. +####################################################################################### + +set -euo pipefail + +UID=${UID:-10000} +GID=${GID:-10000} + +# ensure group exists with given GID +if ! getent group "${GID}" > /dev/null; then + groupmod -o -g "${GID}" tox 2>/dev/null \ + || groupadd -o -g "${GID}" tox +fi + +# ensure tox user has the given UID +usermod -o -u "${UID}" -g "${GID}" tox \ + || useradd -o -m -u "${UID}" -g "${GID}" tox + +exec su tox "$@" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c1f65b5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +# 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. + +[build-system] +requires = ["setuptools>=61", "wheel", "setuptools_scm>=8.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "osm_common" +description = "OSM common utilities" +readme = "README.rst" +authors = [ + {name = "ETSI OSM", email = "osmsupport@etsi.com"} +] +maintainers = [ + {name = "ETSI OSM", email = "osmsupport@etsi.com"} +] +license = "Apache-2.0" +dynamic = ["dependencies", "version"] + +[tool.setuptools_scm] +write_to = "src/osm_common/_version.py" +version_scheme = "guess-next-dev" +local_scheme = "node-and-date" + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.dynamic] +dependencies = { file = [".//requirements.txt"] } + diff --git a/requirements-dist.in b/requirements-dist.in index 4f8784f..50670f7 100644 --- a/requirements-dist.in +++ b/requirements-dist.in @@ -13,6 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. +build stdeb -setuptools-version-command -setuptools<60 \ No newline at end of file +setuptools-scm diff --git a/requirements-dist.txt b/requirements-dist.txt index a46e321..3fec8d3 100644 --- a/requirements-dist.txt +++ b/requirements-dist.txt @@ -14,13 +14,19 @@ # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### -setuptools-version-command==99.9 +build==1.3.0 + # via -r requirements-dist.in +packaging==25.0 + # via + # build + # setuptools-scm +pyproject-hooks==1.2.0 + # via build +setuptools-scm==9.2.2 # via -r requirements-dist.in stdeb==0.11.0 # via -r requirements-dist.in # The following packages are considered to be unsafe in a requirements file: -setuptools==59.8.0 - # via - # -r requirements-dist.in - # setuptools-version-command +setuptools==80.9.0 + # via setuptools-scm diff --git a/requirements-test.txt b/requirements-test.txt index 9a41504..351a6cf 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -16,8 +16,6 @@ ####################################################################################### coverage==7.10.7 # via -r requirements-test.in -exceptiongroup==1.3.0 - # via pytest iniconfig==2.1.0 # via pytest nose2==0.15.1 @@ -30,7 +28,3 @@ pygments==2.19.2 # via pytest pytest==8.4.2 # via -r requirements-test.in -tomli==2.2.1 - # via pytest -typing-extensions==4.15.0 - # via exceptiongroup diff --git a/setup.py b/setup.py deleted file mode 100644 index 390ca7d..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright ETSI OSM Contributors -# -# 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. - - -import os - -from setuptools import setup - -here = os.path.abspath(os.path.dirname(__file__)) -_name = "osm_common" -README = open(os.path.join(here, "README.rst")).read() - -setup( - name=_name, - description="OSM common utilities", - long_description=README, - version_command=( - "git describe --tags --long --dirty --match v*", - "pep440-git-full", - ), - author="ETSI OSM", - author_email="osmsupport@etsi.com", - maintainer="ETSI OSM", - maintainer_email="osmsupport@etsi.com", - url="https://osm.etsi.org/gitweb/?p=osm/common.git;a=summary", - license="Apache 2.0", - setup_requires=["setuptools-version-command"], - packages=[_name], - include_package_data=True, -) diff --git a/osm_common/__init__.py b/src/osm_common/__init__.py similarity index 63% rename from osm_common/__init__.py rename to src/osm_common/__init__.py index c4c32da..f7c33b4 100644 --- a/osm_common/__init__.py +++ b/src/osm_common/__init__.py @@ -14,16 +14,3 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. -import logging - -version = "7.0.0.post4" -date_version = "2019-01-21" - -# try to get version from installed package. Skip if fails -try: - from pkg_resources import get_distribution - - version = get_distribution("osm_common").version - -except Exception as init_error: - logging.exception(f"{init_error} occured while getting the common version") diff --git a/osm_common/common_utils.py b/src/osm_common/common_utils.py similarity index 100% rename from osm_common/common_utils.py rename to src/osm_common/common_utils.py diff --git a/osm_common/dbbase.py b/src/osm_common/dbbase.py similarity index 100% rename from osm_common/dbbase.py rename to src/osm_common/dbbase.py diff --git a/osm_common/dbmemory.py b/src/osm_common/dbmemory.py similarity index 100% rename from osm_common/dbmemory.py rename to src/osm_common/dbmemory.py diff --git a/osm_common/dbmongo.py b/src/osm_common/dbmongo.py similarity index 100% rename from osm_common/dbmongo.py rename to src/osm_common/dbmongo.py diff --git a/osm_common/fsbase.py b/src/osm_common/fsbase.py similarity index 100% rename from osm_common/fsbase.py rename to src/osm_common/fsbase.py diff --git a/osm_common/fslocal.py b/src/osm_common/fslocal.py similarity index 100% rename from osm_common/fslocal.py rename to src/osm_common/fslocal.py diff --git a/osm_common/fsmongo.py b/src/osm_common/fsmongo.py similarity index 100% rename from osm_common/fsmongo.py rename to src/osm_common/fsmongo.py diff --git a/osm_common/msgbase.py b/src/osm_common/msgbase.py similarity index 100% rename from osm_common/msgbase.py rename to src/osm_common/msgbase.py diff --git a/osm_common/msgkafka.py b/src/osm_common/msgkafka.py similarity index 100% rename from osm_common/msgkafka.py rename to src/osm_common/msgkafka.py diff --git a/osm_common/msglocal.py b/src/osm_common/msglocal.py similarity index 100% rename from osm_common/msglocal.py rename to src/osm_common/msglocal.py diff --git a/src/osm_common/requirements.txt b/src/osm_common/requirements.txt new file mode 100644 index 0000000..24c9a05 --- /dev/null +++ b/src/osm_common/requirements.txt @@ -0,0 +1,40 @@ +####################################################################################### +# 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. +####################################################################################### +aiokafka==0.12.0 + # via -r requirements.in +async-timeout==4.0.3 + # via + # -r requirements.in + # aiokafka +dataclasses==0.6 + # via -r requirements.in +dnspython==2.8.0 + # via pymongo +motor==3.7.1 + # via -r requirements.in +packaging==25.0 + # via aiokafka +pycryptodome==3.23.0 + # via -r requirements.in +pymongo==4.15.2 + # via + # -r requirements.in + # motor +pyyaml==6.0.3 + # via -r requirements.in +typing-extensions==4.15.0 + # via aiokafka diff --git a/osm_common/sol004_package.py b/src/osm_common/sol004_package.py similarity index 100% rename from osm_common/sol004_package.py rename to src/osm_common/sol004_package.py diff --git a/osm_common/sol007_package.py b/src/osm_common/sol007_package.py similarity index 100% rename from osm_common/sol007_package.py rename to src/osm_common/sol007_package.py diff --git a/osm_common/sol_package.py b/src/osm_common/sol_package.py similarity index 100% rename from osm_common/sol_package.py rename to src/osm_common/sol_package.py diff --git a/stdeb.cfg b/stdeb.cfg index c6a1b3a..92fa10a 100644 --- a/stdeb.cfg +++ b/stdeb.cfg @@ -14,4 +14,5 @@ # limitations under the License. [DEFAULT] -X-Python3-Version : >= 3.5 +X-Python3-Version : >= 3.13 +X-Debian-Depends : python3, python3-pkg-resources \ No newline at end of file diff --git a/osm_common/tests/packages/invalid_package_vnf/Definitions/invalid_package_vnfd.yaml b/tests/packages/invalid_package_vnf/Definitions/invalid_package_vnfd.yaml similarity index 100% rename from osm_common/tests/packages/invalid_package_vnf/Definitions/invalid_package_vnfd.yaml rename to tests/packages/invalid_package_vnf/Definitions/invalid_package_vnfd.yaml diff --git a/osm_common/tests/packages/invalid_package_vnf/Scripts/charms/simple/src/charm.py b/tests/packages/invalid_package_vnf/Scripts/charms/simple/src/charm.py similarity index 100% rename from osm_common/tests/packages/invalid_package_vnf/Scripts/charms/simple/src/charm.py rename to tests/packages/invalid_package_vnf/Scripts/charms/simple/src/charm.py diff --git a/osm_common/tests/packages/invalid_package_vnf/Scripts/cloud_init/cloud-config.txt b/tests/packages/invalid_package_vnf/Scripts/cloud_init/cloud-config.txt similarity index 96% rename from osm_common/tests/packages/invalid_package_vnf/Scripts/cloud_init/cloud-config.txt rename to tests/packages/invalid_package_vnf/Scripts/cloud_init/cloud-config.txt index 5c78ae3..ad35ca2 100755 --- a/osm_common/tests/packages/invalid_package_vnf/Scripts/cloud_init/cloud-config.txt +++ b/tests/packages/invalid_package_vnf/Scripts/cloud_init/cloud-config.txt @@ -1,31 +1,31 @@ -# -# Copyright 2020 Whitestack, LLC -# ************************************************************* -# -# This file is part of OSM common repository. -# All Rights Reserved to Whitestack, LLC -# -# 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. -# - -#cloud-config -chpasswd: { expire: False } -ssh_pwauth: True - -write_files: -- content: | - # My new helloworld file - - owner: root:root - permissions: '0644' - path: /root/helloworld.txt +# +# Copyright 2020 Whitestack, LLC +# ************************************************************* +# +# This file is part of OSM common repository. +# All Rights Reserved to Whitestack, LLC +# +# 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. +# + +#cloud-config +chpasswd: { expire: False } +ssh_pwauth: True + +write_files: +- content: | + # My new helloworld file + + owner: root:root + permissions: '0644' + path: /root/helloworld.txt diff --git a/osm_common/tests/packages/invalid_package_vnf/TOSCA-Metadata/TOSCA.meta b/tests/packages/invalid_package_vnf/TOSCA-Metadata/TOSCA.meta similarity index 100% rename from osm_common/tests/packages/invalid_package_vnf/TOSCA-Metadata/TOSCA.meta rename to tests/packages/invalid_package_vnf/TOSCA-Metadata/TOSCA.meta diff --git a/osm_common/tests/packages/invalid_package_vnf/manifest.mf b/tests/packages/invalid_package_vnf/manifest.mf similarity index 100% rename from osm_common/tests/packages/invalid_package_vnf/manifest.mf rename to tests/packages/invalid_package_vnf/manifest.mf diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Definitions/native_charm_vnfd.yaml b/tests/packages/native_charm_with_metadata_dir_vnf/Definitions/native_charm_vnfd.yaml similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Definitions/native_charm_vnfd.yaml rename to tests/packages/native_charm_with_metadata_dir_vnf/Definitions/native_charm_vnfd.yaml diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Files/Changelog.txt b/tests/packages/native_charm_with_metadata_dir_vnf/Files/Changelog.txt similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Files/Changelog.txt rename to tests/packages/native_charm_with_metadata_dir_vnf/Files/Changelog.txt diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Files/Licenses/License.lic b/tests/packages/native_charm_with_metadata_dir_vnf/Files/Licenses/License.lic similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Files/Licenses/License.lic rename to tests/packages/native_charm_with_metadata_dir_vnf/Files/Licenses/License.lic diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/actions.yaml b/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/actions.yaml similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/actions.yaml rename to tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/actions.yaml diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/config.yaml b/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/config.yaml similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/config.yaml rename to tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/config.yaml diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/hooks/install b/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/hooks/install similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/hooks/install rename to tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/hooks/install diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/hooks/start b/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/hooks/start similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/hooks/start rename to tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/hooks/start diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/metadata.yaml b/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/metadata.yaml similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/metadata.yaml rename to tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/metadata.yaml diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/src/charm.py b/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/src/charm.py similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/src/charm.py rename to tests/packages/native_charm_with_metadata_dir_vnf/Scripts/charms/simple/src/charm.py diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt b/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt similarity index 96% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt rename to tests/packages/native_charm_with_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt index 1e33dd4..692547c 100755 --- a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt +++ b/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt @@ -1,32 +1,32 @@ -# -# Copyright 2020 Whitestack, LLC -# ************************************************************* -# -# This file is part of OSM common repository. -# All Rights Reserved to Whitestack, LLC -# -# 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. -# - - -#cloud-config -chpasswd: { expire: False } -ssh_pwauth: True - -write_files: -- content: | - # My new helloworld file - - owner: root:root - permissions: '0644' - path: /root/helloworld.txt +# +# Copyright 2020 Whitestack, LLC +# ************************************************************* +# +# This file is part of OSM common repository. +# All Rights Reserved to Whitestack, LLC +# +# 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. +# + + +#cloud-config +chpasswd: { expire: False } +ssh_pwauth: True + +write_files: +- content: | + # My new helloworld file + + owner: root:root + permissions: '0644' + path: /root/helloworld.txt diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/TOSCA-Metadata/TOSCA.meta b/tests/packages/native_charm_with_metadata_dir_vnf/TOSCA-Metadata/TOSCA.meta similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/TOSCA-Metadata/TOSCA.meta rename to tests/packages/native_charm_with_metadata_dir_vnf/TOSCA-Metadata/TOSCA.meta diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/manifest.mf b/tests/packages/native_charm_with_metadata_dir_vnf/manifest.mf similarity index 100% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/manifest.mf rename to tests/packages/native_charm_with_metadata_dir_vnf/manifest.mf diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/ChangeLog.txt b/tests/packages/native_charm_without_metadata_dir_vnf/ChangeLog.txt similarity index 100% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/ChangeLog.txt rename to tests/packages/native_charm_without_metadata_dir_vnf/ChangeLog.txt diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Licenses/License.lic b/tests/packages/native_charm_without_metadata_dir_vnf/Licenses/License.lic similarity index 100% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Licenses/License.lic rename to tests/packages/native_charm_without_metadata_dir_vnf/Licenses/License.lic diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/actions.yaml b/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/actions.yaml similarity index 100% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/actions.yaml rename to tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/actions.yaml diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/config.yaml b/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/config.yaml similarity index 100% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/config.yaml rename to tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/config.yaml diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/hooks/install b/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/hooks/install similarity index 100% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/hooks/install rename to tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/hooks/install diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/hooks/start b/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/hooks/start similarity index 100% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/hooks/start rename to tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/hooks/start diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/metadata.yaml b/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/metadata.yaml similarity index 100% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/metadata.yaml rename to tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/metadata.yaml diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/src/charm.py b/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/src/charm.py similarity index 100% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/src/charm.py rename to tests/packages/native_charm_without_metadata_dir_vnf/Scripts/charms/simple/src/charm.py diff --git a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt b/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt similarity index 96% rename from osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt rename to tests/packages/native_charm_without_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt index 1e33dd4..692547c 100755 --- a/osm_common/tests/packages/native_charm_with_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt +++ b/tests/packages/native_charm_without_metadata_dir_vnf/Scripts/cloud_init/cloud-config.txt @@ -1,32 +1,32 @@ -# -# Copyright 2020 Whitestack, LLC -# ************************************************************* -# -# This file is part of OSM common repository. -# All Rights Reserved to Whitestack, LLC -# -# 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. -# - - -#cloud-config -chpasswd: { expire: False } -ssh_pwauth: True - -write_files: -- content: | - # My new helloworld file - - owner: root:root - permissions: '0644' - path: /root/helloworld.txt +# +# Copyright 2020 Whitestack, LLC +# ************************************************************* +# +# This file is part of OSM common repository. +# All Rights Reserved to Whitestack, LLC +# +# 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. +# + + +#cloud-config +chpasswd: { expire: False } +ssh_pwauth: True + +write_files: +- content: | + # My new helloworld file + + owner: root:root + permissions: '0644' + path: /root/helloworld.txt diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/native_charm_vnfd.mf b/tests/packages/native_charm_without_metadata_dir_vnf/native_charm_vnfd.mf similarity index 100% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/native_charm_vnfd.mf rename to tests/packages/native_charm_without_metadata_dir_vnf/native_charm_vnfd.mf diff --git a/osm_common/tests/packages/native_charm_without_metadata_dir_vnf/native_charm_vnfd.yaml b/tests/packages/native_charm_without_metadata_dir_vnf/native_charm_vnfd.yaml similarity index 100% rename from osm_common/tests/packages/native_charm_without_metadata_dir_vnf/native_charm_vnfd.yaml rename to tests/packages/native_charm_without_metadata_dir_vnf/native_charm_vnfd.yaml diff --git a/osm_common/tests/test_dbbase.py b/tests/test_dbbase.py similarity index 100% rename from osm_common/tests/test_dbbase.py rename to tests/test_dbbase.py diff --git a/osm_common/tests/test_dbmemory.py b/tests/test_dbmemory.py similarity index 100% rename from osm_common/tests/test_dbmemory.py rename to tests/test_dbmemory.py diff --git a/osm_common/tests/test_dbmongo.py b/tests/test_dbmongo.py similarity index 100% rename from osm_common/tests/test_dbmongo.py rename to tests/test_dbmongo.py diff --git a/osm_common/tests/test_fsbase.py b/tests/test_fsbase.py similarity index 100% rename from osm_common/tests/test_fsbase.py rename to tests/test_fsbase.py diff --git a/osm_common/tests/test_fslocal.py b/tests/test_fslocal.py similarity index 100% rename from osm_common/tests/test_fslocal.py rename to tests/test_fslocal.py diff --git a/osm_common/tests/test_fsmongo.py b/tests/test_fsmongo.py similarity index 100% rename from osm_common/tests/test_fsmongo.py rename to tests/test_fsmongo.py diff --git a/osm_common/tests/test_msgbase.py b/tests/test_msgbase.py similarity index 100% rename from osm_common/tests/test_msgbase.py rename to tests/test_msgbase.py diff --git a/osm_common/tests/test_msglocal.py b/tests/test_msglocal.py similarity index 100% rename from osm_common/tests/test_msglocal.py rename to tests/test_msglocal.py diff --git a/tox.ini b/tox.ini index ddb7f9a..156492a 100644 --- a/tox.ini +++ b/tox.ini @@ -23,7 +23,7 @@ toxworkdir = /tmp/.tox [testenv] usedevelop = True -basepython = python3.10 +basepython = python3.13 setenv = VIRTUAL_ENV={envdir} PYTHONDONTWRITEBYTECODE = 1 deps = -r{toxinidir}/requirements.txt @@ -34,8 +34,7 @@ parallel_show_output = true deps = black==23.12.1 skip_install = true commands = - black --check --diff osm_common/ - black --check --diff setup.py + black --exclude "_version\.py$" --check --diff src/ tests/ ####################################################################################### [testenv:cover] @@ -44,7 +43,7 @@ deps = {[testenv]deps} commands = sh -c 'rm -f nosetests.xml' coverage erase - nose2 -C --coverage osm_common -s osm_common/tests + nose2 -C --coverage src -s tests coverage report --omit='*tests*' coverage html -d ./cover --omit='*tests*' coverage xml -o coverage.xml --omit=*tests* @@ -56,7 +55,7 @@ deps = flake8==6.0.0 flake8-import-order commands = - flake8 osm_common/ setup.py + flake8 src/ tests/ ####################################################################################### [testenv:pylint] @@ -64,7 +63,7 @@ deps = {[testenv]deps} -r{toxinidir}/requirements-test.txt pylint commands = - pylint -E osm_common + pylint -E src ####################################################################################### [testenv:safety] @@ -91,20 +90,6 @@ commands = sed -i -e '1 e head -16 tox.ini' $out ;\ done" -####################################################################################### -[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_common/requirements.txt' - python3 setup.py --command-packages=stdeb.command sdist_dsc - sh -c 'cd deb_dist/osm-common*/ && dpkg-buildpackage -rfakeroot -uc -us' - sh -c 'rm osm_common/requirements.txt' -allowlist_externals = sh - ####################################################################################### [testenv:release_notes] deps = reno @@ -133,3 +118,4 @@ max-line-length = 120 show-source = True builtins = _ import-order-style = google + -- 2.25.1