Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-44144: Make sconsUtils standalone/pip-installable #125

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

jobs:
build_and_test:
build_and_test_conda:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand Down Expand Up @@ -55,3 +55,44 @@ jobs:
uses: codecov/codecov-action@v2
with:
file: tests/.tests/pytest-sconsUtils.xml-cov-sconsUtils.xml
build_and_test_pip:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
pyversion: ["3.10", "3.11", "3.12"]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
# Need to clone everything for the git tags.
fetch-depth: 0

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge,defaults
miniforge-variant: Mambaforge
use-mamba: true
channel-priority: strict
show-channel-urls: true

- name: Install dependencies
shell: bash -l {0}
run: |
pip install -r requirements.txt

# We have two cores so we can speed up the testing with xdist
- name: Install pytest packages
shell: bash -l {0}
run: |
mamba install -y -q \
pytest pytest-xdist pytest-openfiles

- name: Build and install
run: |
python -m pip install --no-deps -v -e .

- name: Run tests
run: |
pytest -r a -v -n 3 --open-files
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,32 @@ config.log
_build.log
_build.sh
_build.tags

*.o
*.os
*.so
*.cfgc
*.pyc
pytest_session.txt

# Built by sconsUtils
bin/
bin/makeLinkFarm
bin/sconsOpts
python/lsst/sconsUtils/version.py

# Built by pip install
python/lsst_sconsUtils.egg-info/

# docs
doc/html
doc/doxygen.conf
doc/sconsUtils.tag

# Pytest
tests/.tests
tests/testFailedTests/python
tests/testFailedTests/tests/.tests
.coverage

# IDEs
.idea
.vscode
2 changes: 2 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright 2024 Association of Universities for Research in Astronomy, Inc. (AURA)
Copyright 2024 The Trustees of Princeton University
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This software is dual licensed under the GNU General Public License and also
under a 3-clause BSD license. Recipients may choose which of these licenses
to use; please see the files gpl-3.0.txt and/or bsd_license.txt, respectively.
35 changes: 0 additions & 35 deletions README

This file was deleted.

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# lsst-sconsUtils

[![codecov](https://codecov.io/gh/lsst/sconsUtils/branch/main/graph/badge.svg?token=2BUBL8R9RH)](https://codecov.io/gh/lsst/sconsUtils)

sconsUtils is a package in the [LSST Science Pipelines](https://pipelines.lsst.io/).

This package contains utility scripts for building pipelines packages with
[SCons](https://scons.org/), and is required to build most pipelines packages.
SCons can be used to build C++ and Python (with pybind11 bindings) packages;
see the [stack package templates](https://github.com/lsst/templates/tree/main/project_templates/stack_package)
if this is of interest.

This is a **Python 3 only** package (we assume Python 3.10 or higher).

This software is dual licensed under the GNU General Public License
(version 3 of the License, or (at your option) any later version,
and also under a 3-clause BSD license. Recipients may choose which of these
licenses to use; please see the files gpl-3.0.txt and/or bsd_license.txt,
respectively.

This package can only be imported through a SCons script; as a result, it is
generally not possible to inspect the docstrings interactively. Refer to the
locally-built documentation or at https://pipelines.lsst.io/, or read the
source code instead.
27 changes: 27 additions & 0 deletions bsd_license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
For copyright information see the COPYRIGHT file included in the top-level
directory of this distribution.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. Neither the names of the copyright holders nor the names of their
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4 changes: 3 additions & 1 deletion doc/lsst.sconsUtils/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Contributing
============

``lsst.sconsUtils`` is developed at https://github.com/lsst/sconsUtils.
You can find Jira issues for this module under the `sconsUtils <https://jira.lsstcorp.org/issues/?jql=project%20%3D%20DM%20AND%20component%20%3D%20sconsUtils>`_ component.
You can find Jira issues for this module under the `sconsUtils <https://rubinobs.atlassian.net/issues/?jql=project%20%3D%20DM%20AND%20component%20%3D%20sconsUtils>`_ component.

.. _lsst.sconsUtils-pyapi:

Expand All @@ -34,11 +34,13 @@ Python API reference
:no-inheritance-diagram:
.. automodapi:: lsst.sconsUtils.dependencies
:no-main-docstr:
:no-inheritance-diagram:
.. automodapi:: lsst.sconsUtils.tests
:no-main-docstr:
:no-inheritance-diagram:
.. automodapi:: lsst.sconsUtils.installation
:no-main-docstr:
:no-inheritance-diagram:
.. automodapi:: lsst.sconsUtils.builders
:no-main-docstr:
:no-inheritance-diagram:
Expand Down
Loading
Loading