Skip to content

python3 incompatibility in configuration.py when using virtualenv + python setup.py develop - #1126

Merged
embray merged 2 commits into
astropy:masterfrom
embray:issue-1126
Jul 22, 2013
Merged

embray merged 2 commits into
astropy:masterfrom
embray:issue-1126

Conversation

@embray

@embray embray commented Jul 19, 2013

Copy link
Copy Markdown
Member

This error occurs if I install astropy with python3 setup.py develop using virtual python. It does not occur if I use python3 setup.py install, or if I use the system-wide python3 with setup.py develop. I'm testing with astropy-0.2.2 (stable branch)

Here's the error:

regenerating default astroquery.cfg file
Generation of default configuration item failed! Stdout and stderr are shown below.
Stdout:

Stderr:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Volumes/disk5/Users/adam/repos/astropy/astropy/config/configuration.py", line 626, in generate_all_config_items
    if isinstance(pkgornm, basestring):
NameError: global name 'basestring' is not defined

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "./astroquery/__init__.py", line 16, in <module>
    from .version import version as __version__
  File "./astroquery/version.py", line 3, in <module>
    from astropy.version_helpers import update_git_devstr, get_git_devstr
  File "/Volumes/disk5/Users/adam/repos/astropy/astropy/__init__.py", line 126, in <module>
    from .logger import _init_log
  File "/Volumes/disk5/Users/adam/repos/astropy/astropy/logger.py", line 45, in <module>
    "Threshold for the logging messages. Logging "
  File "/Volumes/disk5/Users/adam/repos/astropy/astropy/config/configuration.py", line 140, in __init__
    isinstance(defaultvalue, basestring)):
NameError: global name 'basestring' is not defined

@embray

embray commented May 28, 2013

Copy link
Copy Markdown
Member

setup.py develop does not work in Python 3 in general, because it requires the source code to be directly importable and runnable. Since we currently rely on 2to3 for Python 3 support this is not possible in general.

Perhaps if nothing else the documentation should be updated to clarify that setup.py develop will not work on Python 3.
(I have some ideas for implementing a way to make this work through import hooks, and possibly submitting my fix as a patch to setuptools, but it hasn't been a priority).

@keflavich

Copy link
Copy Markdown
Contributor Author

Thanks @iguananaut; I guess you can mark this as "wishlist" or "won'tfix". I agree, it's not a priority.

@embray

embray commented May 29, 2013

Copy link
Copy Markdown
Member

I'm just going to make this a documentation issue.

@astrofrog

Copy link
Copy Markdown
Member

I think this was already discussed as part of #1212 - maybe it'd be worth checking to see if that can be merged and then this applied on top if it doesn't contain the appropriate note?

embray added a commit that referenced this pull request Jul 22, 2013
python3 incompatibility in configuration.py when using virtualenv + python setup.py develop
@embray
embray merged commit 445367b into astropy:master Jul 22, 2013
@embray
embray deleted the issue-1126 branch July 22, 2013 17:42
embray added a commit that referenced this pull request Jul 22, 2013
python3 incompatibility in configuration.py when using virtualenv + python setup.py develop
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 this pull request may close these issues.

3 participants