-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathsetup.py
More file actions
76 lines (64 loc) · 2.72 KB
/
setup.py
File metadata and controls
76 lines (64 loc) · 2.72 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
#
# Copyright 2021-2025 Picovoice Inc.
#
# You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
# file accompanying this source.
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
import os
import shutil
import setuptools
os.system('git clean -dfx')
package_folder = os.path.join(os.path.dirname(__file__), 'pvrecorder')
os.mkdir(package_folder)
shutil.copy(os.path.join(os.path.dirname(__file__), '../../LICENSE'), package_folder)
shutil.copy(os.path.join(os.path.dirname(__file__), '__init__.py'), os.path.join(package_folder, '__init__.py'))
shutil.copy(os.path.join(os.path.dirname(__file__), '_pvrecorder.py'), os.path.join(package_folder, '_pvrecorder.py'))
platforms = ('linux', 'mac', 'raspberry-pi', 'windows')
os.mkdir(os.path.join(package_folder, 'lib'))
for platform in platforms:
shutil.copytree(
os.path.join(os.path.dirname(__file__), '../../lib', platform),
os.path.join(package_folder, 'lib', platform))
MANIFEST_IN = """
include pvrecorder/LICENSE
include pvrecorder/__init__.py
include pvrecorder/_pv_recorder.py
include pvrecorder/lib/linux/x86_64/libpv_recorder.so
include pvrecorder/lib/mac/x86_64/libpv_recorder.dylib
include pvrecorder/lib/mac/arm64/libpv_recorder.dylib
recursive-include pvrecorder/lib/raspberry-pi *
include pvrecorder/lib/windows/amd64/libpv_recorder.dll
include pvrecorder/lib/windows/arm64/libpv_recorder.dll
recursive-include pvrecorder/resources/scripts *
"""
with open(os.path.join(os.path.dirname(__file__), 'MANIFEST.in'), 'w') as f:
f.write(MANIFEST_IN.strip('\n '))
with open(os.path.join(os.path.dirname(__file__), 'README.md'), 'r') as f:
long_description = f.read()
setuptools.setup(
name="pvrecorder",
version="1.2.7",
author="Picovoice",
author_email="hello@picovoice.ai",
description="Recorder library for Picovoice.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Picovoice/pvrecorder",
packages=["pvrecorder"],
install_requires=[],
include_package_data=True,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Multimedia :: Sound/Audio :: Speech"
],
python_requires='>=3.9',
keywords="Audio Recorder",
)