From 84e90b31c534996f44ef0f3402a88d1ee79e7fe2 Mon Sep 17 00:00:00 2001 From: Hemanth Nakkina Date: Thu, 4 Aug 2022 11:59:05 +0530 Subject: [PATCH] cleanup on migration to opendev Remove references to old repo Add .gitreview Add .zuul.yaml Change-Id: I66f0effc29d68564c01aaa0018786c9e04153552 --- .gitreview | 5 ++ .zuul.yaml | 4 + doc/writing-OS-API-charm.rst | 4 +- ops_sunbeam/interfaces.py | 2 +- .../requirements.txt | 2 +- tox.ini | 80 +++++++------------ 6 files changed, 42 insertions(+), 55 deletions(-) create mode 100644 .gitreview create mode 100644 .zuul.yaml diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..75bd0b0 --- /dev/null +++ b/.gitreview @@ -0,0 +1,5 @@ +[gerrit] +host=review.opendev.org +port=29418 +project=openstack/charm-ops-sunbeam.git +defaultbranch=main diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..7ffc71c --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,4 @@ +- project: + templates: + - openstack-python3-charm-yoga-jobs + - openstack-cover-jobs diff --git a/doc/writing-OS-API-charm.rst b/doc/writing-OS-API-charm.rst index 9cf5b33..1178aca 100644 --- a/doc/writing-OS-API-charm.rst +++ b/doc/writing-OS-API-charm.rst @@ -24,8 +24,8 @@ Add ASO common files to new charm. The script will ask a few basic questions: .. code:: bash - git clone https://github.com/openstack-charmers/advanced-sunbeam-openstack - cd advanced-sunbeam-openstack + git clone https://opendev.org/openstack/charm-ops-sunbeam + cd charm-ops-sunbeam ./sunbeam-charm-init.sh ~/branches/charm-ironic-operator This tool is designed to be used after 'charmcraft init' was initially run diff --git a/ops_sunbeam/interfaces.py b/ops_sunbeam/interfaces.py index d9892a5..58cdac5 100644 --- a/ops_sunbeam/interfaces.py +++ b/ops_sunbeam/interfaces.py @@ -27,7 +27,7 @@ from ops.framework import StoredState class PeersRelationCreatedEvent(EventBase): - """The PeersRelationCreatedEvent indicates that the peer relation now exists. + """The PeersRelationCreatedEvent indicates that peer relation now exists. It does not indicate that any peers are available or have joined, simply that the relation exists. This is useful to to indicate that the diff --git a/shared_code/sunbeam_charm/{{cookiecutter.service_name}}/requirements.txt b/shared_code/sunbeam_charm/{{cookiecutter.service_name}}/requirements.txt index eacad18..99f3656 100644 --- a/shared_code/sunbeam_charm/{{cookiecutter.service_name}}/requirements.txt +++ b/shared_code/sunbeam_charm/{{cookiecutter.service_name}}/requirements.txt @@ -1,6 +1,6 @@ ops jinja2 -git+https://github.com/openstack-charmers/advanced-sunbeam-openstack#egg=ops_sunbeam +git+https://github.com/openstack/charm-ops-sunbeam#egg=ops_sunbeam lightkube # These are only needeed if the charm relates to ceph git+https://github.com/openstack/charm-ops-interface-ceph-client#egg=interface_ceph_client diff --git a/tox.ini b/tox.ini index cec75be..4d93ba6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,84 +1,63 @@ # Operator charm helper: tox.ini [tox] -envlist = pep8,py3 skipsdist = True -# NOTE: Avoid build/test env pollution by not enabling sitepackages. +envlist = pep8,py3 sitepackages = False -# NOTE: Avoid false positives by not skipping missing interpreters. skip_missing_interpreters = False -# NOTES: -# * We avoid the new dependency resolver by pinning pip < 20.3, see -# https://github.com/pypa/pip/issues/9187 -# * Pinning dependencies requires tox >= 3.2.0, see -# https://tox.readthedocs.io/en/latest/config.html#conf-requires -# * It is also necessary to pin virtualenv as a newer virtualenv would still -# lead to fetching the latest pip in the func* tox targets, see -# https://stackoverflow.com/a/38133283 -requires = pip < 20.3 - virtualenv < 20.0 -# NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci minversion = 3.18.0 +requires = virtualenv < 20.0 [testenv] -setenv = VIRTUAL_ENV={envdir} - PYTHONHASHSEED=0 - CHARM_DIR={envdir} +basepython = python3 install_command = pip install {opts} {packages} commands = stestr run --slowest {posargs} -whitelist_externals = - git - add-to-archive.py - fetch-libs.sh - bash - charmcraft -passenv = HOME TERM CS_* OS_* TEST_* -deps = -r{toxinidir}/test-requirements.txt +allowlist_externals = + git + charmcraft + fetch-libs.sh +deps = + -r{toxinidir}/test-requirements.txt [testenv:fetch] basepython = python3 deps = commands = - ./fetch-libs.sh + {toxinidir}/fetch-libs.sh [testenv:cookie] basepython = python3 deps = -r{toxinidir}/cookie-requirements.txt commands = /bin/true -[testenv:py3.8] -basepython = python3.8 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -[testenv:py3.9] -basepython = python3.9 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -[testenv:py3.10] -basepython = python3.10 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - [testenv:py3] basepython = python3 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +deps = + {[testenv]deps} + -r{toxinidir}/requirements.txt + +[testenv:py38] +basepython = python3.8 +deps = {[testenv:py3]deps} + +[testenv:py39] +basepython = python3.9 +deps = {[testenv:py3]deps} + +[testenv:py310] +basepython = python3.10 +deps = {[testenv:py3]deps} [testenv:pep8] basepython = python3 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt -commands = flake8 {posargs} src unit_tests tests ops_sunbeam --exclude unit_tests/lib +deps = {[testenv]deps} +commands = flake8 {posargs} unit_tests ops_sunbeam --exclude unit_tests/lib [testenv:cover] basepython = python3 -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt +deps = {[testenv:py3]deps} setenv = - {[testenv]setenv} PYTHON=coverage run commands = coverage erase @@ -103,5 +82,4 @@ basepython = python3 commands = {posargs} [flake8] -# Ignore E902 because the unit_tests directory is missing in the built charm. -ignore = E402,E226,E902,ANN101,ANN003,W504 +ignore = E226,E402,ANN101,ANN003,W504