Skip to content

Commit

Permalink
Merge 8f0d448 into 93f40ac
Browse files Browse the repository at this point in the history
  • Loading branch information
sbailey committed Jun 4, 2021
2 parents 93f40ac + 8f0d448 commit 75870aa
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
5 changes: 4 additions & 1 deletion doc/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ Change Log
3.2.2 (unreleased)
------------------

* No changes yet.
* Add module config support for packages like QuasarNP where the GitHub
name is capitalized by the python package isn't (PR `#173`_).

.. _`#173`: https://github.com/desihub/desiutil/pull/173

3.2.1 (2021-05-13)
------------------
Expand Down
5 changes: 4 additions & 1 deletion py/desiutil/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ def configure_module(product, version, product_root, working_dir=None, dev=False
module_keywords['needs_ld_lib'] = ''
if isdir(join(working_dir, 'pro')):
module_keywords['needs_idl'] = ''
if (exists(join(working_dir, 'setup.py')) and isdir(join(working_dir, product))):
if (exists(join(working_dir, 'setup.py')) and
(isdir(join(working_dir, product)) or
isdir(join(working_dir, product.lower())))
):
if dev:
module_keywords['needs_trunk_py'] = ''
module_keywords['trunk_py_dir'] = ''
Expand Down
29 changes: 29 additions & 0 deletions py/desiutil/test/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,35 @@ def test_configure_module(self):
rmdir(join(self.data_dir, t))
for t in test_files:
remove(join(self.data_dir, t))
#
# Test mixed case product directory (Blat) vs. python package (blat)
#
test_dirs = ('blat',)
test_files = {'setup.py': '#!/usr/bin/env python\n'}
for t in test_dirs:
mkdir(join(self.data_dir, t))
for t in test_files:
with open(join(self.data_dir, t), 'w') as s:
s.write(test_files[t])
results['name'] = 'Blat'
results['version'] = '1.2.3'
results['needs_bin'] = '# '
results['needs_python'] = ''
results['needs_trunk_py'] = '# '
results['trunk_py_dir'] = '/py'
results['needs_ld_lib'] = '# '
results['needs_idl'] = '# '

conf = configure_module('Blat', '1.2.3', '/my/product/root',
working_dir=self.data_dir)

for key in results:
self.assertEqual(conf[key], results[key], key)
for t in test_dirs:
rmdir(join(self.data_dir, t))
for t in test_files:
remove(join(self.data_dir, t))


def test_process_module(self):
"""Test processing of module file templates.
Expand Down

0 comments on commit 75870aa

Please sign in to comment.