Skip to content

Commit

Permalink
v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
anshengme committed Dec 11, 2017
1 parent 086feae commit bee1d7c
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 36 deletions.
15 changes: 12 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Turbotools
==================
^^^^^^^^^^^^^^^^

.. image:: https://travis-ci.org/anshengme/turbotools.svg?branch=master
:target: https://travis-ci.org/anshengme/turbotools
Expand All @@ -10,8 +10,17 @@ Turbotools
.. image:: https://img.shields.io/pypi/v/turbotools.svg?
:target: http://badge.fury.io/py/turbotools

.. image:: https://img.shields.io/pypi/pyversions/Django.svg
.. image:: https://img.shields.io/pypi/pyversions/turbotools.svg
:target: https://github.com/anshengme/turbotools

.. image:: https://img.shields.io/github/license/mashape/apistatus.svg
:target: https://github.com/anshengme/turbotools/blob/master/LICENSE
:target: https://github.com/anshengme/turbotools/blob/master/LICENSE


发布PyPi
----------------

::

python setup.py sdist
twine upload dist/*
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
# built documents.
#
# The short X.Y version.
version = '0.0.1'
version = '0.0.3'
# The full version, including alpha/beta/rc tags.
release = '0.0.1'
release = '0.0.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
twine==1.9.1
35 changes: 12 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import codecs
import os

Expand All @@ -9,31 +6,23 @@
from turbotools import __author__
from turbotools import __email__

# from distutils.core import setup
from setuptools import setup, find_packages

here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = '\n' + f.read()

setup(
name=__title__,
version=__version__,
author=__author__,
author_email=__email__,
description='My short description for my project. ',
long_description=long_description,
url='https://github.com/anshengme/turbotools',
packages=find_packages(exclude=('tests',)),
install_requires=['requests'],
entry_points='''
[console_scripts]
turbotools-cli=turbotools.cli:main
''',
classifiers=[
# Trove classifiers
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
# 'License :: OSI Approved :: ISC License',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6']
name=__title__,
version=__version__,
author=__author__,
author_email=__email__,
description='Toolset. ',
long_description=long_description,
url='https://github.com/anshengme/turbotools',
license='LICENSE.txt',
packages=find_packages(exclude=['tests*']),
classifiers=[
'Programming Language :: Python :: 3.6'
]
)
12 changes: 6 additions & 6 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import unittest


class UtilsTest(unittest.TestCase):
def test_random(self):
pass
from turbotools.utils import get_random_str


if __name__ == '__main__':
unittest.main()
class UtilsTest(unittest.TestCase):
def test_get_random_str(self):
random_str = get_random_str(length=4, chars='0123456789')
self.assertEqual(isinstance(int(random_str), int), True)
self.assertEqual(len(random_str), 4)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ commands = sphinx-build -W -b html source build
[testenv:pep8]
deps = flake8
flake8-import-order
commands = flake8 turbotools tests
commands = flake8 --max-line-length 120 turbotools tests

[testenv:unit]
deps = nose
Expand Down
2 changes: 1 addition & 1 deletion turbotools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__title__ = 'turbotools'
__version__ = '0.0.1'
__version__ = '0.0.3'
__author__ = 'ansheng'
__email__ = 'ianshengme@gmail.com'
8 changes: 8 additions & 0 deletions turbotools/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import random
import string


def get_random_str(length=32, chars=string.ascii_uppercase + string.digits + string.ascii_lowercase):
"""在chars中生成length长度的字符串
"""
return ''.join(random.SystemRandom().choice(chars) for _ in range(length))

0 comments on commit bee1d7c

Please sign in to comment.