-
-
Notifications
You must be signed in to change notification settings - Fork 267
[REF] pylint.cfg: Enable missing-import-error, missing-manifest-dependency #354
[REF] pylint.cfg: Enable missing-import-error, missing-manifest-dependency #354
Conversation
👍 |
ping |
👍 |
@pedrobaeza |
This checks should be mandatory, not optional for PRs, as these are critical errors, so I think you should require them on 8.0/9.0 (and the upcoming 10.0). |
Fixed |
78b4989
to
c9de2db
Compare
Conflicts found |
5a69d3e
to
2a25a38
Compare
Sorry for delay... |
Coverage is dropping a lot. Can you check it? |
Coveralls is failing https://coveralls.io/builds/8278931/source?filename=travis%2Fself_tests again |
OK, I see, merging |
Currently this dependency was not listed under `external_dependencies`, and violates OCA/maintainer-quality-tools#354, which leads to `ImportError` under some environments. Since it adds no benefit over Python's core `json` implementation, I'm simply removing the dependency.
Yet another violation of OCA/maintainer-quality-tools#354.
Yet another violation of OCA/maintainer-quality-tools#354.
Yet another violation of OCA/maintainer-quality-tools#354.
I hate this kind of new check! Why do I have to protect my import in connector-cmis? https://travis-ci.org/OCA/connector-cmis/jobs/189107369 This project has only one addon (9.0 and 10) and didn't work without the external dependency!!!!!! I am tired of these changes that break the tests by asking once again to adopt new rules decided by a minority. |
@lmignon Do you have a proposal to add a exception or change the guideline https://github.com/OCA/maintainer-tools/blob/master/CONTRIBUTING.md#importerror? |
Or Do you have a proposal to change the workflow of approves for guidelines? |
@moylop260 In the case of the connector-cmis it's a non sens to put the project in your addon path if you don't use it and if you use it you must have installed the external dependency. Therefore why do I have to protect the import in my source code.... The rule is not applicable to small repository build around an external library. MOREOVER IMO all changes in MQT rules should be approved by a vote of the OCA delagates! |
… is put in an addons path without the external lib installed This error should never occur since if you put this project into your addon path you want to use it and without the lib it don't work. But Travis CI fails if these imports are not protected due to a stupid rule enforced in odoo-pylint (Oct, 11, 2016) OCA/maintainer-quality-tools#354
I don't agree: you must always protect your external imports. It's a way to avoid an installation break if you have these modules in your addons path. In an ideal world, this shouldn't be needed, but it's not an ideal one. And think in other people that don't use pip, and Odoo's bug about static folder... |
… is put in an addons path without the external lib installed This error should never occur since if you put this project into your addon path you want to use it and without the lib it don't work. But Travis CI fails if these imports are not protected due to a stupid rule enforced in odoo-pylint (Oct, 11, 2016) OCA/maintainer-quality-tools#354
@lmignon If you have a good reason to skip this check just for that case you could use a If you think that is a global exception you could create a new PR for guidelines to change it. (And I change the lint). EXTRA NOTE: Maybe the main problem is have a project with just a module. (I don't know).
Like this PR? |
@pedrobaeza don't put connector-cmis in your addon path if you don't use it... This rule IS STUPID in the case of small project build around an external lib! That's the case of connector-cmis. Maybe it's time I leave OCA... |
@lmignon
Do |
@lmignon if you think OCA doesn't benefit you, then just leave it, but I don't think it's the right idea. These conventions are built around a past knowledge of troubles that we try to avoid in the future. That's why a guard in the import, that are only 3 new lines, assures a correct functioning in all the environments. We have tried to correct this in the root (Odoo not loading python files when there is a static folder, but without no success). If we get it in the future, this convention/check just can go out, but for now it's not possible. |
@moylop260 Indeed it's not possible or very difficult to automatically detect |
That is a good point. I'll check it |
@moylop260 Thank you for your listening. |
Hi @lmignon. Please review OCA/server-tools#89, OCA/openupgradelib#21, OCA/server-tools#232, OCA/geospatial#3, OCA/account-financial-reporting#229, OCA/l10n-spain#255, OCA/reporting-engine#64, and OCA/reporting-engine#62, just to name a few. Specifically OCA/server-tools#666 recently broke all website builds. This means lots of headaches trying to find what in the world happened to those builds that were perfectly green yesterday, fixing it, opening PR, waiting for merge, rebasing every open website PR, and hoping all goes well and nobody else did a import without try-except that breaks a different addon and you have to start again. All of that should have never happened if the original developer acknowledged this simple linter error, such as any other you might fix. Since the OCA is composed of a combination of many small teams that makes a big community, developing in a way that does not break others' deployments increases others' respect for you. The opposite is also true. If we put the community effort in a balance, fixing this linter error is a matter of minutes at PR time, but a matter of hours when it is already merged. That's why there was this improvement to our tools, that should save hours at the cost of minutes. Community coding is this way, I hope you understand. So, summarizing, just add that simple try-except and stop complaining, friend 😉 |
or stop contributing |
Emotional reactions aside, I still believe that peppering all the OCA code with import guards is a ugly, unpythonic hack. That hurts the eyes (at least mine 😉), and makes diagnosing real import issues harder. And, fundamentally, it does not address the root cause of the import issues. There are several ways to address those:
|
I agree, mostly with odoo/odoo#8591 |
Also agreed on odoo/odoo#8591 I think it would also be nice for a repo-level pylint config allowing for disabling of lints for reasons other than this, but that feature is probably best started in a new issue I think. |
…dency (OCA#354) [REF] pylint.cfg: Enable missing-import-error, missing-manifest-dependency
…dency (OCA#354) [REF] pylint.cfg: Enable missing-import-error, missing-manifest-dependency
… is put in an addons path without the external lib installed This error should never occur since if you put this project into your addon path you want to use it and without the lib it don't work. But Travis CI fails if these imports are not protected due to a stupid rule enforced in odoo-pylint (Oct, 11, 2016) OCA/maintainer-quality-tools#354
… is put in an addons path without the external lib installed This error should never occur since if you put this project into your addon path you want to use it and without the lib it don't work. But Travis CI fails if these imports are not protected due to a stupid rule enforced in odoo-pylint (Oct, 11, 2016) OCA/maintainer-quality-tools#354
… is put in an addons path without the external lib installed This error should never occur since if you put this project into your addon path you want to use it and without the lib it don't work. But Travis CI fails if these imports are not protected due to a stupid rule enforced in odoo-pylint (Oct, 11, 2016) OCA/maintainer-quality-tools#354
… is put in an addons path without the external lib installed This error should never occur since if you put this project into your addon path you want to use it and without the lib it don't work. But Travis CI fails if these imports are not protected due to a stupid rule enforced in odoo-pylint (Oct, 11, 2016) OCA/maintainer-quality-tools#354
Enable new checks from: OCA/pylint-odoo#68
Version 1.3.3