forked from Labsmore/pyuscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
61 lines (56 loc) · 1.71 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
#!/usr/bin/env python3
import os
from setuptools import setup, find_packages
import shutil
import glob
import sys
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
if not os.path.exists('build'):
os.mkdir('build')
scripts = []
scripts += list(glob.glob("util/*.py"))
scripts += list(glob.glob("demo/*.py"))
scripts_dist = []
print(scripts)
for script in scripts:
# Make script names more executable like
# util/main_gui.py => pyuscope-main-gui
dst = 'build/pyuscope-' + script.replace('.py', '').replace(
'_', '-').replace("/", "-")
dst = dst.replace("-util", "")
print(script, dst)
if os.path.exists(dst):
os.unlink(dst)
print("removed")
if "develop" in sys.argv:
# switch to symlink to make "develop" work correctly
print("check", dst)
os.symlink(os.path.abspath(script), dst)
else:
shutil.copy(script, dst)
scripts_dist.append(dst)
setup(
name="pyuscope",
version="4.5.0",
author="John McMaster",
author_email='[email protected]',
description=("Digital microscope controller"),
license="BSD",
keywords="microscope touptek",
url='https://github.com/Labsmore/pyuscope',
packages=find_packages(exclude=['build']),
scripts=scripts_dist,
# FIXME
install_requires=[],
#long_description=read('README.md'),
# Expects rst, not .md
long_description="FIXME",
classifiers=[
"License :: OSI Approved :: BSD License",
],
)