Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requirements.txt lacks of minimum compatible version of lxml dependency #73

Open
are-agilebg opened this issue Jul 21, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@are-agilebg
Copy link

The requirements.txt does not dictate what version of the listed packages should be installed.

However, looking at lxml specifically, this project relies on lxml.etree providing an indent method, see for example:

This method however has been added to lxml only from version 4.5.0 (see Changelog)

To Reproduce

Latest odoo-module-migrator binary (0.4.0). Install a lxml version prior to 4.5.0 (I was using 4.2.3 but the exact version is not relevant).

While executing a migration:

Traceback (most recent call last):
  File "/home/are/.pyenv/versions/3.7.13/bin/odoo-module-migrate", line 8, in <module>
    sys.exit(main())
  File "/home/are/.pyenv/versions/3.7.13/lib/python3.7/site-packages/odoo_module_migrate/__main__.py", line 144, in main
    migration.run()
  File "/home/are/.pyenv/versions/3.7.13/lib/python3.7/site-packages/odoo_module_migrate/migration.py", line 221, in run
    module_migration.run()
  File "/home/are/.pyenv/versions/3.7.13/lib/python3.7/site-packages/odoo_module_migrate/module_migration.py", line 36, in run
    self._migration._commit_enabled
  File "/home/are/.pyenv/versions/3.7.13/lib/python3.7/site-packages/odoo_module_migrate/base_migration_script.py", line 152, in run
    tools=tools,
  File "/home/are/.pyenv/versions/3.7.13/lib/python3.7/site-packages/odoo_module_migrate/migration_scripts/migrate_130_140.py", line 144, in reformat_deprecated_tags
    reformatted_file = _reformat_file(file_path)
  File "/home/are/.pyenv/versions/3.7.13/lib/python3.7/site-packages/odoo_module_migrate/migration_scripts/migrate_130_140.py", line 106, in _reformat_file
    et.indent(tag, space=indent, level=1)
AttributeError: module 'lxml.etree' has no attribute 'indent'

I cannot provide the view that triggers this error because the module I was migrating is private, however the issue I'm pretty sure it does not depends from a particular view definition.

I suggest to add minimum required versions to the requirements.txt. That should be trivial to implement, and it would make the project more robust.

Affected versions:

0.4.0

Additional context

Tested on Linux (Ubuntu 18.04), Python 3.6.15 and 3.7.13.

@are-agilebg are-agilebg added the bug Something isn't working label Jul 21, 2023
@legalsylvain
Copy link
Collaborator

Thanks ! Could you make a PR ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants