From af60f98965b887a1836c00c275faccb7d414f798 Mon Sep 17 00:00:00 2001 From: Matthew Carbone Date: Fri, 29 Mar 2024 14:19:40 -0400 Subject: [PATCH] Modify scripts in scripts directory, remove unused scripts --- .github/workflows/ci-deploy.yml | 2 +- scripts/LICENSE | 29 -------------------------- scripts/README.md | 7 ------- scripts/{build_project.sh => build.sh} | 0 scripts/build_docs.sh | 25 ---------------------- scripts/install.sh | 20 ++++-------------- 6 files changed, 5 insertions(+), 78 deletions(-) delete mode 100644 scripts/LICENSE delete mode 100644 scripts/README.md rename scripts/{build_project.sh => build.sh} (100%) delete mode 100644 scripts/build_docs.sh diff --git a/.github/workflows/ci-deploy.yml b/.github/workflows/ci-deploy.yml index e10bb6b..14f09d0 100644 --- a/.github/workflows/ci-deploy.yml +++ b/.github/workflows/ci-deploy.yml @@ -39,7 +39,7 @@ jobs: python-version: 3.9 - name: Build and apply version - run: bash scripts/build_project.sh + run: bash scripts/build.sh - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/scripts/LICENSE b/scripts/LICENSE deleted file mode 100644 index deacfc5..0000000 --- a/scripts/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2022, Brookhaven Science Associates, LLC, Brookhaven National Laboratory -All rights reserved. - -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 name of the copyright holder nor the names of its 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 HOLDER 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. diff --git a/scripts/README.md b/scripts/README.md deleted file mode 100644 index 6f2bd92..0000000 --- a/scripts/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Scripts - -This directory contains helper scripts for GPax. - -- Build scripts for building the project -- Testing script for the notebook smoke tests -- `LICENSE` file, attributing code in this directory only to Brookhaven Science Associates (location from which the code was sourced) diff --git a/scripts/build_project.sh b/scripts/build.sh similarity index 100% rename from scripts/build_project.sh rename to scripts/build.sh diff --git a/scripts/build_docs.sh b/scripts/build_docs.sh deleted file mode 100644 index d42d820..0000000 --- a/scripts/build_docs.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -build_docs () { - - if [[ "${GITHUB_ACTION_IS_RUNNING}" = 1 ]]; then - bash scripts/install.sh doc - fi - - make -C docs/ html - - # Helper when running on local. If not running in a GitHub Actions - # environment, this will attempt to open index.html with the users' - # default program - if [[ -z "${GITHUB_ACTION_IS_RUNNING}" ]]; then - open docs/build/html/index.html - fi - -} - -pip install toml -bash scripts/install.sh -bash scripts/install.sh doc -bash scripts/update_version.sh set -build_docs -bash scripts/update_version.sh reset diff --git a/scripts/install.sh b/scripts/install.sh index bbd3224..6ca7894 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,22 +1,10 @@ #!/bin/bash -# Good stuff. The poor man's toml parser -# https://github.com/pypa/pip/issues/8049 -# This is the analog of pip install -e ".[...]" since for whatever reason -# it does not appear to work cleanly with pip - -install_test_requirements_only () { - python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["project"]["optional-dependencies"]["test"]))' | pip install -r /dev/stdin -} - -install_requirements() { - python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["project"]["dependencies"]))' | pip install -r /dev/stdin -} - - pip install toml + if [ "$1" = "test" ]; then - install_test_requirements_only + python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["project"]["optional-dependencies"]["test"]))' | pip install -r /dev/stdin + else - install_requirements + python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["project"]["dependencies"]))' | pip install -r /dev/stdin fi