Skip to content

Commit

Permalink
switch to pip install
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Mar 29, 2021
1 parent 3ce49f0 commit 65ce7be
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
24 changes: 21 additions & 3 deletions py/desiutil/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@

known_products = {
'desiBackup': 'https://github.com/desihub/desiBackup',
'desicmx': 'https://github.com/desihub/desicmx',
'desidatamodel': 'https://github.com/desihub/desidatamodel',
'desidithering': 'https://github.com/desihub/desidithering',
'desietc': 'https://github.com/desihub/desietc',
'desilamps': 'https://github.com/desihub/desilamps',
'desimeter': 'https://github.com/desihub/desimeter',
'desimodel': 'https://github.com/desihub/desimodel',
'desiperf': 'https://github.com/desihub/desiperf',
'desisim': 'https://github.com/desihub/desisim',
'desisim-testdata': 'https://github.com/desihub/desisim-testdata',
'desispec': 'https://github.com/desihub/desispec',
Expand All @@ -43,27 +45,39 @@
'desitransfer': 'https://github.com/desihub/desitransfer',
'desitree': 'https://github.com/desihub/desitree',
'desiutil': 'https://github.com/desihub/desiutil',
'fastspecfit': 'https://github.com/desihub/fastspecfit',
'fiberassign': 'https://github.com/desihub/fiberassign',
'gcr-catalogs': 'https://github.com/desihub/gcr-catalogs',
'imaginglss': 'https://github.com/desihub/imaginglss',
'LSS': 'https://github.com/desihub/LSS',
'nightwatch': 'https://github.com/desihub/nightwatch',
'prospect': 'https://github.com/desihub/prospect',
'quicksurvey_example': 'https://github.com/desihub/quicksurvey_example',
'redrock': 'https://github.com/desihub/redrock',
'redrock-templates': 'https://github.com/desihub/redrock-templates',
'specex': 'https://github.com/desihub/specex',
'speclite': 'https://github.com/desihub/speclite',
'specsim': 'https://github.com/desihub/specsim',
'specter': 'https://github.com/desihub/specter',
'surveysim': 'https://github.com/desihub/surveysim',
'teststand': 'https://github.com/desihub/teststand',
'tilepicker': 'https://github.com/desihub/tilepicker',
'timedomain': 'https://github.com/desihub/timedomain',
'simqso': 'https://github.com/imcgreer/simqso',
'plate_layout': 'https://desi.lbl.gov/svn/code/focalplane/plate_layout',
'positioner_control':
'https://desi.lbl.gov/svn/code/focalplane/positioner_control',
}


pip_safe = frozenset(['desicmx', 'desidatamodel', 'desidithering', 'desietc',
'desimeter', 'desimodel', 'desisim', 'desispec',
'desisurvey', 'desitarget', 'desitemplate', 'desitransfer',
'desiutil', 'fiberassign', 'prospect', 'redrock',
'specex', 'speclite', 'specsim', 'specter', 'surveysim',
'simqso'])


def dependencies(modulefile):
"""Process the dependencies for a software product.
Expand Down Expand Up @@ -798,11 +812,15 @@ def install(self):
#
# Ready to python setup.py
#
command = [sys.executable, 'setup.py', 'install',
'--prefix={0}'.format(self.install_dir)]
# command = [sys.executable, 'setup.py', 'install',
# '--prefix={0}'.format(self.install_dir)]
command = [sys.executable, '-m', 'pip', 'install', '--no-deps',
'--disable-pip-version-check', '--ignore-installed',
'--prefix={0}'.format(self.install_dir), '.']
self.log.debug(' '.join(command))
if self.options.test:
self.log.debug("Test Mode. Skipping 'python setup.py install'.")
# self.log.debug("Test Mode. Skipping 'python setup.py install'.")
self.log.debug("Test Mode. Skipping 'pip install'.")
else:
os.chdir(self.working_dir)
proc = Popen(command, universal_newlines=True,
Expand Down
5 changes: 5 additions & 0 deletions py/desiutil/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ def init_modules(moduleshome=None, method=False, command=False):
if tclsh is None:
raise ValueError("TCL Modules detected, but no tclsh excecutable found.")
modulecmd = [tclsh, os.path.join(moduleshome, 'modulecmd.tcl'), 'python']
elif os.path.exists(os.path.join(moduleshome, 'libexec', 'lmod')):
#
# Lmod version!
#
modulecmd = [os.path.exists(os.path.join(moduleshome, 'libexec', 'lmod')), 'python']
else:
#
# This should work on all NERSC systems, assuming the user's environment
Expand Down

0 comments on commit 65ce7be

Please sign in to comment.