Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
66 lines (59 loc) · 2.1 KB
/
Copy pathsetup.py
File metadata and controls
66 lines (59 loc) · 2.1 KB
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
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
import pip
import os
import sys
import contextlib
@contextlib.contextmanager
def cwd(path):
curdir = os.getcwd()
try:
os.chdir(path)
yield
finally:
os.chdir(curdir)
# inspired by https://blog.shazam.com/python-microlibs-5be9461ad979
packages = ['vaex-core', 'vaex-viz', 'vaex-hdf5', 'vaex-server', 'vaex-astro', 'vaex-ui', 'vaex-jupyter', 'vaex-distributed']
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
class DevelopCmd(develop):
def run(self):
for package in packages:
with cwd(os.path.join('packages', package)):
os.system('python -m pip install -e .')
# we need to make symbolic links from vaex-core/vaex/<name> to vaex-<name>/vaex/<name
# otherwise development install do not work
if package != 'vaex-core':
name = package.split('-')[1]
source = os.path.abspath(os.path.join('packages', package, 'vaex', name))
target = os.path.abspath(os.path.join('packages', packages[0], 'vaex', name))
if os.path.exists(target):
os.remove(target)
os.symlink(source, target)
class InstallCmd(install):
""" Add custom steps for the install command """
def run(self):
for package in packages:
with cwd(os.path.join('packages', package)):
os.system('python -m pip install --no-deps .')
for package in packages:
with cwd(os.path.join('packages', package)):
os.system('python -m pip install --upgrade .')
if on_rtd:
os.system('python -m pip install vaex-ml==0.3.2')
setup(
name='vaex-meta',
version="0.1.0",
description="Convenience setup.py for when installing from the git repo",
classifiers=[
'Private :: Do Not Upload to pypi server',
],
install_requires=[
'pip',
],
cmdclass={
'install': InstallCmd,
'develop': DevelopCmd,
},
)