berkeley-cocosci / Wallace

See https://github.com/Dallinger/Dallinger/ for the latest.
MIT License
36 stars 5 forks source link

Clean up requirements.txt #67

Closed jhamrick closed 9 years ago

jhamrick commented 9 years ago

It should only include direct dependencies, not psiturk dependencies -- it should just have a psiturk version, and then the psiturk dependencies will be installed automatically.

suchow commented 9 years ago

Closed by 36ab645a9083999125759caf1cf2bb7e5c20f133.

suchow commented 9 years ago

Hm, actually, this didn't work because the dependencies of the dependencies are not getting automatically installed with pip.

suchow commented 9 years ago

Reverted in e174481ddd13ea8868b66972f8d760b34fa82df9 until this is figured out.

jhamrick commented 9 years ago

I just figured out how to do this, I think, from some other stuff I was working on...

Basically, in setup.py, we can read in the requirements.txt file and add stuff to the install_requires. Something like this:

from distutils.core import setup

setup_args = dict(... existing setup stuff ...)

if 'setuptools' in sys.modules:
    setup_args['install_requires'] = install_requires = []
    with open('requirements.txt') as f:
        for line in f.readlines():
            req = line.strip()
            if not req or req.startswith(('-e', '#')):
                continue
            install_requires.append(req)

setup(**setup_args)
jhamrick commented 9 years ago

I am not 100% sure if this will work because it's not exactly the same issue, but is probably worth trying.