__version__.py
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Kenneth Reitz · committed by Kenneth Reitz · parent 539302a · Browse files · 3 files·+20 added−15 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+20 added−15 removed
- other:+20 added−15 removed
Provenance
- Commit
3e32356- Tree
6768a6b- Author
Kenneth Reitz <me@kennethreitz.org>- Committer
Kenneth Reitz <me@kennethreitz.org>- Parent
539302a
3 files changed+20 added−15 removed
modified:requests/__init__.py+1 added-7 removed
38 unmodified lines39 :copyright: (c) 2017 by Kenneth Reitz.40 :license: Apache 2.0, see LICENSE for more details.41 """42 43-__title__ = 'requests'44-__version__ = '2.14.2'45-__build__ = 0x02140246-__author__ = 'Kenneth Reitz'47-__license__ = 'Apache 2.0'48-__copyright__ = 'Copyright 2017 Kenneth Reitz'49-__cake__ = u'✨ 🍰 ✨ Thanks for using my software. It means the world to me. --kennethreitz'43+from .__version__ import *44 45 # Attempt to enable urllib3's SNI support, if possible46 try:47 from .packages.urllib3.contrib import pyopenssl34 unmodified linesadded:requests/__version__.py+13 added
1+# -*- coding: utf-8 -*-2+3+# .-. .-. .-. . . .-. .-. .-. .-.4+# |( |- |.| | | |- `-. | `-.5+# ' ' `-' `-`.`-' `-' `-' ' `-'6+7+__title__ = 'requests'8+__version__ = '2.14.2'9+__build__ = 0x02140210+__author__ = 'Kenneth Reitz'11+__license__ = 'Apache 2.0'12+__copyright__ = 'Copyright 2017 Kenneth Reitz'13+__cake__ = u'✨ 🍰 ✨ Thanks for using my software. It means the world to me. --kennethreitz'modified:setup.py+6 added-8 removed
7 unmodified lines8 9 from setuptools import setup10 from setuptools.command.test import test as TestCommand11 12+here = os.path.abspath(os.path.dirname(__file__))13 14 class PyTest(TestCommand):15 user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]16 11 unmodified lines28 29 errno = pytest.main(self.pytest_args)30 sys.exit(errno)31 31-32+# 'setup.py publish' shortcut.33 if sys.argv[-1] == 'publish':34 os.system('python setup.py sdist upload')35 sys.exit()36 14 unmodified lines51 52 requires = []53 test_requirements = ['pytest>=2.8.0', 'pytest-httpbin==0.0.7', 'pytest-cov', 'pytest-mock']54 54-with open('requests/__init__.py', 'r', 'utf-8') as fd:55- version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',56- fd.read(), re.MULTILINE).group(1)55+about = {}56+with open(os.path.join(here, "requests", "__version__.py")) as f:57+ exec(f.read(), about)58 58-if not version:59- raise RuntimeError('Cannot find version information')60-59 with open('README.rst', 'r', 'utf-8') as f:60 readme = f.read()61 with open('HISTORY.rst', 'r', 'utf-8') as f:62 history = f.read()63 64 setup(65 name='requests',68- version=version,66+ version=about['__version__'],67 description='Python HTTP for Humans.',68 long_description=readme + '\n\n' + history,69 author='Kenneth Reitz',70 author_email='me@kennethreitz.com',33 unmodified lines