porcupine/binding/python/setup.py
Go to the documentation of this file.
1 #
2 # Copyright 2019-2022 Picovoice Inc.
3 #
4 # You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
5 # file accompanying this source.
6 #
7 # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
8 # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
9 # specific language governing permissions and limitations under the License.
10 #
11 
12 import os
13 import shutil
14 
15 import setuptools
16 
17 os.system('git clean -dfx')
18 
19 package_folder = os.path.join(os.path.dirname(__file__), 'pvporcupine')
20 os.mkdir(package_folder)
21 
22 shutil.copy(os.path.join(os.path.dirname(__file__), '../../LICENSE'), package_folder)
23 
24 shutil.copy(os.path.join(os.path.dirname(__file__), '__init__.py'), os.path.join(package_folder, '__init__.py'))
25 shutil.copy(os.path.join(os.path.dirname(__file__), 'porcupine.py'), os.path.join(package_folder, 'porcupine.py'))
26 shutil.copy(os.path.join(os.path.dirname(__file__), 'util.py'), os.path.join(package_folder, 'util.py'))
27 
28 platforms = ('beaglebone', 'jetson', 'linux', 'mac', 'raspberry-pi', 'windows')
29 
30 os.mkdir(os.path.join(package_folder, 'lib'))
31 for platform in ('common',) + platforms:
32  shutil.copytree(
33  os.path.join(os.path.dirname(__file__), '../../lib', platform),
34  os.path.join(package_folder, 'lib', platform))
35 
36 for platform in platforms:
37  shutil.copytree(
38  os.path.join(os.path.dirname(__file__), '../../resources/keyword_files', platform),
39  os.path.join(package_folder, 'resources/keyword_files', platform))
40 
41 MANIFEST_IN = """
42 include pvporcupine/LICENSE
43 include pvporcupine/__init__.py
44 include pvporcupine/porcupine.py
45 include pvporcupine/util.py
46 include pvporcupine/lib/common/porcupine_params.pv
47 include pvporcupine/lib/beaglebone/libpv_porcupine.so
48 recursive-include pvporcupine/lib/jetson *
49 include pvporcupine/lib/linux/x86_64/libpv_porcupine.so
50 include pvporcupine/lib/mac/x86_64/libpv_porcupine.dylib
51 include pvporcupine/lib/mac/arm64/libpv_porcupine.dylib
52 recursive-include pvporcupine/lib/raspberry-pi *
53 include pvporcupine/lib/windows/amd64/libpv_porcupine.dll
54 recursive-include pvporcupine/resources/keyword_files/beaglebone *
55 recursive-include pvporcupine/resources/keyword_files/jetson *
56 recursive-include pvporcupine/resources/keyword_files/linux *
57 recursive-include pvporcupine/resources/keyword_files/mac/ *
58 recursive-include pvporcupine/resources/keyword_files/raspberry-pi *
59 recursive-include pvporcupine/resources/keyword_files/windows *
60 """
61 
62 with open(os.path.join(os.path.dirname(__file__), 'MANIFEST.in'), 'w') as f:
63  f.write(MANIFEST_IN.strip('\n '))
64 
65 with open(os.path.join(os.path.dirname(__file__), 'README.md'), 'r') as f:
66  long_description = f.read()
67 
68 setuptools.setup(
69  name="pvporcupine",
70  version="2.1.0",
71  author="Picovoice",
72  author_email="hello@picovoice.ai",
73  description="Porcupine wake word engine.",
74  long_description=long_description,
75  long_description_content_type="text/markdown",
76  url="https://github.com/Picovoice/porcupine",
77  packages=["pvporcupine"],
78  include_package_data=True,
79  classifiers=[
80  "Development Status :: 5 - Production/Stable",
81  "Intended Audience :: Developers",
82  "License :: OSI Approved :: Apache Software License",
83  "Operating System :: OS Independent",
84  "Programming Language :: Python :: 3",
85  "Topic :: Multimedia :: Sound/Audio :: Speech"
86  ],
87  python_requires='>=3.5',
88  keywords="wake word engine, hotword detection, keyword spotting, wake word detection, voice commands",
89 )


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:50