Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 112eefc

Browse files
committed
Merge pull request ua-parser#12 from crbunney/fix_pip_install_from_source
Update setup.py to enable pip installs direct from github
2 parents 33c2bdf + 1e2a932 commit 112eefc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from setuptools import setup
33
from setuptools.command.develop import develop as _develop
44
from setuptools.command.sdist import sdist as _sdist
5+
from setuptools.command.install import install as _install
56

67

78
def install_regexes():
@@ -37,6 +38,11 @@ def run(self):
3738
_sdist.run(self)
3839

3940

41+
class install(_install):
42+
def run(self):
43+
install_regexes()
44+
_install.run(self)
45+
4046
setup(
4147
name='ua-parser',
4248
version='0.5.0',
@@ -50,10 +56,12 @@ def run(self):
5056
url='https://github.com/ua-parser/uap-python',
5157
include_package_data=True,
5258
package_data={'ua_parser': ['regexes.yaml', 'regexes.json']},
59+
setup_requires=['pyyaml'],
5360
install_requires=['pyyaml'],
5461
cmdclass={
5562
'develop': develop,
5663
'sdist': sdist,
64+
'install': install,
5765
},
5866
classifiers=[
5967
'Development Status :: 4 - Beta',

0 commit comments

Comments
 (0)