-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
67 lines (59 loc) · 2.27 KB
/
setup.py
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
from setuptools import setup, find_packages
from setuptools.command.install import install
from shutil import copyfile
import os
import subprocess
#Read requirements.txt
with open('requirements.txt') as f:
required = f.read().splitlines()
# Read README.md for the long description
with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read()
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
print("Dosview intsallation script in progress .. ")
install.run(self)
try:
if not os.path.exists('/usr/local/share/applications'):
os.makedirs('/usr/local/share/applications')
copyfile('dosview.desktop', '/usr/local/share/applications/dosview.desktop')
if not os.path.exists('/usr/local/share/icons'):
os.makedirs('/usr/local/share/icons')
copyfile('media/icon_ust.png', '/usr/local/share/icons/icon_ust.png')
except Exception as e:
print(f"Error: {e}")
print("Dosview intsallation script failed .. ")
# Get the commit hash
#commit_hash = subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode().strip()
setup(
name='dosview',
#version= dosview.__version__,
version="0.1.17",
description='Dosview is a simple graphical log viewer and control interface for Universial Scientific Technologies (UST) dosimeters.',
long_description=long_description,
long_description_content_type='text/markdown',
packages=find_packages(),
entry_points={
'console_scripts': [
'dosview = dosview:main',
],
},
include_package_data=True,
install_requires=required,
cmdclass={
'install': PostInstallCommand,
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
)