Skip to content

Commit

Permalink
Add esutil package
Browse files Browse the repository at this point in the history
The complication is that esutil ships with its own `ups/esutil.table` file.
It also overwrites the shipped version in `setup.py`.

We want to use our own custom table file.  To do this I did the following:
* made an override to `prep` to link the LSST version into place after the package
is unpacked.
* added a patch that removes the parts of `setup.py` that rewrite the file.

Note that we still need to include a link to the LSST table file in the repo, even though
it is overwritten, to setup the environment initially.
  • Loading branch information
SimonKrughoff committed Mar 31, 2016
1 parent 57adcac commit 0a272f7
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md

This file was deleted.

6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
esutil
******

This is a package provided by Erin Sheldon (esheldon on github).
There are lots of nice utilities. In particular, the HTM python
bindings are used in reference catalog sharding.
26 changes: 26 additions & 0 deletions patches/setup.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- a/setup.py 2015-11-10 07:15:20.000000000 -0800
+++ b/setup_new.py 2016-03-30 17:55:22.000000000 -0700
@@ -13,23 +13,6 @@
pylib_install_subdir = main_libdir.replace(distutils.sysconfig.PREFIX+os.sep,'')
pylib_install_subdir = pylib_install_subdir.replace('dist-packages','site-packages')

-if not os.path.exists('ups'):
- os.mkdir('ups')
-tablefile=open('ups/esutil.table','w')
-tab="""
-# The default version of this file will be overwritten on setup to include
-# paths determined from the python version. This is useful to have in place
-# though so that dependencies can be checked *before* installation. Currently
-# there are no required dependencies, so this is somewhat moot.
-
-setupOptional("python")
-setupOptional("cjson")
-envPrepend(PYTHONPATH,${PRODUCT_DIR}/%s)
-""" % pylib_install_subdir
-tablefile.write(tab)
-tablefile.close()
-
-

# can we build recfile?
packages = ['esutil']
1 change: 1 addition & 0 deletions ups/esutil.table
3 changes: 3 additions & 0 deletions ups/esutil.table.lsst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setupRequired(python)
setupRequired(numpy)
envPrepend(PYTHONPATH, ${PRODUCT_DIR}/lib/python)
15 changes: 15 additions & 0 deletions ups/eupspkg.cfg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
TAP_PACKAGE=1

prep()
{
default_prep

# Move the LSST copy of esutil.table over the one that ships with esutil
UPS_DIR="ups"
LSST_TABLE="esutil.table.lsst"
ESUTIL_TABLE="esutil.table"

cd ${UPS_DIR}
[ -f ${ESUTIL_TABLE} ] && rm ${ESUTIL_TABLE}
ln -s ${LSST_TABLE} ${ESUTIL_TABLE}
}
Binary file added upstream/esutil-0.5.3.tar.gz
Binary file not shown.

0 comments on commit 0a272f7

Please sign in to comment.