forked from ipfs-shipyard/py-ipfs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
48 lines (37 loc) · 1.24 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os
import re
import sys
import setuptools
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
PKG_DIR = os.path.dirname(__file__)
with open(os.path.join(PKG_DIR, 'ipfs', '__init__.py')) as VERSION_FILE:
VERSION = (re.compile(r".*__version__ = '(.*?)'", re.S)
.match(VERSION_FILE.read())
.group(1))
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as README_FILE:
README = README_FILE.read()
setuptools.setup(
name='ipfs',
description='An implementation of IPFS in Python',
long_description=README,
author='bmcorser',
author_email='[email protected]',
version=VERSION,
packages=setuptools.find_packages(),
tests_require=['pytest'],
install_requires=['six'],
cmdclass={'test': PyTest},
)