1
1
# -*- coding: utf-8 -*-
2
2
import os
3
+ import subprocess
4
+ import sys
3
5
from setuptools import setup , find_packages
6
+ from setuptools .command .install import install
4
7
5
8
os .environ ["MPLCONFIGDIR" ] = "."
6
9
7
10
8
- def parse_dependencies (requirements_path , vcs_id , egg_id ):
9
- requirements = []
10
- with open (requirements_path , 'r' ) as f :
11
- reqs = f .read ().splitlines ()
11
+ class PostInstall (install ):
12
+ github_pkg = 'https://api.github.com/repos/lmcinnes/umap/tarball/5f9488a9540d1e0ac149e2dd42ebf03c39706110#egg=umap_learn'
12
13
13
- for req in reqs :
14
- if req .startswith (vcs_id ) and egg_id in req :
15
- package_name = req [req .find (egg_id ) + len (egg_id ):]
16
- requirements .append (package_name + ' @ ' + req .rstrip (egg_id + package_name ))
17
- else :
18
- requirements .append (req )
19
-
20
- return requirements
14
+ def run (self ):
15
+ install .run (self )
16
+ output = subprocess .run ([sys .executable , '-m' , 'pip' , 'install' , self .github_pkg ],
17
+ stdout = subprocess .PIPE )
18
+ print (output .stdout .decode ('utf-8' ))
21
19
22
20
23
21
NAME = 'hypertools'
24
- VERSION = '0.6.0 '
22
+ VERSION = '0.6.2 '
25
23
AUTHOR = 'Contextual Dynamics Lab'
26
24
AUTHOR_EMAIL = '[email protected] '
27
25
URL = 'https://github.com/ContextLab/hypertools'
28
26
DOWNLOAD_URL = URL
29
27
LICENSE = 'MIT'
30
- REQUIRES_PYTHON = '>=3'
28
+ REQUIRES_PYTHON = '>=3.5 '
31
29
PACKAGES = find_packages (exclude = ('images' , 'examples' , 'tests' ))
32
- REQUIREMENTS = parse_dependencies ('requirements.txt' , 'https://api.github.com' , '#egg=' )
33
-
30
+ with open ('requirements.txt' , 'r' ) as f :
31
+ REQUIREMENTS = f . read (). splitlines ()
34
32
35
33
DESCRIPTION = 'A python package for visualizing and manipulating high-dimensional data'
36
34
LONG_DESCRIPTION = """\
@@ -57,7 +55,11 @@ def parse_dependencies(requirements_path, vcs_id, egg_id):
57
55
'Topic :: Multimedia :: Graphics' ,
58
56
'Operating System :: POSIX' ,
59
57
'Operating System :: Unix' ,
60
- 'Operating System :: MacOS' ]
58
+ 'Operating System :: MacOS'
59
+ ]
60
+ CMDCLASS = {
61
+ 'install' : PostInstall
62
+ }
61
63
62
64
63
65
setup (
@@ -74,4 +76,5 @@ def parse_dependencies(requirements_path, vcs_id, egg_id):
74
76
packages = PACKAGES ,
75
77
install_requires = REQUIREMENTS ,
76
78
classifiers = CLASSIFIERS ,
79
+ cmdclass = CMDCLASS ,
77
80
)
0 commit comments