From 6bdff4a37daa9f1a5ab4cd1697649bc1bdcc223a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Fri, 28 Feb 2025 12:40:21 +0100 Subject: [PATCH 1/2] [FIX] github workflows actions --- .github/workflows/documentation.yml | 4 ++-- .github/workflows/flake.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 78238bd66d60..f69cbb7ef77c 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -23,10 +23,10 @@ jobs: PGUSER: "odoo" steps: - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.7 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Configuration run: | sudo apt update diff --git a/.github/workflows/flake.yml b/.github/workflows/flake.yml index 8655919a6272..2c017bac99c2 100644 --- a/.github/workflows/flake.yml +++ b/.github/workflows/flake.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.7 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Configuration run: pip install flake8==3.4.1 - name: Flake8 Script diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 32b607aa54b1..8c8afabb3c1a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: PGUSER: "odoo" steps: - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.7 - name: Configure Postgres @@ -50,7 +50,7 @@ jobs: # Line below may fail quite often due to Travis bug: # - git reset -q --hard $TRAVIS_COMMIT # Install Python requirements of target release - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Configuration run: | sudo apt update From 26ab36f14a9b764d579f82d3eb7ad0356fd31f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Fri, 28 Feb 2025 12:48:55 +0100 Subject: [PATCH 2/2] [FIX] python 3.7 is deprecated for flake, update flake version --- .github/workflows/flake.yml | 9 ++++++--- addons/stock/migrations/13.0.1.1/post-migration.py | 4 ++-- addons/website/migrations/13.0.1.0/post-migration.py | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/flake.yml b/.github/workflows/flake.yml index 2c017bac99c2..44c67fc5b9b0 100644 --- a/.github/workflows/flake.yml +++ b/.github/workflows/flake.yml @@ -15,10 +15,10 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: 3.8 - uses: actions/checkout@v4 - name: Configuration - run: pip install flake8==3.4.1 + run: pip install flake8==4.0.1 - name: Flake8 Script run: | flake8 odoo/openupgrade --max-line-length=120 @@ -27,4 +27,7 @@ jobs: # only flake8 migration scripts from the openupgrade project, presumably # identifiable by using the openupgrade helpers flake8 --max-line-length=120 scripts $(find . \( -name 'pre-*.py' -or -name 'post-*.py' -or -name 'end-*.py' \) -exec grep -q openupgrade {} \; -print) - flake8 addons/*/migrations/*/tests/ --max-line-length=120 + if ls addons/*/migrations/*/tests/ > /dev/null 2>&1; then + flake8 addons/*/migrations/*/tests/ --max-line-length=120 --filename=__init__.py --ignore=F401 + flake8 addons/*/migrations/*/tests/ --max-line-length=120 --exclude=__init__.py + fi diff --git a/addons/stock/migrations/13.0.1.1/post-migration.py b/addons/stock/migrations/13.0.1.1/post-migration.py index bc39a6bd5ef6..5a9a769f1c44 100644 --- a/addons/stock/migrations/13.0.1.1/post-migration.py +++ b/addons/stock/migrations/13.0.1.1/post-migration.py @@ -195,7 +195,7 @@ def map_stock_picking_responsible_responsible_id_to_user_id(env): return env.cr.execute( - f""" + """ SELECT distinct rp.id, rp.name, rp.company_id, @@ -225,7 +225,7 @@ def map_stock_picking_responsible_responsible_id_to_user_id(env): # map responsible_id to user_id openupgrade.logged_query( env.cr, - f""" + """ WITH partner_user AS ( SELECT sp.id AS picking_id, rp.id AS partner_id, diff --git a/addons/website/migrations/13.0.1.0/post-migration.py b/addons/website/migrations/13.0.1.0/post-migration.py index 2cf796974043..8d0928b604a0 100644 --- a/addons/website/migrations/13.0.1.0/post-migration.py +++ b/addons/website/migrations/13.0.1.0/post-migration.py @@ -48,7 +48,7 @@ def _set_data_anchor_xml_attribute(env): ) for view in website_views: doc = fromstring(view.arch_db) - links = doc.cssselect("a[href^=\#]:not([href=\#])") + links = doc.cssselect(r"a[href^=\#]:not([href=\#])") if links: replacement = { "selector": ", ".join([link.attrib["href"] for link in links]),