Skip to content

Commit e2c5d2c

Browse files
committed
Add info on third-party packages.
1 parent 84eab7e commit e2c5d2c

File tree

1 file changed

+47
-14
lines changed

1 file changed

+47
-14
lines changed

stack/packaging-third-party-eups-dependencies.rst

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
Distributing Third-Party Packages with EUPS
33
###########################################
44

5-
This page documents how to make a third-party software package install-able using the :command:`eups distrib install` command.
5+
This page documents how to make a third-party software package installable using the :command:`eups distrib install` command via two methods: the "forked repo" and the "tarball-and-patch" (TaP) package.
66

7-
Generally, most dependencies :doc:`should be added via conda </stack/conda>` using the ``rubin-env`` metapackage.
8-
The primary reason to add an eups tarball-and-patch (TaP) package as described here is if we require a fix that has not been released in conda-forge (or if the package has no conda-forge recipe at all, and we do not want to create one).
7+
Generally, most dependencies :doc:`should be added via conda </stack/conda>` using the ``rubin-env`` metapackage rather than either of these eups methods.
8+
If the package is already in conda-forge, it can be added to ``rubin-env`` :ref:`via RFC <third-party-approval>`.
9+
(Changes to ``rubin-env`` are made approximately 2-4 times a year.)
10+
If the package is not already in conda-forge, `creating and maintaining a conda-forge recipe`_ is about the same level of effort as maintaining a TaP package, and it makes the package available to the conda-forge community at large rather than just LSST Science Pipelines consumers.
11+
12+
.. _creating and maintaining a conda-forge recipe: https://conda-forge.org/docs/maintainer/adding_pkgs/
13+
14+
If the package is changing rapidly, particularly in its interface, and if the Science Pipelines need those new features or fixes as soon as possible, perhaps even before an official release of the package, a forked repo is usually recommended.
15+
This also :ref:`requires an RFC <third-party-approval>` to add the dependency, but new versions can be incorporated into weekly and even daily builds of the Science Pipelines.
16+
17+
The primary, and rare, reasons to add a TaP package as described here are if we require a fix that will not be released in conda-forge or if the package has no conda-forge recipe at all and we do not want to create one because maintenance of a community recipe might be more burdensome than that of a Science Pipelines-only package (e.g. if we only use a piece of the package but the community would use all of it).
918

10-
Other packages that are under active development by Rubin developers may be maintained as forked repositories and distributed as normal eups packages.
1119

1220
.. _third-party-approval:
1321

@@ -22,10 +30,40 @@ See `this page`_ for a list of compatible licenses.
2230
.. _this page: https://www.gnu.org/licenses/license-list.html
2331

2432

33+
.. _fork-creating:
34+
35+
Creating A Forked Repo
36+
======================
37+
38+
A forked repo relies on building the package from source, rather than using binary artifacts, on the assumption that we may need to use the latest developments.
39+
Accordingly, we fork the package on GitHub into the ``lsst`` organization and add the "DM Externals" and "Overlords" teams to it as described in :doc:`adding-a-new-package`.
40+
This ensures that it will be tagged appropriately for official releases (while not conflicting with the third-party tags).
41+
42+
Since the third-party package likely has no support for eups, we need to add a ``ups`` directory.
43+
This directory should contain the package's EUPS table file as well as an optional file :file:`eupspkg.cfg.sh` which will contain any customized commands for building and installing the third-party package.
44+
45+
The upstream source has no need to know about the ``ups`` directory, so we put it on a separate branch in the ``lsst`` fork.
46+
That branch is traditionally named ``lsst-dev``.
47+
We set that branch to be the GitHub default in our fork.
48+
49+
When changes are made to the upstream source, they can be merged into the ``lsst-dev`` branch, or ``lsst-dev`` can be rebased on an upstream branch.
50+
If we make local changes for our own needs, they can be converted into PRs to the upstream fork, leaving out any commits that refer to the ``ups`` directory contents.
51+
52+
The new package then needs to be added to ``etc/repos.yaml`` in the ``lsst/repos`` repository.
53+
We indicate that the ``lsst-dev`` branch is the one that we will build from by adding a ``ref:`` clause in that file.
54+
55+
Finally, the package should be added as an eups dependency to some other package or meta-package in its ``.table`` file.
56+
This will ensure that it is incorporated in the Science Pipelines build.
57+
58+
If Rubin Data Management becomes the primary maintainer of the package, it can still be treated as third-party, but it may make sense to transition it to being a first-party package.
59+
That would mean ensuring it follows all DM standards and processes.
60+
It can still be published :doc:`via PyPI </stack/building-with-pip>` and conda, in addition to eups.
61+
62+
2563
.. _third-party-creating:
2664

27-
Creating the Package
28-
====================
65+
Creating a TaP Package
66+
======================
2967

3068
Repositories containing third-party packages exist in the `LSST GitHub organization`_.
3169
(Unfortunately, it is currently difficult to distinguish between an LSST package and a third-party package: `the table file`_ in the ``lsst_thirdparty`` package and the documentation on `third party software`_ may help.)
@@ -46,7 +84,7 @@ The repository, once created, needs to contain the following directories:
4684
git archive --format=tar --prefix=astrometry.net-68b1/ HEAD | gzip > astrometry.net-68b1.tar.gz
4785

4886
:file:`ups/`
49-
This directory should contain the packages EUPS table file as well as an optional file :file:`eupspkg.cfg.sh` which will contain any customized commands for installing the third-party package.
87+
This directory should contain the package's EUPS table file as well as an optional file :file:`eupspkg.cfg.sh` which will contain any customized commands for installing the third-party package.
5088

5189
:file:`patches/`
5290
This directory is optional.
@@ -200,14 +238,9 @@ Often, it is desirable to add other files to the package (for example, :file:`RE
200238
EUPS will then misidentify the package type, and the build will fail.
201239

202240
To account for this, it is necessary to explicitly flag this as a TaP package.
203-
There are two mechanisms for this, depending of the `version of EUPS`_ being used.
204-
At time of writing, LSST's :doc:`Jenkins </jenkins/getting-started>` use a version of EUPS which only supports the now-deprecated mechanism.
205-
Therefore, in the interests of future proofing, both:
206-
207-
#. Add the line ``TAP_PACKAGE=1`` to the top of :file:`ups/eupspkg.cfg.sh`;
208-
#. Add an empty file, :file:`.tap_package`, to the root directory of your package.
241+
This is done by adding the line ``TAP_PACKAGE=1`` to the top of :file:`ups/eupspkg.cfg.sh`.
242+
(An older mechanism relied on a :file:`.tap_package` file in the package root directory, but this is deprecated.)
209243

210-
.. _version of EUPS: https://github.com/RobertLuptonTheGood/eups/blob/2.0.2/Release_Notes#L21
211244

212245
.. _third-party-testing:
213246

0 commit comments

Comments
 (0)