-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsetup.py
68 lines (53 loc) · 1.74 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pathlib
import subprocess
from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.develop import develop
__requires__ = ['pipenv']
packages = find_packages(exclude=['tests'])
base_dir = pathlib.Path(__file__).parent
pipenv_command = ['pipenv', 'install', ]
pipenv_command_dev = ['pipenv', 'install', '--dev', ]
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
subprocess.check_call(pipenv_command_dev)
develop.run(self)
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
subprocess.check_call(pipenv_command)
install.run(self)
with open(str(base_dir / 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='hx711',
version='1.1.2.3',
description="A library to drive a HX711 load cell amplifier on a Raspberry Pi",
url='https://github.com/mpibpc-mroose/hx711/',
author="Marco Roose",
author_email='[email protected]',
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3.5',
],
project_urls={
'Bug Reports': 'https://github.com/mpibpc-mroose/hx711/issues',
},
long_description=long_description,
long_description_content_type="text/markdown",
packages=packages,
package_data={},
include_package_data=True,
license="MIT license",
keywords='hx711',
cmdclass={
'develop': PostDevelopCommand,
'install': PostInstallCommand,
},
test_suite='tests',
)