Skip to content

Instantly share code, notes, and snippets.

@openfly
Created June 21, 2016 17:43
Show Gist options
  • Save openfly/34527fa4bd9452f97582f6e10d1c4f34 to your computer and use it in GitHub Desktop.
Save openfly/34527fa4bd9452f97582f6e10d1c4f34 to your computer and use it in GitHub Desktop.
setup.py weirdness ( in venv )
#!/usr/bin/env python
from setuptools import setup, find_packages
from pip.req import parse_requirements
# parse_requirements() returns generator of
# pip.req.InstallRequirement objects
install_reqs = parse_requirements('requirements.txt',
session=False)
# reqs is a list of requirement
# e.g. ['django==1.5.1', 'mezzanine==1.4.6']
reqs = [str(ir.req) for ir in install_reqs]
print reqs
setup(
name='package-name',
version='0.0.1',
description='sure',
author='maybe',
author_email='email@here.whatever',
url='https://some.url/',
# install dependencies from requirements.txt
# setup_requires=list(reqs),
install_requires=list(reqs),
packages=find_packages(),
# bin files / python standalone executable scripts
scripts=['bin/diag.py'],
include_package_data=True,
zip_safe=True,
pbr=True,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment