From af6ef499ecbf725b052a78089162bbb1f44d347f Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 11:27:24 -0600 Subject: [PATCH 01/30] refactor(scripts): Moved to commons --- .github/workflows/always.yml | 20 ++++++++++++-------- .gitignore | 5 +++++ .gitlinks | 4 ++++ Dockerfile | 8 ++++---- package.json | 7 ++++--- pipelines/clean.yaml | 2 +- pipelines/qa.yaml | 10 +++++----- pipelines/style.yaml | 2 +- pipelines/test.yaml | 2 +- requirements.pipx.txt | 1 + scripts/bash/clean.ba.sh | 9 --------- scripts/gil/setup.ba.sh | 13 +++++++++++++ scripts/install.ba.sh | 6 +++--- scripts/pip/freeze.ba.sh | 10 ---------- scripts/pip/install.ba.sh | 27 --------------------------- scripts/pip/setup.ba.sh | 17 ----------------- scripts/pip/upgrade.ba.sh | 12 ------------ scripts/pipx/inject.ba.sh | 17 ----------------- scripts/pipx/install.ba.sh | 17 ----------------- scripts/pipx/setup.ba.sh | 11 ----------- scripts/poetry/plugin/add.ba.sh | 17 ----------------- scripts/setup.ba.sh | 8 +++++--- 22 files changed, 59 insertions(+), 166 deletions(-) create mode 100644 .gitlinks delete mode 100644 scripts/bash/clean.ba.sh create mode 100644 scripts/gil/setup.ba.sh delete mode 100644 scripts/pip/freeze.ba.sh delete mode 100644 scripts/pip/install.ba.sh delete mode 100644 scripts/pip/setup.ba.sh delete mode 100644 scripts/pip/upgrade.ba.sh delete mode 100644 scripts/pipx/inject.ba.sh delete mode 100644 scripts/pipx/install.ba.sh delete mode 100644 scripts/pipx/setup.ba.sh delete mode 100644 scripts/poetry/plugin/add.ba.sh diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index b6b0160..facceb9 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -22,6 +22,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: percebus/github-actions-common/.github/actions/checkout@main + with: + ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: setup python @ ${{ env.PYTHON_VERSION }} uses: actions/setup-python@v5 @@ -30,14 +32,14 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} # includes poetry install - - name: scripts/setup.ba.sh - run: bash scripts/setup.ba.sh + - name: _scripts/setup.ba.sh + run: bash _scripts/setup.ba.sh - name: poetry install run: poetry install - name: pypyr lock - run: pypyr lock freeze=True + run: pipx run -- pypyr lock freeze=True # TODO commit back upgraded requirements @@ -67,6 +69,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: percebus/github-actions-common/.github/actions/checkout@main + with: + ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: setup python @ ${{ env.PYTHON_VERSION }} uses: actions/setup-python@v5 @@ -74,16 +78,16 @@ jobs: architecture: ${{ env.ARCHITECTURE }} python-version: ${{ env.PYTHON_VERSION }} - name: pip install - run: bash scripts/install.ba.sh + run: bash _scripts/install.ba.sh - uses: percebus/github-actions-node/.github/actions/node_setup@main - uses: percebus/github-actions-npm/.github/actions/npm_install@main - name: pypyr lint - run: pypyr lint stats=True + run: pipx run -- pypyr lint stats=True - name: pypyr test - run: pypyr ci lint=False + run: pipx run -- pypyr ci lint=False - name: Publish test-results.xml Summary if: always() @@ -152,7 +156,7 @@ jobs: architecture: ${{ matrix.ARCHITECTURE }} python-version: ${{ matrix.PYTHON_VERSION }} - name: pip install - run: bash scripts/install.ba.sh + run: bash _scripts/install.ba.sh - uses: percebus/github-actions-node/.github/actions/node_setup@main - uses: percebus/github-actions-npm/.github/actions/npm_install@main @@ -161,7 +165,7 @@ jobs: # Because of EOL differences # Thus, we disabled 'npm' - name: pypyr test - run: pypyr ci npm=False + run: pipx run -- pypyr ci npm=False docker_compose: name: docker compose diff --git a/.gitignore b/.gitignore index af02fba..9d6105b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,11 @@ tmp/ test-results.xml +# commons/scripts +repos/ +_scripts/ + + ######################## ### Python.gitignore ### SRC: https://github.com/github/gitignore/blob/main/Python.gitignore ######################## diff --git a/.gitlinks b/.gitlinks new file mode 100644 index 0000000..ce117df --- /dev/null +++ b/.gitlinks @@ -0,0 +1,4 @@ +# SRC: https://github.com/chronoxor/gil?tab=readme-ov-file#root-gitlinks-file + +# commons/scripts +commons repos/commons git@github.com:percebus/commons.git main \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 45785ae..cf5db0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,16 +4,16 @@ FROM base AS project WORKDIR /usr/app COPY . . RUN ls -la -RUN bash scripts/bash/clean.ba.sh +RUN bash _scripts/bash/clean.ba.sh FROM project AS dev -RUN bash scripts/install.ba.sh +RUN bash _scripts/install.ba.sh FROM dev AS test -RUN pypyr ci npm=False stats=False +RUN pipx run -- pypyr ci npm=False stats=False # TODO use light image. alpine? FROM project AS release -RUN bash scripts/pip/install.ba.sh 'release' +RUN bash _scripts/pip/install.ba.sh 'release' CMD [ "python", "src/problems/" ] diff --git a/package.json b/package.json index b555b2f..c7dbc70 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,15 @@ "pip:upgrade:pip": "python -m pip install --upgrade pip", "prepip:upgrade:requirements": "npm run pip:upgrade:pip", "pip:upgrade:requirements": "python -m pip install --upgrade --requirement requirements.upgrade.txt", - "pipx:setup": "bash scripts/pipx/setup.ba.sh", + "prepipx:install": "npm run pip:upgrade:requirements", + "pipx:install": "bash _scripts/pipx/install.ba.sh", "flake8": "flake8 src --benchmark --statistics", "prettier": "prettier .", "prettier:check": "npm run prettier -- --check", "prettier:write": "npm run prettier -- --write", "pre-commit:install": "pre-commit install", "dockerlint": "dockerlint Dockerfile", - "setup": "npm run pip:upgrade:requirements && npm run pipx:setup && npm run pre-commit:install", + "setup": "npm run pipx:install && npm run pre-commit:install", "lint": "npm run dockerlint && npm run prettier:check", "style": "npm run prettier:write", "poststyle": "npm run lint", @@ -22,7 +23,7 @@ "docker:build:test": "npm run docker:build -- --target test", "predocker:build": "npm run dockerlint", "docker:compose:up": "docker compose up", - "test": "pypyr ci", + "test": "pipx run -- pypyr test", "test:docker": "npm run docker:build:test", "semantic-release": "semantic-release", "tag": "npm run semantic-release" diff --git a/pipelines/clean.yaml b/pipelines/clean.yaml index 18c23cb..21b889e 100644 --- a/pipelines/clean.yaml +++ b/pipelines/clean.yaml @@ -12,4 +12,4 @@ steps: pyclean: - name: pypyr.steps.shell in: - cmd: "pipx run pyclean ." + cmd: "pipx run -- pyclean ." diff --git a/pipelines/qa.yaml b/pipelines/qa.yaml index 0a98b94..84f13a0 100644 --- a/pipelines/qa.yaml +++ b/pipelines/qa.yaml @@ -20,24 +20,24 @@ steps: - name: pypyr.steps.shell run: "{clean}" in: - cmd: "pypyr clean path={path}" + cmd: "pipx run -- pypyr clean path={path}" - name: pypyr.steps.shell run: "{style}" in: - cmd: "pypyr style path={path} npm={npm} lint=False" + cmd: "pipx run -- pypyr style path={path} npm={npm} lint=False" - name: pypyr.steps.shell run: "{lint}" in: - cmd: "pypyr lint path={path} npm={npm} stats={stats}" + cmd: "pipx run -- pypyr lint path={path} npm={npm} stats={stats}" - name: pypyr.steps.shell run: "{test}" in: - cmd: "pypyr test path={path} lint=False stats={stats}" + cmd: "pipx run -- pypyr test path={path} lint=False stats={stats}" - name: pypyr.steps.shell run: "{integration}" in: - cmd: "pypyr test path={path} integration=True stats=False lint=False" + cmd: "pipx run -- pypyr test path={path} integration=True stats=False lint=False" diff --git a/pipelines/style.yaml b/pipelines/style.yaml index 78c78eb..8a63991 100644 --- a/pipelines/style.yaml +++ b/pipelines/style.yaml @@ -27,7 +27,7 @@ steps: - name: pypyr.steps.shell run: "{lint}" in: - cmd: "pypyr lint path={path} npm={npm} stats={stats}" + cmd: "pipx run -- pypyr lint path={path} npm={npm} stats={stats}" prettier: - name: pypyr.steps.echo diff --git a/pipelines/test.yaml b/pipelines/test.yaml index 07fa840..9bee72a 100644 --- a/pipelines/test.yaml +++ b/pipelines/test.yaml @@ -18,7 +18,7 @@ steps: - name: pypyr.steps.shell run: "{lint}" in: - cmd: "pypyr lint path={path} npm={npm} stats={stats}" + cmd: "pipx run -- pypyr lint path={path} npm={npm} stats={stats}" - name: pypyr.steps.call in: diff --git a/requirements.pipx.txt b/requirements.pipx.txt index 31c0fca..356d219 100644 --- a/requirements.pipx.txt +++ b/requirements.pipx.txt @@ -1,3 +1,4 @@ +gil>=1.25.0.0,<2.0.0.0 poetry>=2.0.0,<3.0.0 pre_commit>=4.0.1,<5.0.0 pyclean>=3.0.0,<4.0.0 diff --git a/scripts/bash/clean.ba.sh b/scripts/bash/clean.ba.sh deleted file mode 100644 index f3d5457..0000000 --- a/scripts/bash/clean.ba.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e -set -v - -find ./scripts -type f -exec sed -i 's/\r$//' {} \; - -set +v -set +e diff --git a/scripts/gil/setup.ba.sh b/scripts/gil/setup.ba.sh new file mode 100644 index 0000000..c1e62bc --- /dev/null +++ b/scripts/gil/setup.ba.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e +set -x + +python -m pip install --upgrade pip +python -m pip install pipx +python -m pipx install gil +gil clone +bash ./repos/commons/scripts/prepare.ba.sh + +set +x +set +e diff --git a/scripts/install.ba.sh b/scripts/install.ba.sh index 2926278..9008ce4 100644 --- a/scripts/install.ba.sh +++ b/scripts/install.ba.sh @@ -8,16 +8,16 @@ echo "target_config:'${target_config}'" scripts_path="$(dirname "$(readlink -f "$0")")" echo "Script directory: ${scripts_path}" -set -v +set -x # Upgrades top-level dependencies, like pipx bash ${scripts_path}/pip/upgrade.ba.sh # pipx installs CLI executables, like poetry -bash ${scripts_path}/pipx/setup.ba.sh +bash ${scripts_path}/pipx/install.ba.sh # pip installs dependencies bash ${scripts_path}/pip/install.ba.sh ${target_config} -set +v +set +x set +e diff --git a/scripts/pip/freeze.ba.sh b/scripts/pip/freeze.ba.sh deleted file mode 100644 index d602a9a..0000000 --- a/scripts/pip/freeze.ba.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -e -set -v - -# Backup pip-installed dependencies -python -m pip freeze --verbose > requirements.frozen.txt - -set +v -set +e diff --git a/scripts/pip/install.ba.sh b/scripts/pip/install.ba.sh deleted file mode 100644 index 5fd6aa8..0000000 --- a/scripts/pip/install.ba.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -e - -target_config=$1 -echo "target_config:'${target_config}'" - -PIP_CLI_OPTS="" -requirements="requirements.txt" -if [[ "$target_config" == "release" ]]; then - echo "Installing ONLY prd requirements..." - requirements="requirements.release.txt" -else - PIP_CLI_OPTS="-e" - echo "Installing everything..." -fi - -set -x - -# all pip dependencies (generated w/ poetry) -python -m pip install --verbose --requirement ${requirements} - -# The project itself (to use src) -python -m pip install --verbose ${PIP_CLI_OPTS} . - -set +x -set +e diff --git a/scripts/pip/setup.ba.sh b/scripts/pip/setup.ba.sh deleted file mode 100644 index b574f6c..0000000 --- a/scripts/pip/setup.ba.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -target_config=$1 -echo "target_config:'${target_config}'" - -parent_folder="$(dirname "$(readlink -f "$0")")" - -set -x - -bash ${parent_folder}/upgrade.ba.sh -bash ${parent_folder}/install.ba.sh ${target_config} -# bash ${parent_folder}/freeze.ba.sh # TODO? - -set +x -set +e diff --git a/scripts/pip/upgrade.ba.sh b/scripts/pip/upgrade.ba.sh deleted file mode 100644 index 312aa4c..0000000 --- a/scripts/pip/upgrade.ba.sh +++ /dev/null @@ -1,12 +0,0 @@ - -set -e -set -v - -# pip upgrades pip -python -m pip install --verbose --upgrade pip - -# pip upgrades pipx -python -m pip install --verbose --upgrade --requirement requirements.upgrade.txt - -set +v -set +e diff --git a/scripts/pipx/inject.ba.sh b/scripts/pipx/inject.ba.sh deleted file mode 100644 index d283a51..0000000 --- a/scripts/pipx/inject.ba.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -filename="requirements.pipx_inject.txt" -if [[ -z $(grep '[^[:space:]]' $filename) ]]; then - echo "${filename} is empty, skipping..." - exit 0 -fi - -set -v - -# pipx inject --requirement requirements.pipx_inject.txt # FIXME -cat ${filename} | sed 's/.*/"&"/' | xargs -n 1 pipx inject - -set +v -set +e diff --git a/scripts/pipx/install.ba.sh b/scripts/pipx/install.ba.sh deleted file mode 100644 index 142dff0..0000000 --- a/scripts/pipx/install.ba.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -filename="requirements.pipx.txt" -if [[ -z $(grep '[^[:space:]]' $filename) ]]; then - echo "${filename} is empty, skipping..." - exit 0 -fi - -set -v - -cat ${filename} | sed 's/.*/"&"/' | xargs -n 1 pipx install -pipx list - -set +v -set +e diff --git a/scripts/pipx/setup.ba.sh b/scripts/pipx/setup.ba.sh deleted file mode 100644 index d47aa4d..0000000 --- a/scripts/pipx/setup.ba.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e -set -v - -parent_folder="$(dirname "$(readlink -f "$0")")" -bash ${parent_folder}/install.ba.sh -bash ${parent_folder}/inject.ba.sh - -set +v -set +e diff --git a/scripts/poetry/plugin/add.ba.sh b/scripts/poetry/plugin/add.ba.sh deleted file mode 100644 index de6bce2..0000000 --- a/scripts/poetry/plugin/add.ba.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -filename="requirements.poetry-plugin.txt" -if [[ -z $(grep '[^[:space:]]' $filename) ]]; then - echo "${filename} is empty, skipping..." - exit 0 -fi - -set -v - -cat ${filename} | sed 's/.*/"&"/' | xargs -n 1 poetry self add -poetry self show plugins - -set +v -set +e diff --git a/scripts/setup.ba.sh b/scripts/setup.ba.sh index e15566b..88efbf6 100644 --- a/scripts/setup.ba.sh +++ b/scripts/setup.ba.sh @@ -5,16 +5,18 @@ set -e scripts_path="$(dirname "$(readlink -f "$0")")" echo "Script directory: ${scripts_path}" -set -v +set -x # Upgrades top-level dependencies, like pipx bash ${scripts_path}/pip/upgrade.ba.sh # pipx installs CLI executables, like poetry -bash ${scripts_path}/pipx/setup.ba.sh +bash ${scripts_path}/pipx/install.ba.sh # poetry has its own plugins bash ${scripts_path}/poetry/plugin/add.ba.sh -set +v +poetry install + +set +x set +e From e0c39ddd848f7df237aac9513dae2b237850ed06 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 11:41:19 -0600 Subject: [PATCH 02/30] WiP --- .github/workflows/always.yml | 25 +++++++++++++++++++++---- requirements.frozen.txt | 6 +++++- requirements.poetry.dev.txt | 2 +- scripts/gil/setup.ba.sh | 2 +- scripts/prepare.ba.sh | 16 ++++++++++++++++ 5 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 scripts/prepare.ba.sh diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index facceb9..d225121 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -77,12 +77,16 @@ jobs: with: architecture: ${{ env.ARCHITECTURE }} python-version: ${{ env.PYTHON_VERSION }} - - name: pip install - run: bash _scripts/install.ba.sh - uses: percebus/github-actions-node/.github/actions/node_setup@main - uses: percebus/github-actions-npm/.github/actions/npm_install@main + - name: scripts/prepare.ba.sh + run: bash scripts/prepare.ba.sh + + - name: pypyr lint + run: pipx run -- pypyr lint stats=True + - name: pypyr lint run: pipx run -- pypyr lint stats=True @@ -149,18 +153,21 @@ jobs: # echo "JOB_NAME: ${{ env.JOB_NAME }}" - uses: percebus/github-actions-common/.github/actions/checkout@main + with: + ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: setup python @ ${{ matrix.PYTHON_VERSION }} uses: actions/setup-python@v5 with: architecture: ${{ matrix.ARCHITECTURE }} python-version: ${{ matrix.PYTHON_VERSION }} - - name: pip install - run: bash _scripts/install.ba.sh - uses: percebus/github-actions-node/.github/actions/node_setup@main - uses: percebus/github-actions-npm/.github/actions/npm_install@main + - name: scripts/prepare.ba.sh + run: bash scripts/prepare.ba.sh + # FIXME prettier fails on windows # Because of EOL differences # Thus, we disabled 'npm' @@ -173,6 +180,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: percebus/github-actions-common/.github/actions/checkout@main + with: + ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} + + - name: scripts/prepare.ba.sh + run: bash scripts/prepare.ba.sh - name: docker compose up run: docker compose up --abort-on-container-exit @@ -197,6 +209,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: percebus/github-actions-common/.github/actions/checkout@main + with: + ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} + + - name: scripts/prepare.ba.sh + run: bash scripts/prepare.ba.sh - name: "docker build: ${{ matrix.DOCKER_TARGET }}" run: | diff --git a/requirements.frozen.txt b/requirements.frozen.txt index f9c4493..eda7709 100644 --- a/requirements.frozen.txt +++ b/requirements.frozen.txt @@ -1,6 +1,8 @@ --e git+ssh://git@github.com/percebus/algorithmic-excercises.git@3f82693d17d27e8f8146ea5b2f650b350f2b971e#egg=algorithmic_excercises +-e git+ssh://git@github.com/percebus/algorithmic-excercises.git@af6ef499ecbf725b052a78089162bbb1f44d347f#egg=algorithmic_excercises annotated-types==0.7.0 +argcomplete==3.5.3 astroid==3.3.8 +click==8.1.8 colorama==0.4.6 coverage==7.6.10 dill==0.3.9 @@ -23,6 +25,7 @@ pandas==2.2.2 pandas-stubs==2.2.3.241009 parse==1.20.2 parse_type==0.6.3 +pipx==1.7.1 platformdirs==4.3.6 pluggy==1.5.0 pycodestyle==2.12.1 @@ -47,3 +50,4 @@ tomlkit==0.13.2 types-pytz==2024.2.0.20241003 typing_extensions==4.12.2 tzdata==2024.1 +userpath==1.9.2 diff --git a/requirements.poetry.dev.txt b/requirements.poetry.dev.txt index ac48312..3fcb701 100644 --- a/requirements.poetry.dev.txt +++ b/requirements.poetry.dev.txt @@ -1,7 +1,7 @@ colorama==0.4.6 ; python_version >= "3.12" and python_full_version < "4.0.0" and sys_platform == "win32" \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 -coverage[toml]==7.6.10 ; python_version >= "3.12" and python_full_version < "4.0.0" \ +coverage==7.6.10 ; python_version >= "3.12" and python_full_version < "4.0.0" \ --hash=sha256:05fca8ba6a87aabdd2d30d0b6c838b50510b56cdcfc604d40760dae7153b73d9 \ --hash=sha256:0aa9692b4fdd83a4647eeb7db46410ea1322b5ed94cd1715ef09d1d5922ba87f \ --hash=sha256:0c807ca74d5a5e64427c8805de15b9ca140bba13572d6d74e262f46f50b13273 \ diff --git a/scripts/gil/setup.ba.sh b/scripts/gil/setup.ba.sh index c1e62bc..09f499b 100644 --- a/scripts/gil/setup.ba.sh +++ b/scripts/gil/setup.ba.sh @@ -7,7 +7,7 @@ python -m pip install --upgrade pip python -m pip install pipx python -m pipx install gil gil clone -bash ./repos/commons/scripts/prepare.ba.sh + set +x set +e diff --git a/scripts/prepare.ba.sh b/scripts/prepare.ba.sh new file mode 100644 index 0000000..c615c63 --- /dev/null +++ b/scripts/prepare.ba.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +scripts_path="$(dirname "$(readlink -f "$0")")" +echo "Script directory: ${scripts_path}" + +set -x + +# Upgrades top-level dependencies, like pipx +bash ${scripts_path}/gil/setup.ba.sh + +bash ./repos/commons/scripts/prepare.ba.sh + +set +x +set +e From 1050d14a79f8ca2fb1699f3aef68367b51dd6294 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 11:42:12 -0600 Subject: [PATCH 03/30] Update always.yml --- .github/workflows/always.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index d225121..f65da1f 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -32,11 +32,8 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} # includes poetry install - - name: _scripts/setup.ba.sh - run: bash _scripts/setup.ba.sh - - - name: poetry install - run: poetry install + - name: _scripts/prepare.ba.sh + run: bash _scripts/prepare.ba.sh - name: pypyr lock run: pipx run -- pypyr lock freeze=True From 08fab8eca68409726a6861bf68b2fdfb7f5d20c0 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 11:43:12 -0600 Subject: [PATCH 04/30] Update always.yml --- .github/workflows/always.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index f65da1f..059cdf2 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -32,8 +32,8 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} # includes poetry install - - name: _scripts/prepare.ba.sh - run: bash _scripts/prepare.ba.sh + - name: scripts/prepare.ba.sh + run: bash scripts/prepare.ba.sh - name: pypyr lock run: pipx run -- pypyr lock freeze=True From d716bb933c7c7fa9d4bd3e46f36155b623690d79 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 11:43:53 -0600 Subject: [PATCH 05/30] Update always.yml --- .github/workflows/always.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index 059cdf2..b77b713 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: percebus/github-actions-common/.github/actions/checkout@main with: - ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} + ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: setup python @ ${{ env.PYTHON_VERSION }} uses: actions/setup-python@v5 @@ -67,7 +67,7 @@ jobs: steps: - uses: percebus/github-actions-common/.github/actions/checkout@main with: - ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} + ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: setup python @ ${{ env.PYTHON_VERSION }} uses: actions/setup-python@v5 @@ -151,7 +151,7 @@ jobs: - uses: percebus/github-actions-common/.github/actions/checkout@main with: - ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} + ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: setup python @ ${{ matrix.PYTHON_VERSION }} uses: actions/setup-python@v5 @@ -178,7 +178,7 @@ jobs: steps: - uses: percebus/github-actions-common/.github/actions/checkout@main with: - ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} + ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: scripts/prepare.ba.sh run: bash scripts/prepare.ba.sh @@ -207,7 +207,7 @@ jobs: steps: - uses: percebus/github-actions-common/.github/actions/checkout@main with: - ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} + ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: scripts/prepare.ba.sh run: bash scripts/prepare.ba.sh From 2c49a5bd63055e4c304aab51d0cd783bec121690 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 11:48:47 -0600 Subject: [PATCH 06/30] Update setup.ba.sh --- scripts/gil/setup.ba.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gil/setup.ba.sh b/scripts/gil/setup.ba.sh index 09f499b..22ad4f9 100644 --- a/scripts/gil/setup.ba.sh +++ b/scripts/gil/setup.ba.sh @@ -6,7 +6,7 @@ set -x python -m pip install --upgrade pip python -m pip install pipx python -m pipx install gil -gil clone +pipx run -- gil clone set +x From a40b7e0d0f48b4cba8de172c1686633280eb4d16 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 12:08:35 -0600 Subject: [PATCH 07/30] Update .gitlinks --- .gitlinks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlinks b/.gitlinks index ce117df..48cb0da 100644 --- a/.gitlinks +++ b/.gitlinks @@ -1,4 +1,4 @@ # SRC: https://github.com/chronoxor/gil?tab=readme-ov-file#root-gitlinks-file # commons/scripts -commons repos/commons git@github.com:percebus/commons.git main \ No newline at end of file +commons repos/commons https://github.com/percebus/commons.git main \ No newline at end of file From 292691d467da1942d2269751f7586d03a50e1626 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 12:09:58 -0600 Subject: [PATCH 08/30] Update lock.yaml --- pipelines/lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/lock.yaml b/pipelines/lock.yaml index 291d0e0..1fa8e46 100644 --- a/pipelines/lock.yaml +++ b/pipelines/lock.yaml @@ -41,4 +41,4 @@ pip_freeze: - name: pypyr.steps.shell run: "{freeze}" in: - cmd: bash scripts/pip/freeze.ba.sh + cmd: bash _scripts/pip/freeze.ba.sh From 616d5e42699b0aa6f19804b3f1ac248fbe0aa55a Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 12:37:12 -0600 Subject: [PATCH 09/30] f --- pipelines/clean.yaml | 4 ++-- pipelines/lint.yaml | 34 +++++++++++++++++----------------- pipelines/lock.yaml | 4 ++-- pipelines/qa.yaml | 22 +++++++++++----------- pipelines/style.yaml | 22 +++++++++++----------- pipelines/test.yaml | 22 +++++++++++----------- 6 files changed, 54 insertions(+), 54 deletions(-) diff --git a/pipelines/clean.yaml b/pipelines/clean.yaml index 21b889e..3188ba9 100644 --- a/pipelines/clean.yaml +++ b/pipelines/clean.yaml @@ -2,7 +2,7 @@ context_parser: pypyr.parser.keyvaluepairs steps: - name: pypyr.steps.echo in: - echoMe: "= pypyr clean ==================================================" + echoMe: = pypyr clean ================================================== - name: pypyr.steps.call in: @@ -12,4 +12,4 @@ steps: pyclean: - name: pypyr.steps.shell in: - cmd: "pipx run -- pyclean ." + cmd: pipx run -- pyclean . diff --git a/pipelines/lint.yaml b/pipelines/lint.yaml index d3a36dc..f11fd67 100644 --- a/pipelines/lint.yaml +++ b/pipelines/lint.yaml @@ -2,7 +2,7 @@ context_parser: pypyr.parser.keyvaluepairs steps: - name: pypyr.steps.echo in: - echoMe: "= pypyr lint ================================================" + echoMe: = pypyr lint ================================================ - name: pypyr.steps.default comment: set default values for optional cli inputs in: @@ -10,16 +10,16 @@ steps: npm: True path: . stats: False - PYLINT_CLI_ARGS: "" + PYLINT_CLI_ARGS: - name: pypyr.steps.set - run: "{stats}" + run: {stats} in: set: - PYLINT_CLI_ARGS: "--report y" + PYLINT_CLI_ARGS: --report y - name: pypyr.steps.call - run: "{npm}" + run: {npm} in: call: - dockerlint @@ -36,47 +36,47 @@ steps: dockerlint: - name: pypyr.steps.echo in: - echoMe: "=== dockerlint ==============================================" + echoMe: === dockerlint ============================================== - name: pypyr.steps.shell in: - cmd: "npm run dockerlint" + cmd: npm run dockerlint prettier: - name: pypyr.steps.echo in: - echoMe: "=== npx prettier --check ====================================" + echoMe: === npx prettier --check ==================================== - name: pypyr.steps.shell in: - cmd: "npx prettier {path} --check" + cmd: npx prettier {path} --check ruff: - name: pypyr.steps.echo in: - echoMe: "=== ruff check ==============================================" + echoMe: === ruff check ============================================== - name: pypyr.steps.shell in: - cmd: ruff check {path} + cmd: poetry run -- ruff check {path} pyright: - name: pypyr.steps.echo in: - echoMe: "=== pyright =================================================" + echoMe: === pyright ================================================= - name: pypyr.steps.shell in: - cmd: pyright --warnings + cmd: poetry run -- pyright --warnings mypy: - name: pypyr.steps.echo in: - echoMe: "=== mypy ===================================================" + echoMe: === mypy =================================================== - name: pypyr.steps.shell in: - cmd: mypy src + cmd: poetry run -- mypy src pylint: - name: pypyr.steps.echo in: - echoMe: "=== pylint ==================================================" + echoMe: === pylint ================================================== - name: pypyr.steps.shell in: - cmd: "pylint {PYLINT_CLI_ARGS} src" + cmd: poetry run -- pylint {PYLINT_CLI_ARGS} src diff --git a/pipelines/lock.yaml b/pipelines/lock.yaml index 1fa8e46..838e603 100644 --- a/pipelines/lock.yaml +++ b/pipelines/lock.yaml @@ -27,7 +27,7 @@ poetry_lock: poetry_export: - name: pypyr.steps.echo in: - echoMe: "= poetry export requirements(cli|dev|main).txt ============" + echoMe: = poetry export requirements(cli|dev|main).txt ============ - name: pypyr.steps.shell foreach: ["cli", "main", "dev"] in: @@ -37,7 +37,7 @@ pip_freeze: - name: pypyr.steps.echo run: "{freeze}" in: - echoMe: "= pip freeze ==============================================" + echoMe: = pip freeze ============================================== - name: pypyr.steps.shell run: "{freeze}" in: diff --git a/pipelines/qa.yaml b/pipelines/qa.yaml index 84f13a0..c932b55 100644 --- a/pipelines/qa.yaml +++ b/pipelines/qa.yaml @@ -3,7 +3,7 @@ context_parser: pypyr.parser.keyvaluepairs steps: - name: pypyr.steps.echo in: - echoMe: "= pypyr qa ===================================================" + echoMe: = pypyr qa =================================================== - name: pypyr.steps.default comment: set default values for optional cli inputs in: @@ -18,26 +18,26 @@ steps: stats: True - name: pypyr.steps.shell - run: "{clean}" + run: {clean} in: - cmd: "pipx run -- pypyr clean path={path}" + cmd: pipx run -- pypyr clean path={path} - name: pypyr.steps.shell - run: "{style}" + run: {style} in: - cmd: "pipx run -- pypyr style path={path} npm={npm} lint=False" + cmd: pipx run -- pypyr style path={path} npm={npm} lint=False - name: pypyr.steps.shell - run: "{lint}" + run: {lint} in: - cmd: "pipx run -- pypyr lint path={path} npm={npm} stats={stats}" + cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} - name: pypyr.steps.shell - run: "{test}" + run: {test} in: - cmd: "pipx run -- pypyr test path={path} lint=False stats={stats}" + cmd: pipx run -- pypyr test path={path} lint=False stats={stats} - name: pypyr.steps.shell - run: "{integration}" + run: {integration} in: - cmd: "pipx run -- pypyr test path={path} integration=True stats=False lint=False" + cmd: pipx run -- pypyr test path={path} integration=True stats=False lint=False diff --git a/pipelines/style.yaml b/pipelines/style.yaml index 8a63991..e7505b0 100644 --- a/pipelines/style.yaml +++ b/pipelines/style.yaml @@ -2,7 +2,7 @@ context_parser: pypyr.parser.keyvaluepairs steps: - name: pypyr.steps.echo in: - echoMe: "= pypyr style =================================================" + echoMe: = pypyr style ================================================= - name: pypyr.steps.default comment: set default values for optional cli inputs in: @@ -13,7 +13,7 @@ steps: stats: False - name: pypyr.steps.call - run: "{npm}" + run: {npm} in: call: - prettier @@ -25,22 +25,22 @@ steps: - ruff - name: pypyr.steps.shell - run: "{lint}" + run: {lint} in: - cmd: "pipx run -- pypyr lint path={path} npm={npm} stats={stats}" + cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} prettier: - name: pypyr.steps.echo in: - echoMe: "=== npx prettier --write ======================================" + echoMe: === npx prettier --write ====================================== - name: pypyr.steps.shell in: - cmd: "npx prettier {path} --write" + cmd: npx prettier {path} --write poetry_sort: - name: pypyr.steps.echo in: - echoMe: "=== poetry sort ========================================" + echoMe: === poetry sort ======================================== - name: pypyr.steps.shell in: cmd: poetry sort @@ -48,14 +48,14 @@ poetry_sort: ruff: - name: pypyr.steps.echo in: - echoMe: "=== ruff check --fix =========================================" + echoMe: === ruff check --fix ========================================= - name: pypyr.steps.shell in: - cmd: ruff check --fix {path} + cmd: poetry run -- ruff check --fix {path} - name: pypyr.steps.echo in: - echoMe: "=== ruff format --fix ========================================" + echoMe: === ruff format --fix ======================================== - name: pypyr.steps.shell in: - cmd: ruff format {path} + cmd: poetry run -- ruff format {path} diff --git a/pipelines/test.yaml b/pipelines/test.yaml index 9bee72a..5e6b1bb 100644 --- a/pipelines/test.yaml +++ b/pipelines/test.yaml @@ -2,7 +2,7 @@ context_parser: pypyr.parser.keyvaluepairs steps: - name: pypyr.steps.echo in: - echoMe: "= pypyr test ================================================" + echoMe: = pypyr test ================================================ - name: pypyr.steps.default comment: set default values for optional cli inputs in: @@ -12,13 +12,13 @@ steps: lint: True stats: False integration: False - markers: "not integration" - PYTEST_CLI_ARGS: "" + markers: not integration + PYTEST_CLI_ARGS: - name: pypyr.steps.shell - run: "{lint}" + run: {lint} in: - cmd: "pipx run -- pypyr lint path={path} npm={npm} stats={stats}" + cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} - name: pypyr.steps.call in: @@ -26,20 +26,20 @@ steps: pytest: - name: pypyr.steps.set - run: "{stats}" + run: {stats} in: set: - PYTEST_CLI_ARGS: "--cov --cov-report=term-missing" + PYTEST_CLI_ARGS: --cov --cov-report=term-missing - name: pypyr.steps.set - run: "{integration}" + run: {integration} in: set: - markers: "integration" + markers: integration - name: pypyr.steps.echo in: - echoMe: "=== pytest:{markers} =======================================" + echoMe: === pytest:{markers} ======================================= - name: pypyr.steps.shell in: - cmd: pytest {PYTEST_CLI_ARGS} -m "{markers}" --junit-xml=test-results.xml + cmd: poetry run -- pytest {PYTEST_CLI_ARGS} -m {markers} --junit-xml=test-results.xml From 18381fa1cb4e9726334c5d1b854952300bc1f94b Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 12:39:41 -0600 Subject: [PATCH 10/30] rf --- pipelines/lint.yaml | 4 ++-- pipelines/qa.yaml | 10 +++++----- pipelines/style.yaml | 4 ++-- pipelines/test.yaml | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pipelines/lint.yaml b/pipelines/lint.yaml index f11fd67..8fe0ea7 100644 --- a/pipelines/lint.yaml +++ b/pipelines/lint.yaml @@ -13,13 +13,13 @@ steps: PYLINT_CLI_ARGS: - name: pypyr.steps.set - run: {stats} + run: { stats } in: set: PYLINT_CLI_ARGS: --report y - name: pypyr.steps.call - run: {npm} + run: { npm } in: call: - dockerlint diff --git a/pipelines/qa.yaml b/pipelines/qa.yaml index c932b55..482e9ae 100644 --- a/pipelines/qa.yaml +++ b/pipelines/qa.yaml @@ -18,26 +18,26 @@ steps: stats: True - name: pypyr.steps.shell - run: {clean} + run: { clean } in: cmd: pipx run -- pypyr clean path={path} - name: pypyr.steps.shell - run: {style} + run: { style } in: cmd: pipx run -- pypyr style path={path} npm={npm} lint=False - name: pypyr.steps.shell - run: {lint} + run: { lint } in: cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} - name: pypyr.steps.shell - run: {test} + run: { test } in: cmd: pipx run -- pypyr test path={path} lint=False stats={stats} - name: pypyr.steps.shell - run: {integration} + run: { integration } in: cmd: pipx run -- pypyr test path={path} integration=True stats=False lint=False diff --git a/pipelines/style.yaml b/pipelines/style.yaml index e7505b0..f245241 100644 --- a/pipelines/style.yaml +++ b/pipelines/style.yaml @@ -13,7 +13,7 @@ steps: stats: False - name: pypyr.steps.call - run: {npm} + run: { npm } in: call: - prettier @@ -25,7 +25,7 @@ steps: - ruff - name: pypyr.steps.shell - run: {lint} + run: { lint } in: cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} diff --git a/pipelines/test.yaml b/pipelines/test.yaml index 5e6b1bb..a537ef8 100644 --- a/pipelines/test.yaml +++ b/pipelines/test.yaml @@ -16,7 +16,7 @@ steps: PYTEST_CLI_ARGS: - name: pypyr.steps.shell - run: {lint} + run: { lint } in: cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} @@ -26,13 +26,13 @@ steps: pytest: - name: pypyr.steps.set - run: {stats} + run: { stats } in: set: PYTEST_CLI_ARGS: --cov --cov-report=term-missing - name: pypyr.steps.set - run: {integration} + run: { integration } in: set: markers: integration From e2451ef45b134f0eb8671d757d06f9257385fb75 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 12:49:26 -0600 Subject: [PATCH 11/30] fix(pipelines): pypyr run needs quotes --- .github/workflows/always.yml | 3 --- pipelines/lint.yaml | 4 ++-- pipelines/lock.yaml | 4 ++-- pipelines/qa.yaml | 10 +++++----- pipelines/style.yaml | 4 ++-- pipelines/test.yaml | 6 +++--- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index b77b713..f41f92b 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -84,9 +84,6 @@ jobs: - name: pypyr lint run: pipx run -- pypyr lint stats=True - - name: pypyr lint - run: pipx run -- pypyr lint stats=True - - name: pypyr test run: pipx run -- pypyr ci lint=False diff --git a/pipelines/lint.yaml b/pipelines/lint.yaml index 8fe0ea7..c3d612e 100644 --- a/pipelines/lint.yaml +++ b/pipelines/lint.yaml @@ -13,13 +13,13 @@ steps: PYLINT_CLI_ARGS: - name: pypyr.steps.set - run: { stats } + run: "{stats}" in: set: PYLINT_CLI_ARGS: --report y - name: pypyr.steps.call - run: { npm } + run: "{npm}" in: call: - dockerlint diff --git a/pipelines/lock.yaml b/pipelines/lock.yaml index 838e603..8f657e9 100644 --- a/pipelines/lock.yaml +++ b/pipelines/lock.yaml @@ -2,7 +2,7 @@ context_parser: pypyr.parser.keyvaluepairs steps: - name: pypyr.steps.echo in: - echoMe: "= pypyr lock ===============================================" + echoMe: = pypyr lock =============================================== - name: pypyr.steps.default comment: set default values for optional cli inputs in: @@ -19,7 +19,7 @@ steps: poetry_lock: - name: pypyr.steps.echo in: - echoMe: "= poetry lock =============================================" + echoMe: = poetry lock ==============================================" - name: pypyr.steps.shell in: cmd: poetry lock diff --git a/pipelines/qa.yaml b/pipelines/qa.yaml index 482e9ae..4a70481 100644 --- a/pipelines/qa.yaml +++ b/pipelines/qa.yaml @@ -18,26 +18,26 @@ steps: stats: True - name: pypyr.steps.shell - run: { clean } + run: "{clean}" in: cmd: pipx run -- pypyr clean path={path} - name: pypyr.steps.shell - run: { style } + run: "{style}" in: cmd: pipx run -- pypyr style path={path} npm={npm} lint=False - name: pypyr.steps.shell - run: { lint } + run: "{lint}" in: cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} - name: pypyr.steps.shell - run: { test } + run: "{test}" in: cmd: pipx run -- pypyr test path={path} lint=False stats={stats} - name: pypyr.steps.shell - run: { integration } + run: "{integration}" in: cmd: pipx run -- pypyr test path={path} integration=True stats=False lint=False diff --git a/pipelines/style.yaml b/pipelines/style.yaml index f245241..8ae7e0b 100644 --- a/pipelines/style.yaml +++ b/pipelines/style.yaml @@ -13,7 +13,7 @@ steps: stats: False - name: pypyr.steps.call - run: { npm } + run: "{npm}" in: call: - prettier @@ -25,7 +25,7 @@ steps: - ruff - name: pypyr.steps.shell - run: { lint } + run: "{lint}" in: cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} diff --git a/pipelines/test.yaml b/pipelines/test.yaml index a537ef8..768bd01 100644 --- a/pipelines/test.yaml +++ b/pipelines/test.yaml @@ -16,7 +16,7 @@ steps: PYTEST_CLI_ARGS: - name: pypyr.steps.shell - run: { lint } + run: "{lint}" in: cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} @@ -26,13 +26,13 @@ steps: pytest: - name: pypyr.steps.set - run: { stats } + run: "{stats}" in: set: PYTEST_CLI_ARGS: --cov --cov-report=term-missing - name: pypyr.steps.set - run: { integration } + run: "{integration}" in: set: markers: integration From 58f43c49e04e6d08f225e0c0f9a9d4dc709f0258 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 12:57:03 -0600 Subject: [PATCH 12/30] qb --- pipelines/lint.yaml | 6 +++--- pipelines/lock.yaml | 2 +- pipelines/qa.yaml | 10 +++++----- pipelines/style.yaml | 8 ++++---- pipelines/test.yaml | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pipelines/lint.yaml b/pipelines/lint.yaml index c3d612e..a0f0a86 100644 --- a/pipelines/lint.yaml +++ b/pipelines/lint.yaml @@ -47,7 +47,7 @@ prettier: echoMe: === npx prettier --check ==================================== - name: pypyr.steps.shell in: - cmd: npx prettier {path} --check + cmd: "npx prettier {path} --check" ruff: - name: pypyr.steps.echo @@ -55,7 +55,7 @@ ruff: echoMe: === ruff check ============================================== - name: pypyr.steps.shell in: - cmd: poetry run -- ruff check {path} + cmd: "poetry run -- ruff check {path}" pyright: - name: pypyr.steps.echo @@ -79,4 +79,4 @@ pylint: echoMe: === pylint ================================================== - name: pypyr.steps.shell in: - cmd: poetry run -- pylint {PYLINT_CLI_ARGS} src + cmd: "poetry run -- pylint {PYLINT_CLI_ARGS} src" diff --git a/pipelines/lock.yaml b/pipelines/lock.yaml index 8f657e9..7fcf37b 100644 --- a/pipelines/lock.yaml +++ b/pipelines/lock.yaml @@ -31,7 +31,7 @@ poetry_export: - name: pypyr.steps.shell foreach: ["cli", "main", "dev"] in: - cmd: poetry export --no-interaction --format requirements.txt --output requirements.poetry.{i}.txt --only {i} + cmd: "poetry export --no-interaction --format requirements.txt --output requirements.poetry.{i}.txt --only {i}" pip_freeze: - name: pypyr.steps.echo diff --git a/pipelines/qa.yaml b/pipelines/qa.yaml index 4a70481..6b4d0f2 100644 --- a/pipelines/qa.yaml +++ b/pipelines/qa.yaml @@ -20,24 +20,24 @@ steps: - name: pypyr.steps.shell run: "{clean}" in: - cmd: pipx run -- pypyr clean path={path} + cmd: "pipx run -- pypyr clean path={path}" - name: pypyr.steps.shell run: "{style}" in: - cmd: pipx run -- pypyr style path={path} npm={npm} lint=False + cmd: "pipx run -- pypyr style path={path} npm={npm} lint=False" - name: pypyr.steps.shell run: "{lint}" in: - cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} + cmd: "pipx run -- pypyr lint path={path} npm={npm} stats={stats}" - name: pypyr.steps.shell run: "{test}" in: - cmd: pipx run -- pypyr test path={path} lint=False stats={stats} + cmd: "pipx run -- pypyr test path={path} lint=False stats={stats}" - name: pypyr.steps.shell run: "{integration}" in: - cmd: pipx run -- pypyr test path={path} integration=True stats=False lint=False + cmd: "pipx run -- pypyr test path={path} integration=True stats=False lint=False" diff --git a/pipelines/style.yaml b/pipelines/style.yaml index 8ae7e0b..e9499f3 100644 --- a/pipelines/style.yaml +++ b/pipelines/style.yaml @@ -27,7 +27,7 @@ steps: - name: pypyr.steps.shell run: "{lint}" in: - cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} + cmd: "pipx run -- pypyr lint path={path} npm={npm} stats={stats}" prettier: - name: pypyr.steps.echo @@ -35,7 +35,7 @@ prettier: echoMe: === npx prettier --write ====================================== - name: pypyr.steps.shell in: - cmd: npx prettier {path} --write + cmd: "npx prettier {path} --write" poetry_sort: - name: pypyr.steps.echo @@ -51,11 +51,11 @@ ruff: echoMe: === ruff check --fix ========================================= - name: pypyr.steps.shell in: - cmd: poetry run -- ruff check --fix {path} + cmd: "poetry run -- ruff check --fix {path}" - name: pypyr.steps.echo in: echoMe: === ruff format --fix ======================================== - name: pypyr.steps.shell in: - cmd: poetry run -- ruff format {path} + cmd: "poetry run -- ruff format {path}" diff --git a/pipelines/test.yaml b/pipelines/test.yaml index 768bd01..a76a428 100644 --- a/pipelines/test.yaml +++ b/pipelines/test.yaml @@ -18,7 +18,7 @@ steps: - name: pypyr.steps.shell run: "{lint}" in: - cmd: pipx run -- pypyr lint path={path} npm={npm} stats={stats} + cmd: "pipx run -- pypyr lint path={path} npm={npm} stats={stats}" - name: pypyr.steps.call in: @@ -42,4 +42,4 @@ pytest: echoMe: === pytest:{markers} ======================================= - name: pypyr.steps.shell in: - cmd: poetry run -- pytest {PYTEST_CLI_ARGS} -m {markers} --junit-xml=test-results.xml + cmd: "poetry run -- pytest {PYTEST_CLI_ARGS} -m {markers} --junit-xml=test-results.xml" From 3460a8c865ffe479ead274a41c09f6ec966519b7 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 12:57:30 -0600 Subject: [PATCH 13/30] Update lock.yaml --- pipelines/lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/lock.yaml b/pipelines/lock.yaml index 7fcf37b..a644784 100644 --- a/pipelines/lock.yaml +++ b/pipelines/lock.yaml @@ -19,7 +19,7 @@ steps: poetry_lock: - name: pypyr.steps.echo in: - echoMe: = poetry lock ==============================================" + echoMe: = poetry lock ============================================== - name: pypyr.steps.shell in: cmd: poetry lock From 4fef626a460b1f1f8e2da81860d204786d67c502 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 13:00:36 -0600 Subject: [PATCH 14/30] f --- pipelines/lint.yaml | 8 ++++---- pipelines/style.yaml | 4 ++-- pipelines/test.yaml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pipelines/lint.yaml b/pipelines/lint.yaml index a0f0a86..92efb9a 100644 --- a/pipelines/lint.yaml +++ b/pipelines/lint.yaml @@ -55,7 +55,7 @@ ruff: echoMe: === ruff check ============================================== - name: pypyr.steps.shell in: - cmd: "poetry run -- ruff check {path}" + cmd: "ruff check {path}" pyright: - name: pypyr.steps.echo @@ -63,7 +63,7 @@ pyright: echoMe: === pyright ================================================= - name: pypyr.steps.shell in: - cmd: poetry run -- pyright --warnings + cmd: pyright --warnings mypy: - name: pypyr.steps.echo @@ -71,7 +71,7 @@ mypy: echoMe: === mypy =================================================== - name: pypyr.steps.shell in: - cmd: poetry run -- mypy src + cmd: mypy src pylint: - name: pypyr.steps.echo @@ -79,4 +79,4 @@ pylint: echoMe: === pylint ================================================== - name: pypyr.steps.shell in: - cmd: "poetry run -- pylint {PYLINT_CLI_ARGS} src" + cmd: "pylint {PYLINT_CLI_ARGS} src" diff --git a/pipelines/style.yaml b/pipelines/style.yaml index e9499f3..103b25e 100644 --- a/pipelines/style.yaml +++ b/pipelines/style.yaml @@ -51,11 +51,11 @@ ruff: echoMe: === ruff check --fix ========================================= - name: pypyr.steps.shell in: - cmd: "poetry run -- ruff check --fix {path}" + cmd: "ruff check --fix {path}" - name: pypyr.steps.echo in: echoMe: === ruff format --fix ======================================== - name: pypyr.steps.shell in: - cmd: "poetry run -- ruff format {path}" + cmd: "ruff format {path}" diff --git a/pipelines/test.yaml b/pipelines/test.yaml index a76a428..542c0ed 100644 --- a/pipelines/test.yaml +++ b/pipelines/test.yaml @@ -42,4 +42,4 @@ pytest: echoMe: === pytest:{markers} ======================================= - name: pypyr.steps.shell in: - cmd: "poetry run -- pytest {PYTEST_CLI_ARGS} -m {markers} --junit-xml=test-results.xml" + cmd: "pytest {PYTEST_CLI_ARGS} -m {markers} --junit-xml=test-results.xml" From cd0ef9151a05d5635eed47d20f5520b1747ed341 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 13:21:43 -0600 Subject: [PATCH 15/30] ci --- .github/workflows/always.yml | 10 +++++----- scripts/prepare.ba.sh | 7 +++++++ scripts/setup.ba.sh | 2 +- scripts/setup/ci.ba.sh | 24 ++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 scripts/setup/ci.ba.sh diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index f41f92b..1c533fb 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -33,7 +33,7 @@ jobs: # includes poetry install - name: scripts/prepare.ba.sh - run: bash scripts/prepare.ba.sh + run: bash scripts/prepare.ba.sh ci - name: pypyr lock run: pipx run -- pypyr lock freeze=True @@ -79,7 +79,7 @@ jobs: - uses: percebus/github-actions-npm/.github/actions/npm_install@main - name: scripts/prepare.ba.sh - run: bash scripts/prepare.ba.sh + run: bash scripts/prepare.ba.sh ci - name: pypyr lint run: pipx run -- pypyr lint stats=True @@ -160,7 +160,7 @@ jobs: - uses: percebus/github-actions-npm/.github/actions/npm_install@main - name: scripts/prepare.ba.sh - run: bash scripts/prepare.ba.sh + run: bash scripts/prepare.ba.sh ci # FIXME prettier fails on windows # Because of EOL differences @@ -178,7 +178,7 @@ jobs: ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: scripts/prepare.ba.sh - run: bash scripts/prepare.ba.sh + run: bash scripts/prepare.ba.sh ci - name: docker compose up run: docker compose up --abort-on-container-exit @@ -207,7 +207,7 @@ jobs: ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: scripts/prepare.ba.sh - run: bash scripts/prepare.ba.sh + run: bash scripts/prepare.ba.sh ci - name: "docker build: ${{ matrix.DOCKER_TARGET }}" run: | diff --git a/scripts/prepare.ba.sh b/scripts/prepare.ba.sh index c615c63..ac55976 100644 --- a/scripts/prepare.ba.sh +++ b/scripts/prepare.ba.sh @@ -2,6 +2,9 @@ set -e +enironment=$1 +echo "enironment:'${enironment}'" + scripts_path="$(dirname "$(readlink -f "$0")")" echo "Script directory: ${scripts_path}" @@ -10,6 +13,10 @@ set -x # Upgrades top-level dependencies, like pipx bash ${scripts_path}/gil/setup.ba.sh +if [[ "${enironment}" == "ci" ]]; then + mv ${scripts_path}/setup/ci.ba.sh setup.ba.sh +fi + bash ./repos/commons/scripts/prepare.ba.sh set +x diff --git a/scripts/setup.ba.sh b/scripts/setup.ba.sh index 88efbf6..617adba 100644 --- a/scripts/setup.ba.sh +++ b/scripts/setup.ba.sh @@ -15,7 +15,7 @@ bash ${scripts_path}/pipx/install.ba.sh # poetry has its own plugins bash ${scripts_path}/poetry/plugin/add.ba.sh - +poetry config settings.virtualenvs.create false poetry install set +x diff --git a/scripts/setup/ci.ba.sh b/scripts/setup/ci.ba.sh new file mode 100644 index 0000000..7c88c0b --- /dev/null +++ b/scripts/setup/ci.ba.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +scripts_path="$(dirname "$(readlink -f "$0")")" +echo "Script directory: ${scripts_path}" + +set -x + +# Upgrades top-level dependencies, like pipx +bash ${scripts_path}/pip/upgrade.ba.sh + +# pipx installs CLI executables, like poetry +bash ${scripts_path}/pipx/install.ba.sh + +poetry config settings.virtualenvs.create false + +# poetry has its own plugins +bash ${scripts_path}/poetry/plugin/add.ba.sh + +poetry install + +set +x +set +e From 4abea5b58e172091c36302d54ce70c293399d9e6 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 13:24:47 -0600 Subject: [PATCH 16/30] Update ci.ba.sh --- scripts/setup/ci.ba.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup/ci.ba.sh b/scripts/setup/ci.ba.sh index 7c88c0b..b6e1ae5 100644 --- a/scripts/setup/ci.ba.sh +++ b/scripts/setup/ci.ba.sh @@ -13,7 +13,7 @@ bash ${scripts_path}/pip/upgrade.ba.sh # pipx installs CLI executables, like poetry bash ${scripts_path}/pipx/install.ba.sh -poetry config settings.virtualenvs.create false +poetry config virtualenvs.create false # poetry has its own plugins bash ${scripts_path}/poetry/plugin/add.ba.sh From 729c1d5f18fc89940b2530b4a819d6267cb85d8a Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 13:27:19 -0600 Subject: [PATCH 17/30] d --- scripts/prepare.ba.sh | 9 +++++---- scripts/setup.ba.sh | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/prepare.ba.sh b/scripts/prepare.ba.sh index ac55976..1f91251 100644 --- a/scripts/prepare.ba.sh +++ b/scripts/prepare.ba.sh @@ -10,13 +10,14 @@ echo "Script directory: ${scripts_path}" set -x -# Upgrades top-level dependencies, like pipx -bash ${scripts_path}/gil/setup.ba.sh - if [[ "${enironment}" == "ci" ]]; then - mv ${scripts_path}/setup/ci.ba.sh setup.ba.sh + rm ${scripts_path}/setup.ba.sh + mv ${scripts_path}/setup/ci.ba.sh ${scripts_path}/setup.ba.sh fi +# Upgrades top-level dependencies, like pipx +bash ${scripts_path}/gil/setup.ba.sh + bash ./repos/commons/scripts/prepare.ba.sh set +x diff --git a/scripts/setup.ba.sh b/scripts/setup.ba.sh index 617adba..29ca903 100644 --- a/scripts/setup.ba.sh +++ b/scripts/setup.ba.sh @@ -15,7 +15,6 @@ bash ${scripts_path}/pipx/install.ba.sh # poetry has its own plugins bash ${scripts_path}/poetry/plugin/add.ba.sh -poetry config settings.virtualenvs.create false poetry install set +x From 35a3d3ea2287badef87280cf89b7600aa2b6ec46 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 13:31:23 -0600 Subject: [PATCH 18/30] Update test.yaml --- pipelines/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelines/test.yaml b/pipelines/test.yaml index 542c0ed..68182cc 100644 --- a/pipelines/test.yaml +++ b/pipelines/test.yaml @@ -12,8 +12,8 @@ steps: lint: True stats: False integration: False - markers: not integration - PYTEST_CLI_ARGS: + markers: "not integration" + PYTEST_CLI_ARGS: "" - name: pypyr.steps.shell run: "{lint}" From 8076ec738e905b6b97c256d66d909260fc7088ea Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 13:34:50 -0600 Subject: [PATCH 19/30] Update test.yaml --- pipelines/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/test.yaml b/pipelines/test.yaml index 68182cc..7e64b5d 100644 --- a/pipelines/test.yaml +++ b/pipelines/test.yaml @@ -42,4 +42,4 @@ pytest: echoMe: === pytest:{markers} ======================================= - name: pypyr.steps.shell in: - cmd: "pytest {PYTEST_CLI_ARGS} -m {markers} --junit-xml=test-results.xml" + cmd: pytest {PYTEST_CLI_ARGS} -m "{markers}" --junit-xml=test-results.xml From 40d57997dfee2217dddfd1c92ba4a6ad26d102ec Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 13:35:18 -0600 Subject: [PATCH 20/30] Update test.yaml --- pipelines/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/test.yaml b/pipelines/test.yaml index 7e64b5d..f1ef090 100644 --- a/pipelines/test.yaml +++ b/pipelines/test.yaml @@ -39,7 +39,7 @@ pytest: - name: pypyr.steps.echo in: - echoMe: === pytest:{markers} ======================================= + echoMe: "=== pytest:{markers} =======================================" - name: pypyr.steps.shell in: cmd: pytest {PYTEST_CLI_ARGS} -m "{markers}" --junit-xml=test-results.xml From e50f46d2b255c5fa96ca653e72d9f25ad316bb01 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 13:49:40 -0600 Subject: [PATCH 21/30] WiP --- .github/workflows/always.yml | 28 +++++++++++++++++++++++----- scripts/install.ba.sh | 5 +---- scripts/prepare.ba.sh | 8 ++++---- scripts/setup.ba.sh | 2 +- scripts/setup/ci.ba.sh | 24 ------------------------ scripts/setup/noop.ba.sh | 9 +++++++++ 6 files changed, 38 insertions(+), 38 deletions(-) delete mode 100644 scripts/setup/ci.ba.sh create mode 100644 scripts/setup/noop.ba.sh diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index 1c533fb..ae7af40 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -33,7 +33,12 @@ jobs: # includes poetry install - name: scripts/prepare.ba.sh - run: bash scripts/prepare.ba.sh ci + run: bash scripts/prepare.ba.sh + + - name: poetry install + run: | + poetry config virtualenvs.create false + poetry install - name: pypyr lock run: pipx run -- pypyr lock freeze=True @@ -79,7 +84,12 @@ jobs: - uses: percebus/github-actions-npm/.github/actions/npm_install@main - name: scripts/prepare.ba.sh - run: bash scripts/prepare.ba.sh ci + run: bash scripts/prepare.ba.sh + + - name: poetry install + run: | + poetry config virtualenvs.create false + poetry install - name: pypyr lint run: pipx run -- pypyr lint stats=True @@ -160,7 +170,12 @@ jobs: - uses: percebus/github-actions-npm/.github/actions/npm_install@main - name: scripts/prepare.ba.sh - run: bash scripts/prepare.ba.sh ci + run: bash scripts/prepare.ba.sh + + - name: poetry install + run: | + poetry config virtualenvs.create false + poetry install # FIXME prettier fails on windows # Because of EOL differences @@ -177,8 +192,11 @@ jobs: with: ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} + - name: mv scripts/setup/noop.ba.sh + run: mv scripts/setup/noop.ba.sh scripts/setup.ba.sh + - name: scripts/prepare.ba.sh - run: bash scripts/prepare.ba.sh ci + run: bash scripts/prepare.ba.sh 'pre-docker' - name: docker compose up run: docker compose up --abort-on-container-exit @@ -207,7 +225,7 @@ jobs: ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - name: scripts/prepare.ba.sh - run: bash scripts/prepare.ba.sh ci + run: bash scripts/prepare.ba.sh - name: "docker build: ${{ matrix.DOCKER_TARGET }}" run: | diff --git a/scripts/install.ba.sh b/scripts/install.ba.sh index 9008ce4..fb4129b 100644 --- a/scripts/install.ba.sh +++ b/scripts/install.ba.sh @@ -10,11 +10,8 @@ echo "Script directory: ${scripts_path}" set -x -# Upgrades top-level dependencies, like pipx -bash ${scripts_path}/pip/upgrade.ba.sh - # pipx installs CLI executables, like poetry -bash ${scripts_path}/pipx/install.ba.sh +bash ${scripts_path}/setup.ba.sh # pip installs dependencies bash ${scripts_path}/pip/install.ba.sh ${target_config} diff --git a/scripts/prepare.ba.sh b/scripts/prepare.ba.sh index 1f91251..d2e657a 100644 --- a/scripts/prepare.ba.sh +++ b/scripts/prepare.ba.sh @@ -2,17 +2,17 @@ set -e -enironment=$1 -echo "enironment:'${enironment}'" +environment=${1} +echo "environment: ${environment}" scripts_path="$(dirname "$(readlink -f "$0")")" echo "Script directory: ${scripts_path}" set -x -if [[ "${enironment}" == "ci" ]]; then +if [ "${environment}" == "pre-docker" ]; then rm ${scripts_path}/setup.ba.sh - mv ${scripts_path}/setup/ci.ba.sh ${scripts_path}/setup.ba.sh + bash mv ${scripts_path}/setup/noop.ba.sh ${scripts_path}/setup.ba.sh fi # Upgrades top-level dependencies, like pipx diff --git a/scripts/setup.ba.sh b/scripts/setup.ba.sh index 29ca903..82a5860 100644 --- a/scripts/setup.ba.sh +++ b/scripts/setup.ba.sh @@ -15,7 +15,7 @@ bash ${scripts_path}/pipx/install.ba.sh # poetry has its own plugins bash ${scripts_path}/poetry/plugin/add.ba.sh -poetry install + set +x set +e diff --git a/scripts/setup/ci.ba.sh b/scripts/setup/ci.ba.sh deleted file mode 100644 index b6e1ae5..0000000 --- a/scripts/setup/ci.ba.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e - -scripts_path="$(dirname "$(readlink -f "$0")")" -echo "Script directory: ${scripts_path}" - -set -x - -# Upgrades top-level dependencies, like pipx -bash ${scripts_path}/pip/upgrade.ba.sh - -# pipx installs CLI executables, like poetry -bash ${scripts_path}/pipx/install.ba.sh - -poetry config virtualenvs.create false - -# poetry has its own plugins -bash ${scripts_path}/poetry/plugin/add.ba.sh - -poetry install - -set +x -set +e diff --git a/scripts/setup/noop.ba.sh b/scripts/setup/noop.ba.sh new file mode 100644 index 0000000..fe96399 --- /dev/null +++ b/scripts/setup/noop.ba.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e +set -x + +echo "No setup.ba.sh" + +set +x +set +e From ba01ffb1d5cf6e5dc40f42cf16848724c86b413a Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 13:55:10 -0600 Subject: [PATCH 22/30] w --- scripts/{setup => }/noop.ba.sh | 0 scripts/prepare.ba.sh | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename scripts/{setup => }/noop.ba.sh (100%) diff --git a/scripts/setup/noop.ba.sh b/scripts/noop.ba.sh similarity index 100% rename from scripts/setup/noop.ba.sh rename to scripts/noop.ba.sh diff --git a/scripts/prepare.ba.sh b/scripts/prepare.ba.sh index d2e657a..6184173 100644 --- a/scripts/prepare.ba.sh +++ b/scripts/prepare.ba.sh @@ -12,7 +12,7 @@ set -x if [ "${environment}" == "pre-docker" ]; then rm ${scripts_path}/setup.ba.sh - bash mv ${scripts_path}/setup/noop.ba.sh ${scripts_path}/setup.ba.sh + bash mv ${scripts_path}/noop.ba.sh ${scripts_path}/setup.ba.sh fi # Upgrades top-level dependencies, like pipx From 971c1bf4fd02acec8bf977d587aa7de394502381 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 13:59:22 -0600 Subject: [PATCH 23/30] Update TODO.md --- TODO.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index ea134b2..1d572a9 100644 --- a/TODO.md +++ b/TODO.md @@ -5,7 +5,6 @@ - [ ] `mypy --strict` for all `.py` files - [ ] Centralize print("✅") in `lib` - [ ] Remove `src.` from all `import`s -- [ ] Combine `scripts/setup.ba.sh` with `install.ba.sh` ### CLI cmds @@ -25,6 +24,7 @@ Move CLI cmds like `pypyr` to `requirements.pipx.txt` - [x] ~~Rename `requirements.min.txt` to `requirements.main.txt`, to hint that it comes from `poetry` `main` dependencies.~~ - [x] ~~Fix `CHANGELOG.md` style from `semantic-release`~~ - [x] ~~Remove `python` commands from `package.json`~~ +- [x] ~~Combine `scripts/setup.ba.sh` with `install.ba.sh`~~ ### CLI cmds in requirements.pipx.txt From 36745939954763a8991249280759ff4e5cf46686 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 14:01:17 -0600 Subject: [PATCH 24/30] Update always.yml --- .github/workflows/always.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index ae7af40..133b563 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -31,14 +31,11 @@ jobs: architecture: ${{ env.ARCHITECTURE }} python-version: ${{ env.PYTHON_VERSION }} - # includes poetry install - name: scripts/prepare.ba.sh run: bash scripts/prepare.ba.sh - name: poetry install - run: | - poetry config virtualenvs.create false - poetry install + run: bash _scripts/poetry/install.ba.sh ci - name: pypyr lock run: pipx run -- pypyr lock freeze=True @@ -87,9 +84,7 @@ jobs: run: bash scripts/prepare.ba.sh - name: poetry install - run: | - poetry config virtualenvs.create false - poetry install + run: bash _scripts/poetry/install.ba.sh ci - name: pypyr lint run: pipx run -- pypyr lint stats=True @@ -173,9 +168,7 @@ jobs: run: bash scripts/prepare.ba.sh - name: poetry install - run: | - poetry config virtualenvs.create false - poetry install + run: bash _scripts/poetry/install.ba.sh ci # FIXME prettier fails on windows # Because of EOL differences @@ -192,9 +185,6 @@ jobs: with: ssh-private-key: ${{ secrets.SSH_KEY_PRIVATE }} - - name: mv scripts/setup/noop.ba.sh - run: mv scripts/setup/noop.ba.sh scripts/setup.ba.sh - - name: scripts/prepare.ba.sh run: bash scripts/prepare.ba.sh 'pre-docker' From dd4867d702b296c6787b6f95ba6b114c6ed507d7 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 14:02:48 -0600 Subject: [PATCH 25/30] r --- scripts/noop.ba.sh | 9 --------- scripts/prepare.ba.sh | 1 - 2 files changed, 10 deletions(-) delete mode 100644 scripts/noop.ba.sh diff --git a/scripts/noop.ba.sh b/scripts/noop.ba.sh deleted file mode 100644 index fe96399..0000000 --- a/scripts/noop.ba.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e -set -x - -echo "No setup.ba.sh" - -set +x -set +e diff --git a/scripts/prepare.ba.sh b/scripts/prepare.ba.sh index 6184173..52fc503 100644 --- a/scripts/prepare.ba.sh +++ b/scripts/prepare.ba.sh @@ -12,7 +12,6 @@ set -x if [ "${environment}" == "pre-docker" ]; then rm ${scripts_path}/setup.ba.sh - bash mv ${scripts_path}/noop.ba.sh ${scripts_path}/setup.ba.sh fi # Upgrades top-level dependencies, like pipx From 80d47b7fb906a4f0ff75ad349c124200c78383dc Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 14:07:30 -0600 Subject: [PATCH 26/30] Update always.yml --- .github/workflows/always.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index 133b563..c51ab6d 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -112,7 +112,7 @@ jobs: verify_matrix: name: Verify needs: verify - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' # FIXME continue-on-error: true strategy: max-parallel: 10 @@ -192,7 +192,7 @@ jobs: run: docker compose up --abort-on-container-exit docker_build_matrix: - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' # FIXME name: docker build --target needs: docker_compose continue-on-error: true From 0e9ba2d0f5cd4228884093f8f6be73af530474a9 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 14:16:33 -0600 Subject: [PATCH 27/30] revert(scripts/install.ba.sh): No use of setup --- .github/workflows/always.yml | 2 +- TODO.md | 2 +- scripts/install.ba.sh | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index c51ab6d..d87585b 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -112,7 +112,7 @@ jobs: verify_matrix: name: Verify needs: verify - # if: github.ref == 'refs/heads/main' # FIXME + if: github.ref == 'refs/heads/main' continue-on-error: true strategy: max-parallel: 10 diff --git a/TODO.md b/TODO.md index 1d572a9..ea134b2 100644 --- a/TODO.md +++ b/TODO.md @@ -5,6 +5,7 @@ - [ ] `mypy --strict` for all `.py` files - [ ] Centralize print("✅") in `lib` - [ ] Remove `src.` from all `import`s +- [ ] Combine `scripts/setup.ba.sh` with `install.ba.sh` ### CLI cmds @@ -24,7 +25,6 @@ Move CLI cmds like `pypyr` to `requirements.pipx.txt` - [x] ~~Rename `requirements.min.txt` to `requirements.main.txt`, to hint that it comes from `poetry` `main` dependencies.~~ - [x] ~~Fix `CHANGELOG.md` style from `semantic-release`~~ - [x] ~~Remove `python` commands from `package.json`~~ -- [x] ~~Combine `scripts/setup.ba.sh` with `install.ba.sh`~~ ### CLI cmds in requirements.pipx.txt diff --git a/scripts/install.ba.sh b/scripts/install.ba.sh index fb4129b..9008ce4 100644 --- a/scripts/install.ba.sh +++ b/scripts/install.ba.sh @@ -10,8 +10,11 @@ echo "Script directory: ${scripts_path}" set -x +# Upgrades top-level dependencies, like pipx +bash ${scripts_path}/pip/upgrade.ba.sh + # pipx installs CLI executables, like poetry -bash ${scripts_path}/setup.ba.sh +bash ${scripts_path}/pipx/install.ba.sh # pip installs dependencies bash ${scripts_path}/pip/install.ba.sh ${target_config} From 203e1b1bb0b5c79345e300548cf2e9095e26f0b6 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 14:23:34 -0600 Subject: [PATCH 28/30] test --- .github/workflows/always.yml | 2 +- requirements.pipx.txt | 1 - requirements.upgrade.txt | 1 + scripts/{gil/setup.ba.sh => pip/upgrade.ba.sh} | 5 +---- scripts/prepare.ba.sh | 4 ++-- 5 files changed, 5 insertions(+), 8 deletions(-) rename scripts/{gil/setup.ba.sh => pip/upgrade.ba.sh} (50%) diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index d87585b..c51ab6d 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -112,7 +112,7 @@ jobs: verify_matrix: name: Verify needs: verify - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' # FIXME continue-on-error: true strategy: max-parallel: 10 diff --git a/requirements.pipx.txt b/requirements.pipx.txt index 356d219..31c0fca 100644 --- a/requirements.pipx.txt +++ b/requirements.pipx.txt @@ -1,4 +1,3 @@ -gil>=1.25.0.0,<2.0.0.0 poetry>=2.0.0,<3.0.0 pre_commit>=4.0.1,<5.0.0 pyclean>=3.0.0,<4.0.0 diff --git a/requirements.upgrade.txt b/requirements.upgrade.txt index e79531c..13f1418 100644 --- a/requirements.upgrade.txt +++ b/requirements.upgrade.txt @@ -1 +1,2 @@ +gil pipx diff --git a/scripts/gil/setup.ba.sh b/scripts/pip/upgrade.ba.sh similarity index 50% rename from scripts/gil/setup.ba.sh rename to scripts/pip/upgrade.ba.sh index 22ad4f9..2c2be0e 100644 --- a/scripts/gil/setup.ba.sh +++ b/scripts/pip/upgrade.ba.sh @@ -4,10 +4,7 @@ set -e set -x python -m pip install --upgrade pip -python -m pip install pipx -python -m pipx install gil -pipx run -- gil clone - +python -m pip install --upgrade --requirement requirements.upgrade.txt set +x set +e diff --git a/scripts/prepare.ba.sh b/scripts/prepare.ba.sh index 52fc503..31dbe9d 100644 --- a/scripts/prepare.ba.sh +++ b/scripts/prepare.ba.sh @@ -15,8 +15,8 @@ if [ "${environment}" == "pre-docker" ]; then fi # Upgrades top-level dependencies, like pipx -bash ${scripts_path}/gil/setup.ba.sh - +bash ${scripts_path}/pip/upgrade.ba.sh +gil clone bash ./repos/commons/scripts/prepare.ba.sh set +x From 6c51dce42278cf15acef53ddf409a4aa83b7412d Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 14:34:57 -0600 Subject: [PATCH 29/30] fw --- pipelines/lint.yaml | 2 +- scripts/prepare.ba.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pipelines/lint.yaml b/pipelines/lint.yaml index 92efb9a..81780c2 100644 --- a/pipelines/lint.yaml +++ b/pipelines/lint.yaml @@ -10,7 +10,7 @@ steps: npm: True path: . stats: False - PYLINT_CLI_ARGS: + PYLINT_CLI_ARGS: "" - name: pypyr.steps.set run: "{stats}" diff --git a/scripts/prepare.ba.sh b/scripts/prepare.ba.sh index 31dbe9d..65b9b35 100644 --- a/scripts/prepare.ba.sh +++ b/scripts/prepare.ba.sh @@ -8,12 +8,15 @@ echo "environment: ${environment}" scripts_path="$(dirname "$(readlink -f "$0")")" echo "Script directory: ${scripts_path}" -set -x if [ "${environment}" == "pre-docker" ]; then + set -x rm ${scripts_path}/setup.ba.sh + set +x fi +set -x + # Upgrades top-level dependencies, like pipx bash ${scripts_path}/pip/upgrade.ba.sh gil clone From 181602df3481be72aedadf7d24e830b1062dbb14 Mon Sep 17 00:00:00 2001 From: JCGuerrero Date: Sat, 18 Jan 2025 15:07:09 -0600 Subject: [PATCH 30/30] Update always.yml --- .github/workflows/always.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index c51ab6d..133b563 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -112,7 +112,7 @@ jobs: verify_matrix: name: Verify needs: verify - # if: github.ref == 'refs/heads/main' # FIXME + if: github.ref == 'refs/heads/main' continue-on-error: true strategy: max-parallel: 10 @@ -192,7 +192,7 @@ jobs: run: docker compose up --abort-on-container-exit docker_build_matrix: - # if: github.ref == 'refs/heads/main' # FIXME + if: github.ref == 'refs/heads/main' name: docker build --target needs: docker_compose continue-on-error: true