From cdd64aaa64249706aea164e3f5b36afb58126236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Fri, 11 Dec 2020 08:25:34 +0000 Subject: [PATCH 1/3] Fix pre-commit pylint versioning to work with pip 20.3 Fix from https://github.com/Tecnativa/doodba-copier-template/pull/197 was incomplete. This fixes it. TT27232 --- .pre-commit-config.yaml.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml.jinja b/.pre-commit-config.yaml.jinja index d8b88685..b54972b4 100644 --- a/.pre-commit-config.yaml.jinja +++ b/.pre-commit-config.yaml.jinja @@ -91,7 +91,7 @@ repos: files: /__init__\.py$ additional_dependencies: ["flake8-bugbear==20.1.4"] - repo: https://github.com/pycqa/pylint - rev: pylint-2.6.0 + rev: pylint-2.5.3 hooks: - id: pylint name: pylint with optional checks From 7722ea20c7417ed5c288751b38363d194f5bf1e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Fri, 11 Dec 2020 08:50:16 +0000 Subject: [PATCH 2/3] Add docs to workarround when updating [ci skip] --- docs/faq.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/faq.md b/docs/faq.md index b4f36d8e..460d7871 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -29,6 +29,7 @@ Maybe not so frequent, but interesting anyway. 🤷 - [Why can't Firefox load the page after I start a debugging session?](#why-cant-firefox-load-the-page-after-i-start-a-debugging-session) - [Why won't my program stop on the specified breakpoints when using Firefox?](#why-wont-my-program-stop-on-the-specified-breakpoints-when-using-firefox) - [When upgrading from an old template, prettier fails badly. How to update?](#when-upgrading-from-an-old-template-prettier-fails-badly-how-to-update) +- [When upgrading from an old template, pre-commit fails to install. What can I do?](#when-upgrading-from-an-old-template-pre-commit-fails-to-install-what-can-i-do) @@ -576,3 +577,32 @@ Once all your doodba subprojects are on template v2.5.0 or later, you won't need `~/.nodeenvrc` anymore (hopefully) and you can safely delete it, as node version is pinned there and we install prettier from [their new specific pre-commit repo](https://github.com/prettier/pre-commit). + +## When upgrading from an old template, pre-commit fails to install. What can I do? + +Due to the +[latest updates to the `pip` dependency resolver](https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-2-2020), +some packages fail to install. + +As with the recent +[prettiermageddon](#when-upgrading-from-an-old-template-prettier-fails-badly-how-to-update), +when you're updating from an older template to a newer, Copier will try to produce a +vanilla project with the old template before updating it, to be able to extract a smart +diff and apply the required changes to your subproject. + +Since old versions of the template might be broken if you are running the latest `pip` +version, you cannot update anymore. Where is what you can do to avoid it: + +1. Since `pre-commit` manages it's dependencies with `python-virtualenv`, you can + indicate which version of pip it should use. There are several ways of doing it, but + the easiest is with an environment variable. Just pass `VIRTUALENV_PIP=20.2` before + any command that fails due to this problem. For example, when running a copier + update: + + ```bash + env VIRTUALENV_PIP=20.2 copier update + ``` + +Once all your doodba subprojects are on template v2.6.1 or later, you shouldn't have +this problem, as the pre-commit hook's versions and dependencies where tailored to work +with these new constraints. From 0ddc6c344c6d3afb4d83fdd1cc13e05f26988a8f Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev // IEL Date: Thu, 31 Dec 2020 10:45:03 +0100 Subject: [PATCH 3/3] fix click-odoo-contrib link --- docs/daily-usage.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/daily-usage.md b/docs/daily-usage.md index 9a7f58fa..a2d1441f 100644 --- a/docs/daily-usage.md +++ b/docs/daily-usage.md @@ -58,7 +58,7 @@ should know your toolbox, specifically these tools: - [invoke](https://www.pyinvoke.org/) - [Odoo](https://www.odoo.com/) 😆 - [python](https://www.python.org/) -- [click-odoo-contrib](https://github.com/acsone/click-odoo-contrib) +- [click-odoo-contrib][] Go read their docs and learn them fine. @@ -508,7 +508,7 @@ Just run: docker-compose run --rm odoo click-odoo-update --watcher-max-seconds 30 ``` -This script is part of [`click-odoo-contrib`][]; check it for more details. +This script is part of [click-odoo-contrib][]; check it for more details. \* Note: `--watcher-max-seconds` is available because we ship a [patched](https://github.com/acsone/click-odoo-contrib/pull/38) version. Check that PR @@ -600,3 +600,4 @@ adding the whitelist proxy like this to your docker-compose.yml: [development]: #development [testing]: #testing [production]: #production +[click-odoo-contrib]: https://github.com/acsone/click-odoo-contrib