setup.py and things

This commit is contained in:
Amber Brown (HawkOwl) 2015-11-29 21:57:37 +08:00
parent d083e64789
commit 9cfc500f2c
5 changed files with 65 additions and 2 deletions

5
.coveragerc Normal file
View File

@ -0,0 +1,5 @@
[run]
include =
*/incremental.py
tests/*
branch = True

1
.gitignore vendored
View File

@ -14,3 +14,4 @@ htmlcov/
*~
*.lock
apidocs/
.tox/

34
setup.py Normal file
View File

@ -0,0 +1,34 @@
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import os, sys
from setuptools import setup
base_dir = os.path.dirname(__file__)
src_dir = os.path.join(base_dir, "src")
# We need to import outselves
sys.path.insert(0, src_dir)
import incremental
setup(
name='incremental',
version=incremental.__version__.base(),
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
],
package_dir={"": "src"},
py_modules=['incremental']
)

View File

@ -190,7 +190,7 @@ class Version(object):
def short(self):
"""
Return a string in canonical short version format,
<major>.<minor>.<micro>[+rSVNVer/+gitsha1].
<major>.<minor>.<micro>[+rSVNVer/@gitsha1].
"""
s = self.base()
gitver = self._getGitVersion()
@ -207,7 +207,7 @@ class Version(object):
def base(self):
"""
Like L{short}, but without the +rSVNVer.
Like L{short}, but without the +rSVNVer or @gitsha1.
"""
if self.prerelease is None:
pre = ""

23
tox.ini Normal file
View File

@ -0,0 +1,23 @@
[tox]
envlist = flake8, {py27,pypy,py33,py34}-tests
[testenv:flake8]
skip_install = True
deps =
flake8
commands =
flake8 src/incremental.py
basepython = python2.7
[testenv]
deps =
Twisted
coverage
commands =
python -V
coverage --version
{envbindir}/trial --version
coverage run {envbindir}/trial tests/test_version.py
coverage report
coverage html