Skip to content
Myr

Merge pull request #2486 from sigmavirus24/bug/2462

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Extract version from requests/__init__.py instead of importing requests

authored by Cory Benfield · committed by Cory Benfield · parents 76f7ce8, 1acc499 · Browse files · 1 file+14 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−4 removed

  • other:+14 added−4 removed

1 file+14 added−4 removed

modified:setup.py+14 added-4 removed
1#!/usr/bin/env python23import os4import re5import sys66import requests77from codecs import open89try:10 from setuptools import setup
16 unmodified lines
27]2829requires = []3031version = ''32with open('requests/__init__.py', 'r') as fd:33 reg = re.compile(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]')34 for line in fd:35 m = reg.match(line)36 if m:37 version = m.group(1)38 break3940if not version:41 raise RuntimeError('Cannot find version information')4243with open('README.rst', 'r', 'utf-8') as f:44 readme = f.read()45with open('HISTORY.rst', 'r', 'utf-8') as f:46 history = f.read()4748setup(49 name='requests',39 version=requests.__version__,50 version=version,51 description='Python HTTP for Humans.',52 long_description=readme + '\n\n' + history,53 author='Kenneth Reitz',54 author_email='me@kennethreitz.com',
15 unmodified lines
70 'Programming Language :: Python :: 2.7',71 'Programming Language :: Python :: 3',72 'Programming Language :: Python :: 3.3',73 'Programming Language :: Python :: 3.4'6374 ),75 extras_require={76 'security': ['pyOpenSSL', 'ndg-httpsclient', 'pyasn1'],77 },
1 unmodified line