11# -*- coding: utf-8 -*-
22import os
3+ import subprocess
4+ import sys
35from setuptools import setup , find_packages
6+ from setuptools .command .install import install
47
58os .environ ["MPLCONFIGDIR" ] = "."
69
710
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'
1213
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' ))
2119
2220
2321NAME = 'hypertools'
24- VERSION = '0.6.0 '
22+ VERSION = '0.6.2 '
2523AUTHOR = 'Contextual Dynamics Lab'
2624AUTHOR_EMAIL = '[email protected] ' 2725URL = 'https://github.com/ContextLab/hypertools'
2826DOWNLOAD_URL = URL
2927LICENSE = 'MIT'
30- REQUIRES_PYTHON = '>=3'
28+ REQUIRES_PYTHON = '>=3.5 '
3129PACKAGES = 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 ()
3432
3533DESCRIPTION = 'A python package for visualizing and manipulating high-dimensional data'
3634LONG_DESCRIPTION = """\
@@ -57,7 +55,11 @@ def parse_dependencies(requirements_path, vcs_id, egg_id):
5755 'Topic :: Multimedia :: Graphics' ,
5856 'Operating System :: POSIX' ,
5957 'Operating System :: Unix' ,
60- 'Operating System :: MacOS' ]
58+ 'Operating System :: MacOS'
59+ ]
60+ CMDCLASS = {
61+ 'install' : PostInstall
62+ }
6163
6264
6365setup (
@@ -74,4 +76,5 @@ def parse_dependencies(requirements_path, vcs_id, egg_id):
7476 packages = PACKAGES ,
7577 install_requires = REQUIREMENTS ,
7678 classifiers = CLASSIFIERS ,
79+ cmdclass = CMDCLASS ,
7780)
0 commit comments