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

Does not run under py 2.7 #42

Closed
jhoblitt opened this issue Mar 22, 2017 · 4 comments · Fixed by #44
Closed

Does not run under py 2.7 #42

jhoblitt opened this issue Mar 22, 2017 · 4 comments · Fixed by #44

Comments

@jhoblitt
Copy link

I just discovered this package but I'm unable to to get it run on stock el7 python with either 0.6.5 published on pypi or from master. This appears to be because of the usage of tempfile.TemporaryDirectory, which is a py >= 3.2 construct. It seems like a py 2.7 compatible tempdir wrapper needs to be used or the import from future can be removed.

$ python --version
Python 2.7.5
$ conda-mirror --version
Log level set to ERROR
0.6.5+10.g37f310c
$ conda-mirror --upstream-channel https://repo.continuum.io/pkgs/free/ --target-directory local_mirror --platform linux-64 -vvv
DEBUG: sys.argv: ['/home/vagrant/venv/bin/conda-mirror', '--upstream-channel', 'https://repo.continuum.io/pkgs/free/', '--target-directory', 'local_mirror', '--platform', 'linux-64', '-vvv']
DEBUG: download_template=https://repo.continuum.io/pkgs/{channel}/{platform}/{file_name}. channel=free
DEBUG: true blacklist
DEBUG: []
DEBUG: possible_packages_to_mirror
DEBUG: [u'_license-1.1-py27_0.tar.bz2',
 u'_license-1.1-py27_1.tar.bz2',
...
 u'zope.sqlalchemy-0.7.7-py36_0.tar.bz2']
DEBUG: download_template=https://repo.continuum.io/pkgs/{channel}/{platform}/{file_name}. channel=free
Log level set to DEBUG
Traceback (most recent call last):
  File "/home/vagrant/venv/bin/conda-mirror", line 9, in <module>
    load_entry_point('conda-mirror==0.6.5-10.g37f310c', 'console_scripts', 'conda-mirror')()
  File "/home/vagrant/venv/lib/python2.7/site-packages/conda_mirror/conda_mirror.py", line 227, in cli
    args.platform, blacklist, whitelist)
  File "/home/vagrant/venv/lib/python2.7/site-packages/conda_mirror/conda_mirror.py", line 513, in main
    with tempfile.TemporaryDirectory(dir=temp_directory) as download_dir:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
@ericdill
Copy link
Contributor

Ah sorry for missing this previously. Is python 2.7 support important for you?

@jhoblitt
Copy link
Author

No but it caught me by surprise as future is being used. I ended up baking the module into a docker container with miniconda3.

@jhoblitt
Copy link
Author

This is the Dockerfile https://github.com/lsst-sqre/sandbox-cmirror/blob/master/cmirror/Dockerfile (if anyone else wants to package it up this way).

@ericdill
Copy link
Contributor

No but it caught me by surprise as future is being used

Oh. Yeah. That's a very good point. I'll make it clear that this project is py3 only. I really don't like supporting mixed py2/py3 projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants