-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathsetup.py
More file actions
27 lines (23 loc) · 741 Bytes
/
setup.py
File metadata and controls
27 lines (23 loc) · 741 Bytes
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
from setuptools import setup
from setuptools.command.build_py import build_py
import subprocess
import shutil
import os
class BuildSwift(build_py):
def run(self):
# Build Swift binary from source
subprocess.check_call(['swift', 'build', '-c', 'release'])
# Copy binary to package
bin_dir = os.path.join(self.build_lib, 'macocr_py', 'bin')
os.makedirs(bin_dir, exist_ok=True)
shutil.copy('.build/release/macocr', bin_dir)
# Continue normal build
super().run()
setup(
name='macocr',
version='0.1.0',
packages=['macocr_py'],
cmdclass={'build_py': BuildSwift},
url='https://github.com/ughe/macocr',
description='macOS OCR using Vision framework',
)