Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Importlib, imp, find_module, find_spec issue #972

Closed
@diraol

Description

@diraol

Hi All!

I'm creating this issue in order to concentrate all issues that we are facing in python-mode that are caused by the import machinery.

This includes imp module deprecation (replaced by importlib), "wrong" usage of find_spec and find_module, different compatibilities among python versions and so on.

Currently, I'm with very restricted free time to dedicate to the project, so any help is very welcome!

We have plenty of python modules that are used in python-mode that are not from standard python. Because of that, in the past, these modules source code were copied into python-mode repo.
As time passed, they became old, and we started to update them as "git submodules".
This resulted in lot's of improvements, but also resulted in new problems, that we still need to fix.

Our current official branch is the develop from this repository, the master branch is unmaintained.

Before going on with the attempt of solving our current problems, I would like to kindly ask everyone that want to help me, by testing new versions of the code, to do some simple steps in order to make sure your environment is "renewed":

  • Clear all python cache (__pycache__) directories and compiled files (*.pyc and *.pyo). Do it by running, in Linux-like systems and from python-mode root dir:
    • find . -type f -name '*.pyc' -delete
    • find . -type d -name '__pycache__' -delete
  • Update all submodules with the latest version from the branch you want to test:
    • git submodule sync --recursive
    • git submodule update --init --recursive

Back to our current issue, it looks like we have several combinations that work and another bunch that does not work correctly, depending on python version and also vim version, so I'll ask you all some patience! Some times I cannot reproduce the errors that you are presenting, so your help will be fundamental for us to find the best fix.

One of the modules that were not updated is the pkg_resources, it is still a copy from some point in the past, and it may be one of the most impacted for this specific issue.

So, I'll try to update it to see if a newer version of pkg_resources fix most of the problems. Then we can go ahead and try to work on other "modules/packages/files".

I'll try to keep the test code for this issue under the branch issue_971_import_machinery from this repo ok?

Thank you all for your patience!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions