Skip to content

Commit

Permalink
Merge b09e5bd into 81161d4
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelo-alvarez committed Feb 3, 2021
2 parents 81161d4 + b09e5bd commit af1dde3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: coveralls

docs:
Expand Down
6 changes: 4 additions & 2 deletions doc/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ Change Log
3.1.2 (unreleased)
------------------

* No changes yet
* Allow :command:`desiInstall` to use :command:`cmake` (PR `#160`_).

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

3.1.1 (2020-12-23)
------------------

* ``astropy.erfa`` no longer exists in more recent versions of Astropy
(PR `#159`_).
* Add function :func:`dust.extinction_total_to_selective_ratio` (PR `#157`_).
* Add function :func:`~desiutil.dust.extinction_total_to_selective_ratio` (PR `#157`_).

.. _`#157`: https://github.com/desihub/desiutil/pull/157
.. _`#159`: https://github.com/desihub/desiutil/pull/159
Expand Down
17 changes: 14 additions & 3 deletions py/desiutil/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,16 @@ def build_type(self):
self.log.debug("Forcing build type: make")
build_type.add('make')
else:
print('cwd: ',self.working_dir);
if os.path.exists(os.path.join(self.working_dir, 'setup.py')):
self.log.debug("Detected build type: py")
build_type.add('py')
if os.path.exists(os.path.join(self.working_dir, 'Makefile')):
self.log.debug("Detected build type: make")
build_type.add('make')
elif os.path.exists(os.path.join(self.working_dir,'CMakeLists.txt')):
self.log.debug("Detected build type: cmake")
build_type.add('cmake')
else:
if os.path.isdir(os.path.join(self.working_dir, 'src')):
self.log.debug("Detected build type: src")
Expand Down Expand Up @@ -834,11 +838,14 @@ def install(self):
# installation or we still need to compile the C/C++ product
# (we had to construct doc/Makefile first).
#
if 'make' in self.build_type or 'src' in self.build_type:
if ('make' in self.build_type or 'src' in self.build_type or
'cmake' in self.build_type):
if 'src' in self.build_type:
command = ['make', '-C', 'src', 'all']
else:
elif 'make' in self.build_type:
command = ['make', '-j', '8', 'install']
elif 'cmake' in self.build_type:
command = ['cmake .; make -j 8']
self.log.debug(' '.join(command))
if self.options.test:
self.log.debug("Test Mode. Skipping 'make install'.")
Expand All @@ -847,7 +854,11 @@ def install(self):
os.chdir(self.install_dir)
else:
os.chdir(self.working_dir)
proc = Popen(command, universal_newlines=True,
if 'cmake' in self.build_type:
proc = Popen(command, universal_newlines=True,
stdout=PIPE, stderr=PIPE, shell=True)
else:
proc = Popen(command, universal_newlines=True,
stdout=PIPE, stderr=PIPE)
out, err = proc.communicate()
self.log.debug(out)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
setuptools
requests
pyyaml
numpy<1.20
astropy
healpy
matplotlib

0 comments on commit af1dde3

Please sign in to comment.