diff --git a/setup.py b/setup.py index 14b464bcc4ad2835130aca6ee36cc645f77bd85f..30c75c871896b4409e6fb45e845f38c6838be08a 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ is_repo = os.path.exists(os.path.join(here, '.git')) npm_path = os.pathsep.join([ os.path.join(node_root, 'node_modules', '.bin'), - os.environ.get('PATH', os.defpath), + os.environ.get('PATH', os.defpath), ]) from distutils import log @@ -22,7 +22,9 @@ log.set_verbosity(log.DEBUG) log.info('setup.py entered') 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): """decorator for building minified js/css prior to another command""" @@ -50,6 +52,7 @@ def js_prerelease(command, strict=False): update_package_data(self.distribution) return DecoratedCommand + def update_package_data(distribution): """update package_data to catch changes during setup""" build_py = distribution.get_command_obj('build_py') @@ -77,14 +80,14 @@ class NPM(Command): pass def get_npm_name(self): - npmName = 'npm'; + npmName = 'npm' if platform.system() == 'Windows': - npmName = 'npm.cmd'; - - return npmName; - + npmName = 'npm.cmd' + + return npmName + def has_npm(self): - npmName = self.get_npm_name(); + npmName = self.get_npm_name() try: check_call([npmName, '--version']) return True @@ -99,15 +102,18 @@ class NPM(Command): def run(self): has_npm = self.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['PATH'] = npm_path if self.should_run_npm_install(): - log.info("Installing build dependencies with npm. This may take a while...") - npmName = self.get_npm_name(); - check_call([npmName, 'install'], cwd=node_root, stdout=sys.stdout, stderr=sys.stderr) + log.info( + "Installing build dependencies with npm. This may take a while...") + npmName = self.get_npm_name() + check_call([npmName, 'install'], cwd=node_root, + stdout=sys.stdout, stderr=sys.stderr) os.utime(self.node_modules, None) for t in self.targets: @@ -120,6 +126,7 @@ class NPM(Command): # update package data in case this created new files update_package_data(self.distribution) + version_ns = {} with open(os.path.join(here, 'dicom_upload', '_version.py')) as f: exec(f.read(), {}, version_ns) @@ -136,7 +143,7 @@ setup_args = { 'dicom_upload/static/index.js', 'dicom_upload/static/index.js.map', ],), - ('etc/jupyter/nbconfig/notebook.d' ,['dicom-upload.json']) + ('etc/jupyter/nbconfig/notebook.d', ['dicom-upload.json']) ], 'install_requires': [ 'ipywidgets>=7.0.0', @@ -150,7 +157,7 @@ setup_args = { 'jsdeps': NPM, }, - 'author': 'Alice Grosch', + 'author': 'Juelich Supercomputing Centre (JSC)', 'author_email': 'a.grosch@fz-juelich.de', 'url': 'https://github.com/jsc/dicom-upload', 'keywords': [