-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle package-specifier spacing (#197)
Use the spacing between package name and specifier. New: - Add `--verbose` option to update-deps. - Add `debug` input for CI - Check dependencies. Log sub-line input to update_file() in update_deps(). Update tests to include spacing issues. Add test for the --verbose flag. Add comments in test according to code review. Avoid `name3` in test since multiple version specifiers are not reliably supported. Follow issue #141 for updates. Explain change in `name2`. Co-authored-by: Anders Eklund <[email protected]>
- Loading branch information
Showing
5 changed files
with
149 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,11 @@ on: | |
required: false | ||
type: string | ||
default: "" | ||
debug: | ||
description: "Whether to run the workflow in debug mode, printing extra debug information." | ||
required: false | ||
type: boolean | ||
default: false | ||
secrets: | ||
PAT: | ||
description: "A personal access token (PAT) with rights to update the `permanent_dependencies_branch`. This will fallback on `GITHUB_TOKEN`." | ||
|
@@ -75,18 +80,36 @@ jobs: | |
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install -U pip | ||
pip install -U setuptools wheel | ||
pip install .${{ inputs.install_extras }} | ||
pip install git+https://github.com/SINTEF/[email protected] | ||
if [ "${{ inputs.debug }}" == "true" ]; then | ||
set -x | ||
VERBOSE=-vvv | ||
else | ||
VERBOSE= | ||
fi | ||
python -m pip install -U ${VERBOSE} pip | ||
pip install -U ${VERBOSE} setuptools wheel | ||
pip install ${VERBOSE} .${{ inputs.install_extras }} | ||
pip install ${VERBOSE} git+https://github.com/SINTEF/[email protected] | ||
- name: Set up git user | ||
run: | | ||
if [ "${{ inputs.debug }}" == "true" ]; then | ||
set -x | ||
fi | ||
git config --global user.name "${{ inputs.git_username }}" | ||
git config --global user.email "${{ inputs.git_email }}" | ||
- name: Run ci-cd task | ||
run: | | ||
if [ "${{ inputs.debug }}" == "true" ]; then | ||
set -x | ||
VERBOSE=--verbose | ||
else | ||
VERBOSE= | ||
fi | ||
if [ "${{ inputs.fail_fast }}" == "true" ]; then | ||
FAIL_FAST=--fail-fast | ||
else | ||
|
@@ -98,10 +121,15 @@ jobs: | |
if [ -n "${line}" ]; then IGNORE_OPTIONS+=(--ignore="${line}"); fi | ||
done <<< "${{ inputs.ignore }}" | ||
ci-cd update-deps ${FAIL_FAST} \ | ||
ci-cd update-deps ${FAIL_FAST} ${VERBOSE} \ | ||
--root-repo-path="${PWD}" \ | ||
--ignore-separator="..." \ | ||
"${IGNORE_OPTIONS[@]}" | ||
if [ "${{ inputs.debug }}" == "true" ]; then | ||
git status | ||
fi | ||
if [ -n "$(git status --porcelain pyproject.toml)" ]; then | ||
echo "UPDATE_DEPS=true" >> $GITHUB_ENV | ||
git add pyproject.toml | ||
|
@@ -113,6 +141,10 @@ jobs: | |
- name: Set PR body | ||
if: env.UPDATE_DEPS == 'true' | ||
run: | | ||
if [ "${{ inputs.debug }}" == "true" ]; then | ||
set -x | ||
fi | ||
if [ -z "${{ inputs.pr_body_file }}" ] || [ ! -f "${{ inputs.pr_body_file }}" ]; then | ||
PR_BODY_FILE=.tmp_pr-body_${{ github.run_id }}_${{ github.run_number }}_${{ github.run_attempt }}.txt | ||
echo "PR_BODY_FILE=${PR_BODY_FILE}" >> $GITHUB_ENV | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters