From 37f5403e139c5cf6b26c61710f29423e747c2429 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Fri, 2 Jun 2023 13:22:08 +0100 Subject: [PATCH 1/4] lisa.__init__: Add exception to ask users to transition from "master" to "main" branch --- lisa/__init__.py | 9 +++++++++ pytest.ini | 2 ++ 2 files changed, 11 insertions(+) diff --git a/lisa/__init__.py b/lisa/__init__.py index ccb42e037..1f718f162 100644 --- a/lisa/__init__.py +++ b/lisa/__init__.py @@ -13,6 +13,15 @@ import os from lisa.version import __version__ +def _warn(): + running_sphinx = bool(int(os.environ.get('_LISA_DOC_SPHINX_RUNNING', '0'))) + running_pytest = 'PYTEST_VERSION' in os.environ + if running_sphinx or running_pytest: + warnings.warn('This code was obtained by cloning the "master" git branch of LISA project. The project has moved to the "main" branch. The "master" branch will be tracking the "main" branch for a while. Please update your workflow to use the "main" branch', category=FutureWarning) + else: + raise ImportError('This code was obtained by cloning the "master" git branch of LISA project. The project has moved to the "main" branch. Please update your workflow to use the "main" branch') +_warn() + # Raise an exception when a deprecated API is used from within a lisa.* # submodule. This ensures that we don't use any deprecated APIs internally, so # they are only kept for external backward compatibility purposes. diff --git a/pytest.ini b/pytest.ini index a2731d6bf..219648bb5 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,6 +4,8 @@ testpaths=tests # (from python-future) filterwarnings = error + # Ignore the FutureWarning about the master branch + ignore::FutureWarning:lisa ignore::DeprecationWarning:past.builtins.misc # Avoid: # .lisa-venv-3.9/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py:111: in __init__ -- GitLab From 61bb052362e63e11c4667cb1912d2a66f61fefc1 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Fri, 2 Jun 2023 14:05:03 +0100 Subject: [PATCH 2/4] shell/lisa_shell: Add attention banner on source init_env --- shell/lisa_shell | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/shell/lisa_shell b/shell/lisa_shell index 445507675..966b082c9 100755 --- a/shell/lisa_shell +++ b/shell/lisa_shell @@ -529,4 +529,14 @@ fi echo "Environment variables:" env-list.py + + +printf "$LISASHELL_RED" +echo ' +================================== ATTENTION ================================== +This version of LISA was obtained by cloning the "master" git branch. +LISA project has moved to the "main" branch, please use the "main" branch. +=============================================================================== +' + # vim: set tabstop=4 shiftwidth=4 textwidth=80 expandtab: -- GitLab From 285a2c92810ccd6820be9daefa85a930d0a08a53 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Tue, 3 Sep 2024 23:21:00 +0100 Subject: [PATCH 3/4] doc/changes.rst: Remove changelog Since the master branch will now contain a synthetic history, it will not be suitable to generate a changelog so point at the URL that will contain a valid changelog. --- doc/sections/changes/changelog.rst | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/doc/sections/changes/changelog.rst b/doc/sections/changes/changelog.rst index 27fedc11c..294fc2312 100644 --- a/doc/sections/changes/changelog.rst +++ b/doc/sections/changes/changelog.rst @@ -2,13 +2,5 @@ Changelog ********* -.. exec:: - - from lisa.utils import LISA_HOME - from lisa._doc.helpers import make_changelog - - repo = LISA_HOME - changelog = make_changelog( - repo=LISA_HOME, - ) - print(changelog) +The changelog cannot be generated on the master branch anymore. +Please see the `latest documentation `__ -- GitLab From 23df39dd8ff5848f726cb357361c510ffe8ab34d Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Fri, 2 Jun 2023 13:43:43 +0100 Subject: [PATCH 4/4] doc/conf.py: Add banner to redirect to latest doc --- doc/conf.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 146f5f861..65698cd00 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -526,6 +526,18 @@ html_theme_options = { # Output file base name for HTML help builder. htmlhelp_basename = 'LISAdoc' +html_theme_options['announcement'] = f''' +

+ + This documentation was obtained by building the "master" git branch. LISA + project has moved to the "main" branch. Please see the + latest + documentation. + +

+ +{html_theme_options.get('announcement', '')} +''' # -- Options for LaTeX output --------------------------------------------- -- GitLab