-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·52 lines (44 loc) · 1.54 KB
/
setup.py
File metadata and controls
executable file
·52 lines (44 loc) · 1.54 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
#!/usr/bin/env python3
# to install directly, invoke via pip: sudo pip3 install .
# packages for PyPI.org: ./setup.py sdist bdist_wheel && twine upload dist/*
import setuptools
import os, sys, re
from pathlib import Path
mainscript = 'labelpush.py'
resources = []
for fil in (f for f in Path('data').rglob('*') if f.is_file()):
resources.append((str('share' / fil.parent.relative_to('data')), [str(fil)]))
with open('requirements.txt') as fh:
required = fh.read().strip().splitlines()
with open('README.md', 'r') as fh:
long_description = fh.read()
with open(mainscript) as fh:
for line in fh:
out = re.search(r'version = \u0027(.+?)\u0027$', line)
if out:
extracted_version = out.group(1)
break
try: extracted_version
except NameError:
print('ERROR: Could not extract version from ' + mainscript, file=sys.stderr)
sys.exit(1)
setuptools.setup(
name = 'labelpush',
version = extracted_version,
author = 'Matteljay',
author_email = 'matteljay@pm.me',
description = 'Simple lightweight label printing app',
long_description = long_description,
long_description_content_type = 'text/markdown',
url = 'https://github.com/Matteljay/labelpush',
scripts = [ mainscript ],
install_requires = required,
packages = setuptools.find_packages(),
classifiers = [
'Programming Language :: Python :: 3',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
],
data_files = resources,
)
# End of file