[setup.py] avoid relative import of _info.py #25

Closed
gph82 wants to merge 1 commits from gph82:master into master
gph82 commented 10 months ago
Collaborator

Hi! I think you now prefer issues/PRs in codeberg, right?

mkdir mpl_chord_diagram
cd mpl_chord_diagram
python3 -m venv env
source env/bin/activate
pip install mpl-chord-diagram 

Collecting mpl-chord-diagram
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/75/fd/1237e7d45c50f43c641e0a4607cdaa911e9ad16c342f5bd9ace63c25c431/mpl_chord_diagram-0.3.0.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-4o9ikbxi/mpl-chord-diagram/setup.py", line 17, in <module>
        from _info import __version__
    ModuleNotFoundError: No module named '_info'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4o9ikbxi/mpl-chord-diagram/

Also in a conda environment and with conda's pip, I get the same

ModuleNotFoundError: No module named '_info'

error, whichi is probably having to do with the absolute vs relative import.

I tested this fix locally and it worked. I am not an expert in these packaging issues and the interplay packaga managers with the different setuptools version they use, but I think this is the way to go.

Hi! I think you now prefer issues/PRs in codeberg, right? ``` mkdir mpl_chord_diagram cd mpl_chord_diagram python3 -m venv env source env/bin/activate pip install mpl-chord-diagram Collecting mpl-chord-diagram Cache entry deserialization failed, entry ignored Cache entry deserialization failed, entry ignored Downloading https://files.pythonhosted.org/packages/75/fd/1237e7d45c50f43c641e0a4607cdaa911e9ad16c342f5bd9ace63c25c431/mpl_chord_diagram-0.3.0.zip Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-4o9ikbxi/mpl-chord-diagram/setup.py", line 17, in <module> from _info import __version__ ModuleNotFoundError: No module named '_info' ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4o9ikbxi/mpl-chord-diagram/ ``` Also in a conda environment and with conda's pip, I get the same `ModuleNotFoundError: No module named '_info'` error, whichi is probably having to do with the absolute vs relative import. I tested this fix locally and it worked. I am not an expert in these packaging issues and the interplay packaga managers with the different setuptools version they use, but I think this is the way to go.
gph82 added 1 commit 10 months ago
Owner

Hi @gph82 yes, Codeberg is preferred, thanks for the report and the PR!

I'm a bit unsure where the issue comes from and why the change fixes it: it seems to remain an absolute import (there's no relative import like ._info).

I'll test it on my side an come back to you as soon as I figure it out for myself.

Hi @gph82 yes, Codeberg is preferred, thanks for the report and the PR! I'm a bit unsure where the issue comes from and why the change fixes it: it seems to remain an absolute import (there's no relative import like ``._info``). I'll test it on my side an come back to you as soon as I figure it out for myself.
tfardet added the
bugfix
installation
labels 10 months ago
Owner

I just checked by uploading your fix on the test Pypi server and I'm afraid that, as I expected, it does not solve the issue: it leads to

    import _info
ModuleNotFoundError: No module named '_info'

I don't know why it works locally but I guess conda does something spacific during the pip install...

I just checked by uploading your fix on the test Pypi server and I'm afraid that, as I expected, it does not solve the issue: it leads to ``` import _info ModuleNotFoundError: No module named '_info' ``` I don't know why it works locally but I guess conda does something spacific during the pip install...
Owner

I think I found a fix, will make a new PR and ask you to check it.
Before I do it, can you check that pip install --index-url https://test.pypi.org/simple/ mpl_chord_diagram==0.3.2 works in your conda env?

I think I found a fix, will make a new PR and ask you to check it. Before I do it, can you check that ``pip install --index-url https://test.pypi.org/simple/ mpl_chord_diagram==0.3.2`` works in your conda env?
Poster
Collaborator

hm...yeah, I'm also not sure.

Just to be sure:

  • did you reproduce the bug on a fresh python environment? In other words...is this really a bug?
  • In case the last answer was "yes"...did the fix work?

Thanks!

hm...yeah, I'm also not sure. Just to be sure: - did you reproduce the bug on a fresh python environment? In other words...is this really a bug? - In case the last answer was "yes"...did the fix work? Thanks!
Owner

I used a new conda environment with Python 3.6 for which I'm pretty sure I have nothing installed anywhere... I'm not very familiar with conda but I think that should be close enough to a fresh install.

My fix seems to work, it is packaged as 0.3.2 on Pypi test, does it also work for you? (pip install --index-url https://test.pypi.org/simple/ mpl_chord_diagram==0.3.2)

I used a new conda environment with Python 3.6 for which I'm pretty sure I have nothing installed anywhere... I'm not very familiar with conda but I think that should be close enough to a fresh install. My fix seems to work, it is packaged as 0.3.2 on Pypi test, does it also work for you? (``pip install --index-url https://test.pypi.org/simple/ mpl_chord_diagram==0.3.2``)
Poster
Collaborator

Hi, I'm testing this on different envs (with and without conda) and preparing a better report that makes sense SMH, because it's too much info. But hang in there, I'm interested in getting this sorted out ;)

Hi, I'm testing this on different envs (with and without conda) and preparing a better report that makes sense SMH, because it's too much info. But hang in there, I'm interested in getting this sorted out ;)
Owner

OK, I'm closing this PR for now, can you summarize what you'll find in a new issue?

OK, I'm closing this PR for now, can you summarize what you'll find in a new issue?
tfardet closed this pull request 10 months ago
Poster
Collaborator

Sure!

Sure!
This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
Loading…
There is no content yet.