Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
79 lines (65 loc) · 1.99 KB
/
Copy pathsetup.py
File metadata and controls
79 lines (65 loc) · 1.99 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
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright (C) 2022 Xilinx, Inc
# SPDX-License-Identifier: BSD-3-Clause
import glob
import os
import re
import shutil
import subprocess
import warnings
from distutils.dir_util import copy_tree
from distutils.file_util import copy_file, move_file
from shutil import rmtree
from setuptools import Distribution, Extension, find_packages, setup
from setuptools.command.build_ext import build_ext
# extend the package files by directory or by file
def extend_pynq_utils_package(data_list):
for data in data_list:
if os.path.isdir(data):
pynq_utils_files.extend(
[
os.path.join("..", root, f)
for root, _, files in os.walk(data)
for f in files
]
)
elif os.path.isfile(data):
pynq_utils_files.append(os.path.join("..", data))
# Get the version
ver_file = open("./pynqutils/version.txt", "r")
ver_str = ver_file.readline()
# read the contents of your README file
from pathlib import Path
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()
# Get the files
pynq_utils_files = []
extend_pynq_utils_package(
[
"pynqutils/",
"pynqutils/version.txt",
]
)
# Required packages
required = ["setuptools<=80", "pynqmetadata>=0.0.1", "cffi", "tqdm", "numpy<2.0", "python-magic>=0.4.25"]
# Platform-specific dependencies for Windows
import sys
if sys.platform.startswith('win'):
required.append("python-magic-bin>=0.4.14")
setup(
name="pynqutils",
version=ver_str,
description="Utilities for PYNQ",
long_description=long_description,
long_description_content_type='text/markdown',
url="https://github.com/Xilinx/PYNQ-Utils",
author="pynq",
author_email="pynq_support@xilinx.com",
packages=find_packages(),
install_requires=required,
python_requires=">=3.5.2",
package_data={
"pynqutils": pynq_utils_files,
},
zip_safe=False,
license="BSD 3-Clause",
)