From eb5c43899c02174f97567d6dc2bc163d4ee54f58 Mon Sep 17 00:00:00 2001 From: Ivan Anfimov Date: Sat, 15 Feb 2025 13:11:12 +0000 Subject: [PATCH] Update README.rst and bump hacking First update, we need do more changes in future for documentation. Change-Id: I0dbaab4e2c8462bf4b108c452929e3d16c310375 --- README.rst | 72 ++++++++++++++++++------------------ setup.cfg | 6 ++- test-requirements.txt | 9 +---- tools/install_venv_common.py | 6 +-- tox.ini | 23 +++++++----- 5 files changed, 59 insertions(+), 57 deletions(-) diff --git a/README.rst b/README.rst index ce7f337..5ab3676 100644 --- a/README.rst +++ b/README.rst @@ -12,81 +12,79 @@ Freezer - Horizon Dashboard =========================== freezer-web-ui is a horizon plugin based in django aimed at providing an interaction -with freezer +with freezer. -* Issue tracking and feature specifications: https://storyboard.openstack.org/#!/project/openstack/freezer-web-ui +* Issue tracking and feature specifications: https://launchpad.net/freezer Requirements ============ -Freezer Dashboard requires a freezer API client to be installed in the same environment as horizon:: +Before start, please install git and pip in your Operation System. +If your use Ubuntu: - git clone https://github.com/openstack/python-freezerclient + apt install git python3-pip + +If your use RHEL/CentOS: + + dnf install git python3-pip + +Freezer Dashboard requires a freezer API client to be installed in the same +environment as Horizon: + + git clone https://opendev.org/openstack/python-freezerclient cd python-freezerclient - python setup.py install (is important that freezer API client is installed from source and not with pip and - is installed on horizon virtual environment) + python3 -m pip install . -Freezer Dashboard requires a freezer API endpoint which you can install following this steps: +Freezer Dashboard requires a freezer API endpoint which you can install +following this steps: - `https://github.com/openstack/freezer-api/blob/master/README.rst - `_ + `https://opendev.org/openstack/freezer-api + `_ API registration ================ -Register freezer api endpoint: +If keystone service-create and endpoint-create are not available you can +set as a fallback the following on: - `https://github.com/openstack/freezer-api/blob/master/README.rst#api-registration - `_ - -If keystone service-create and endpoint-create are not available you can set as a fallback the following on:: - - # vim /opt/stack/horizon/openstack_dashboard/local/local_settings.py - - # add FREEZER_API_URL = http://: + vim /etc/horizon/openstack_dashboard/local/local_settings.py + add FREEZER_API_URL = http://: Installation ============ In the installation procedure we'll assume your main Horizon dashboard -directory is /opt/stack/horizon/openstack_dashboard/dashboards/. +directory is /etc/horizon/openstack_dashboard/dashboards/. +To install freezer dashboard for development you need to do the following: -To install freezer dashboard for development you need to do the following:: + git clone https://opendev.org/openstack/freezer-web-ui + cd freezer-web-ui + cp freezer-web-ui/freezer_ui/enabled/_5050_freezer.py /etc/horizon/openstack_dashboard/enabled/_5050_freezer.py - # git clone https://github.com/openstack/freezer-web-ui +To disable the panel set `DISABLED = True` in /etc/horizon/openstack_dashboard/enabled/_5050_freezer.py - # cd freezer-web-ui + cd /etc/horizon/ + python3 -m pip install -r requirements.txt - # cp freezer-web-ui/freezer_ui/enabled/_5050_freezer.py /opt/stack/horizon/openstack_dashboard/enabled/_5050_freezer.py - - # to disable the panel set `DISABLED = True` in /opt/stack/horizon/openstack_dashboard/enabled/_5050_freezer.py - - # cd /opt/stack/horizon/ - - # pip install -r requirements.txt - - # make sure freezer is installed from source as detailed in the first step - - # ./run_tests.sh --runserver 0.0.0.0:8000 +Make sure freezer is installed from source as detailed in the first step + ./run_tests.sh --runserver 0.0.0.0:8000 A new tab called "Disaster Recovery" will appear on your panels. - Tox === -1. Run tox:: +Run tox: tox -v - Development under proxy _______________________ -If you are developing or deploying under proxies remember to set no_proxies for:: +If you are developing or deploying under proxies remember to set no_proxies for: freezer-api endpoint keystone endpoint diff --git a/setup.cfg b/setup.cfg index c5f7749..3846a3b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,8 +4,9 @@ author = OpenStack author_email = openstack-discuss@lists.openstack.org summary = Freezer - Backup as a Service User Interface description_file = README.rst -home_page = https://github.com/openstack/freezer-web-ui +description-content-type = text/x-rst license = Apache-2 +url = https://docs.openstack.org/freezer/latest/ python_requires = >=3.8 classifier = Development Status :: 5 - Production/Stable @@ -23,6 +24,9 @@ classifier = Programming Language :: Python :: 3 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Topic :: Internet :: WWW/HTTP keywords = horizon diff --git a/test-requirements.txt b/test-requirements.txt index bd38b42..19d99d7 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,13 +1,8 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. - -hacking>=3.0.1,<3.1.0 # Apache-2.0 +hacking>=7.0.0,<7.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 oslo.config>=5.2.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testtools>=2.2.0 # MIT sphinx>=2.0.0,!=2.1.0 # BSD pylint>=2.6.0 # GPLv2 - diff --git a/tools/install_venv_common.py b/tools/install_venv_common.py index feac3ce..3a508a5 100644 --- a/tools/install_venv_common.py +++ b/tools/install_venv_common.py @@ -41,8 +41,8 @@ class InstallVenv(object): sys.exit(1) def check_python_version(self): - if sys.version_info < (2, 6): - self.die("Need Python Version >= 2.6") + if sys.version_info[0] < 3: + raise Exception("Need Python Version 3") def run_command_with_code(self, cmd, redirect_output=True, check_exit_code=True): @@ -158,6 +158,6 @@ class Fedora(Distro): return if not self.check_pkg('python-virtualenv'): - self.die("Please install 'python-virtualenv'.") + self.die("Please install 'python3-virtualenv'.") super(Fedora, self).install_virtualenv() diff --git a/tox.ini b/tox.ini index cc552f1..6a799ae 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,10 @@ [tox] -envlist = py39,py311,py312,pep8,pylint,docs -minversion = 2.0 -skipsdist = True +minversion = 4.0 +envlist = py3,py311,py312,pep8,docs,pylint,cover +ignore_basepython_conflict = True [testenv] -basepython = python3 +basepython = {env:TOX_PYTHON:python3} usedevelop = True setenv = VIRTUAL_ENV={envdir} NOSE_WITH_OPENSTACK=1 @@ -16,10 +16,7 @@ deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/up -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - python manage.py test {posargs} - -[testenv:py39] -basepython = python3.9 + python3 manage.py test {posargs} [testenv:py311] basepython = python3.11 @@ -34,13 +31,21 @@ commands = flake8 {posargs} commands = {posargs} [testenv:cover] -commands = python setup.py test --coverage --testr-args={posargs} +commands = python3 setup.py test --coverage --testr-args={posargs} [testenv:docs] deps = -r{toxinidir}/doc/requirements.txt setenv = DJANGO_SETTINGS_MODULE=freezer_ui.test.settings commands = sphinx-build -W --keep-going -b html doc/source doc/build/html +[testenv:pdf-docs] +deps = {[testenv:docs]deps} +allowlist_externals = + make +commands = + sphinx-build -j auto -W -b latex doc/source doc/build/pdf + make -C doc/build/pdf + [testenv:pylint] commands = pylint --rcfile .pylintrc freezer_ui