Skip to content

Commit e36b293

Browse files
committed
Fix tox ini can be install bdist_wheel
1 parent 20c4d6c commit e36b293

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎setup.py‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
from setuptools import setup, find_packages
2-
import src
32
import os
43
if len(os.environ.get("TRAVIS_TAG", ""))==0:
54
long_description = ""
65
else:
76
import pypandoc
87
long_description = pypandoc.convert('README.md', 'rst')
98

9+
import re
10+
# https://milkr.io/kfei/5-common-patterns-to-version-your-Python-package/4
11+
def get_version(path):
12+
VERSIONFILE = path
13+
initfile_lines = open(VERSIONFILE, 'rt').readlines()
14+
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
15+
for line in initfile_lines:
16+
mo = re.search(VSRE, line, re.M)
17+
if mo:
18+
return mo.group(1)
19+
raise RuntimeError('Unable to find version string in %s.' % (VERSIONFILE,))
1020

1121
requirements = [
1222
"numpy",
@@ -15,7 +25,7 @@
1525
]
1626

1727
setup(name='jamotools',
18-
version=src.__version__,
28+
version=get_version('src/__init__.py'),
1929
description='A library for Korean Jamo split and vectorize.',
2030
long_description=long_description,
2131
classifiers=[

‎tox.ini‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ envlist=py27,
44
py35,
55
py36
66
skip_missing_interpreters=True
7+
skipsdist=True
78

89
[testenv]
910
deps=ddt
10-
commands=python -m unittest discover -s test
11+
commands=/bin/bash -c "pip wheel --no-deps --wheel-dir=./dist ."
12+
/bin/bash -c "pip install dist/*.whl"
13+
/bin/bash -c "python -m unittest discover -s test"

0 commit comments

Comments
 (0)