Skip to content
Snippets Groups Projects
Commit c75f2cf0 authored by alice grosch's avatar alice grosch
Browse files

Update setup.py with long descripton

parent 51430f77
Branches
Tags 0.1.3
No related merge requests found
...@@ -22,7 +22,9 @@ log.set_verbosity(log.DEBUG) ...@@ -22,7 +22,9 @@ log.set_verbosity(log.DEBUG)
log.info('setup.py entered') log.info('setup.py entered')
log.info('$PATH=%s' % os.environ['PATH']) log.info('$PATH=%s' % os.environ['PATH'])
LONG_DESCRIPTION = 'Upload DICOM files with patient und study data removed from header' with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
LONG_DESCRIPTION = f.read()
def js_prerelease(command, strict=False): def js_prerelease(command, strict=False):
"""decorator for building minified js/css prior to another command""" """decorator for building minified js/css prior to another command"""
...@@ -50,6 +52,7 @@ def js_prerelease(command, strict=False): ...@@ -50,6 +52,7 @@ def js_prerelease(command, strict=False):
update_package_data(self.distribution) update_package_data(self.distribution)
return DecoratedCommand return DecoratedCommand
def update_package_data(distribution): def update_package_data(distribution):
"""update package_data to catch changes during setup""" """update package_data to catch changes during setup"""
build_py = distribution.get_command_obj('build_py') build_py = distribution.get_command_obj('build_py')
...@@ -77,14 +80,14 @@ class NPM(Command): ...@@ -77,14 +80,14 @@ class NPM(Command):
pass pass
def get_npm_name(self): def get_npm_name(self):
npmName = 'npm'; npmName = 'npm'
if platform.system() == 'Windows': if platform.system() == 'Windows':
npmName = 'npm.cmd'; npmName = 'npm.cmd'
return npmName; return npmName
def has_npm(self): def has_npm(self):
npmName = self.get_npm_name(); npmName = self.get_npm_name()
try: try:
check_call([npmName, '--version']) check_call([npmName, '--version'])
return True return True
...@@ -99,15 +102,18 @@ class NPM(Command): ...@@ -99,15 +102,18 @@ class NPM(Command):
def run(self): def run(self):
has_npm = self.has_npm() has_npm = self.has_npm()
if not has_npm: if not has_npm:
log.error("`npm` unavailable. If you're running this command using sudo, make sure `npm` is available to sudo") log.error(
"`npm` unavailable. If you're running this command using sudo, make sure `npm` is available to sudo")
env = os.environ.copy() env = os.environ.copy()
env['PATH'] = npm_path env['PATH'] = npm_path
if self.should_run_npm_install(): if self.should_run_npm_install():
log.info("Installing build dependencies with npm. This may take a while...") log.info(
npmName = self.get_npm_name(); "Installing build dependencies with npm. This may take a while...")
check_call([npmName, 'install'], cwd=node_root, stdout=sys.stdout, stderr=sys.stderr) npmName = self.get_npm_name()
check_call([npmName, 'install'], cwd=node_root,
stdout=sys.stdout, stderr=sys.stderr)
os.utime(self.node_modules, None) os.utime(self.node_modules, None)
for t in self.targets: for t in self.targets:
...@@ -120,6 +126,7 @@ class NPM(Command): ...@@ -120,6 +126,7 @@ class NPM(Command):
# update package data in case this created new files # update package data in case this created new files
update_package_data(self.distribution) update_package_data(self.distribution)
version_ns = {} version_ns = {}
with open(os.path.join(here, 'dicom_upload', '_version.py')) as f: with open(os.path.join(here, 'dicom_upload', '_version.py')) as f:
exec(f.read(), {}, version_ns) exec(f.read(), {}, version_ns)
...@@ -150,7 +157,7 @@ setup_args = { ...@@ -150,7 +157,7 @@ setup_args = {
'jsdeps': NPM, 'jsdeps': NPM,
}, },
'author': 'Alice Grosch', 'author': 'Juelich Supercomputing Centre (JSC)',
'author_email': 'a.grosch@fz-juelich.de', 'author_email': 'a.grosch@fz-juelich.de',
'url': 'https://github.com/jsc/dicom-upload', 'url': 'https://github.com/jsc/dicom-upload',
'keywords': [ 'keywords': [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment