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

Importanize produces different results when run on Windows vs Linux #29

Closed
xsaero00 opened this issue May 20, 2015 · 3 comments · Fixed by #32
Closed

Importanize produces different results when run on Windows vs Linux #29

xsaero00 opened this issue May 20, 2015 · 3 comments · Fixed by #32
Labels

Comments

@xsaero00
Copy link

Running 'importanize test_file.py --config .importanizerc` on Windows produces

"""
test file
"""
from datetime import datetime, timedelta

import copy
import simplejson as json
import uuid
from dateutil import parser
from decimal import Decimal
from something.common.bla import constants

running same command on Linux produces

"""
test file
"""
import copy
import uuid
from datetime import datetime, timedelta
from decimal import Decimal

import simplejson as json
from dateutil import parser
from something.common.bla import constants

Windows env: Python 2.7.9 (default, Dec 10 2014, 12:24:55)

flake8==2.4.0
future==0.14.3
importanize==0.3
ipython==2.3.1
mccabe==0.3
pep8==1.5.7
pyflakes==0.8.1
pyreadline==2.0
six==1.9.0
virtualenv==1.9.1
virtualenvwrapper-win==1.1.5

.importanizerc contents

{
    "groups": [
        {
            "type": "stdlib"
        },
        {
            "type": "remainder"
        },
        {
            "type": "local"
        }
    ]
}
@miki725 miki725 added the bug label May 20, 2015
@miki725
Copy link
Owner

miki725 commented May 20, 2015

Im pretty sure bug is somewhere in https://github.com/miki725/importanize/blob/master/importanize/utils.py#L11-L25.

@xsaero00 can you paste your sys.path from windows?

@miki725
Copy link
Owner

miki725 commented May 20, 2015

I think on windows the standard location for libraries is dist-packages vs site-packages - https://github.com/miki725/importanize/blob/master/importanize/utils.py#L21

@xsaero00
Copy link
Author

Here you go!

>>> import sys
>>> sys.path
['', 'C:\\WINDOWS\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages']
>>>

miki725 added a commit that referenced this issue Jul 17, 2015
also removed future dependency since six>=1.9 added python_2_unicode_compatible decorator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants