This repository has been archived by the owner on Jan 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
setup.py
61 lines (52 loc) · 1.63 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
import os
import shutil
from distutils.dir_util import copy_tree
from setuptools import find_packages, setup
import warnings
# global variables
repo_notebook_folder = f'notebooks'
package_name = 'pystrath_dsp'
pip_name = 'pystrath-dsp'
data_files = []
# Get environment variables
def check_env():
notebooks_dir = None
if 'PYNQ_JUPYTER_NOTEBOOKS' not in os.environ:
warnings.warn(
"Use `export PYNQ_JUPYTER_NOTEBOOKS=<desired-notebook-path>` "
"to get the notebooks.",
UserWarning)
# Install to current working directory if not on PYNQ
notebooks_dir = os.getcwd()
else:
notebooks_dir = os.environ['PYNQ_JUPYTER_NOTEBOOKS']
return notebooks_dir
notebooks_dir = None
if 'PYNQ_JUPYTER_NOTEBOOKS' not in os.environ:
warnings.warn(
"Use `export PYNQ_JUPYTER_NOTEBOOKS=<desired-notebook-path>` "
"to get the notebooks.",
UserWarning)
else:
notebooks_dir = os.environ['PYNQ_JUPYTER_NOTEBOOKS']
return notebooks_dir
# copy notebooks to jupyter home
def copy_notebooks():
board_notebooks_dir = check_env()
src_nb_dir = os.path.join(repo_notebook_folder)
dst_nb_dir = os.path.join(board_notebooks_dir, 'rfsoc-studio', 'dsp-notebooks')
if os.path.exists(dst_nb_dir):
shutil.rmtree(dst_nb_dir)
copy_tree(src_nb_dir, dst_nb_dir)
copy_notebooks()
setup(
name=package_name,
version='0.1.3',
install_requires=[
],
author="strath-sdr",
packages=find_packages(),
package_data={
'': data_files,
},
description="University of Strathclyde Python SDR.")