Skip to content

Commit

Permalink
fix installation error for Python3.8+
Browse files Browse the repository at this point in the history
  • Loading branch information
taishi-i committed Sep 18, 2020
1 parent 8fdc1a7 commit 30f0e33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
install:
- python setup.py install
- pip install coveralls
Expand Down
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ def extensions():
return cythonize(extensions)


def switch_install_requires():
major = sys.version_info.major
minor = sys.version_info.minor
if os.name == 'posix' and major == 3 and minor > 7:
return ['six', 'numpy', 'DyNet38']
else:
return ['six', 'numpy', 'DyNet']


setup(
name='nagisa',
packages=['nagisa'],
Expand All @@ -81,7 +90,7 @@ def extensions():
license='MIT License',
platforms='Unix',
setup_requires=['six', 'cython', 'numpy'],
install_requires=['six', 'numpy', 'DyNet'],
install_requires=switch_install_requires(),
classifiers=classifiers,
include_package_data=True,
test_suite='test.nagisa_test.suite',
Expand Down

0 comments on commit 30f0e33

Please sign in to comment.