Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git i/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/setup.py w/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/setup.py
- index f206e2c..10ab074 100755
- --- i/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/setup.py
- +++ w/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/setup.py
- @@ -1,6 +1,7 @@
- #!/usr/bin/env python3
- from setuptools import setup, find_packages
- +from src.bandersnatch import __version__
- # Naming these to use with tests_require - Bitbucket Pipelines will use requirements.txt for test deps
- test_deps = [
- @@ -24,7 +25,7 @@ install_deps = [
- setup(
- name='bandersnatch',
- - version='2.1.2.dev0',
- + version=__version__,
- description='Mirroring tool that implements the client (mirror) side of PEP 381',
- long_description='\n\n'.join(
- [open('README').read(), open('CHANGES.txt').read()]
- diff --git i/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/src/bandersnatch/__init__.py w/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/src/bandersnatch/__init__.py
- index 5bb534f..5c4eedb 100644
- --- i/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/src/bandersnatch/__init__.py
- +++ w/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/src/bandersnatch/__init__.py
- @@ -1 +1,21 @@
- # package
- +
- +from collections import namedtuple
- +
- +# a namedtuple like that given by sys.version_info
- +__version_info__ = namedtuple(
- + 'version_info',
- + 'major minor micro releaselevel serial')(
- + major=2,
- + minor=1,
- + micro=2,
- + releaselevel='dev0',
- + serial=0
- + )
- +
- +if __version_info__.releaselevel:
- + __version__ = '{v.major}.{v.minor}.{v.micro}'.format(v=__version_info__)
- +else:
- + __version__ = '{v.major}.{v.minor}.{v.micro}{v.releaselevel}'.format(
- + v=__version_info__
- + )
- diff --git i/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/src/bandersnatch/utils.py w/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/src/bandersnatch/utils.py
- index 39e3283..d832128 100644
- --- i/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/src/bandersnatch/utils.py
- +++ w/2.1.2dev0/src/pypa-bandersnatch-0eccd9d664b7/src/bandersnatch/utils.py
- @@ -2,21 +2,17 @@ import contextlib
- import hashlib
- import os
- import os.path
- -import pkg_resources
- import sys
- import tempfile
- +from . import __version__
- def user_agent():
- template = 'bandersnatch/{version} ({python}, {system})'
- system = os.uname()
- system = ' '.join([system[0], system[4]])
- - version = pkg_resources.require("bandersnatch")[0].version
- - # Support Python 2 + 3 - No sys.subversion in Py3
- - try:
- - python = sys.subversion[0]
- - except AttributeError:
- - python = sys.implementation.name
- + version = __version__
- + python = sys.implementation.name
- python += ' {0}.{1}.{2}-{3}{4}'.format(*sys.version_info)
- return template.format(**locals())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement