From 24f51bfa6c05d0a8764c27411bffedd65b915511 Mon Sep 17 00:00:00 2001 From: Russell Martin Date: Tue, 28 May 2024 13:15:57 -0400 Subject: [PATCH] Introduce Action to run `install_requirement.py` --- .../actions/install-requirement/action.yml | 37 +++++++++ .github/workflows/ci.yml | 71 ++++++++++++++++++ .../install_requirement.cpython-312.pyc | Bin 0 -> 6069 bytes scripts/install_requirement.py | 5 +- 4 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 .github/actions/install-requirement/action.yml create mode 100644 scripts/__pycache__/install_requirement.cpython-312.pyc diff --git a/.github/actions/install-requirement/action.yml b/.github/actions/install-requirement/action.yml new file mode 100644 index 00000000..7698c494 --- /dev/null +++ b/.github/actions/install-requirement/action.yml @@ -0,0 +1,37 @@ +name: Install Project Requirements +description: Install requirements from a PEP 517 project + +inputs: + requirements: + description: "Whitespace-delimited list of project requirements to install." + required: true + project-root: + description: "The filesystem path to the root of the project to install from; defaults to github.workspace." + default: ${{ github.workspace }} + extra: + description: "Name of the optional dependencies marker; e.g. dev." + required: false + default: "" + +runs: + using: composite + steps: + - name: Checkout beeware/.github + uses: actions/checkout@v4.1.6 + with: + repository: beeware/.github + path: .github-beeware + + - name: Install Dependencies + shell: bash + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools build wheel + + - name: Install Requirements + working-directory: ./.github-beeware/scripts + shell: bash + run: > + python -m install_requirement ${{ inputs.requirements }} + --extra "${{ inputs.extra }}" + --project-root "$(printf -- "%q" "${{ inputs.project-root }}")" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f361ded..e17a2826 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -184,6 +184,77 @@ jobs: repo: toga build-subdir: android + test-install-requirements: + name: Install Requirements + needs: pre-commit + runs-on: ${{ matrix.runner-os }} + strategy: + fail-fast: false + matrix: + runner-os: [ macos-latest, windows-latest, ubuntu-latest ] + steps: + - name: Checkout beeware/.github + uses: actions/checkout@v4.1.6 + with: + repository: beeware/.github + path: repos/.github + +# - name: Checkout beeware/briefcase +# uses: actions/checkout@v4.1.6 +# with: +# repository: beeware/briefcase +# +# - name: Checkout beeware/briefcase to path +# uses: actions/checkout@v4.1.6 +# with: +# repository: beeware/briefcase +# path: repos/briefcase + + - name: Tree + run: tree -a ./ + + - name: Set up Python + uses: actions/setup-python@v5.1.0 + with: + python-version: "3.x" + + - name: Test Install Requirements with Path + uses: ./repos/.github/.github/actions/install-requirement + with: + requirements: "pre-commit tox" + extra: "dev" + project-path: "repos/briefcase" + + - name: Test Install Requirements + uses: ./repos/.github/.github/actions/install-requirement + with: + requirements: "coverage" + extra: "dev" + + - name: Test Install Requirements + uses: ./repos/.github/.github/actions/install-requirement + with: + requirements: "cookiecutter" + + - name: Verify Requirements Installed + run: | + if ! python -m pip list | grep tox; then + echo '::error::Failed to install tox' + exit 1 + fi + if ! python -m pip list | grep pre-commit; then + echo '::error::Failed to install pre-commit' + exit 1 + fi + if ! python -m pip list | grep coverage; then + echo '::error::Failed to install coverage' + exit 1 + fi + if ! python -m pip list | grep cookiecutter; then + echo '::error::Failed to install cookiecutter' + exit 1 + fi + test-verify-projects-briefcase: name: Verify Project needs: [ pre-commit, test-package-python ] diff --git a/scripts/__pycache__/install_requirement.cpython-312.pyc b/scripts/__pycache__/install_requirement.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f7db974193339b348e332b714c57e8ed7fbbd595 GIT binary patch literal 6069 zcmb7IU2Gf25#GH!{{Kp(Mah!vQxw^uBT;s0$3JxqJN{`ByRu*>X(Gd5PrQ>v`A8~z zN6TWVLJd?zZd}Ahe{3Lik%ty_U>ERXACo=>=nH8%6>(8e14)7Ujj_}qQ6JiwJ03|1 z3W~18z1!K@-MQJBZ)W$efq<7l;eD@-&9)KpIX3L#uwLkjmlAT5$V8?p$@tsq- z5zc(_BRo8LRmeC-92w_`)9e>iSH?Z!Hs2kpC*vJ~X@JkE`ZE3zzxnP`1DW7RkP?o3 zpUCccB72n3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;qRe`zx)+G#HSv4-8@IHq@EJ@{Lg?$&gj98O-X-Pc?S4!rMm_d~dmL_B* z$j}ijeg{8IhYGHeLgBd=tDM)dZ8_BOPH{n4erjK(qkE}iSGi+XrFZ92@7{9n-b$?V zX5mI*)g|=kp&MP{w@IZqN!8!U|~2xH+hy_YcV^|HLlw(#yQI`GdO1lUWJY2 zffcU87#a`z5muv68E!agSf>s|OY_8SxbWztrbn$P@6;ypdRny(JKoWJT9p$f!HoKC zQ&Q@ZG!6)qXx>c5>n86A zyA0fzhiJcts>)MJ|20er?fsmzd`i53Cr3Xc?VpjS|3L;mBZ*ZfPkY|)SS9dS^;7zE zDHLBN@LY9Mda$&0FE$Q7aqpnv>g$xmI;yU2+EZ!ms`BuB)YVsYz_aQkEm5-v!k{y@ y;sM&qQ5vS+Cp&^PT78NL{)NH=zM~@e=Z?Sq;!j_^`pP@6eIh{QCc;(|HU0}EJhmqQ literal 0 HcmV?d00001 diff --git a/scripts/install_requirement.py b/scripts/install_requirement.py index 0c604a2f..623edcec 100644 --- a/scripts/install_requirement.py +++ b/scripts/install_requirement.py @@ -7,10 +7,7 @@ # Install one or more PEP 517 project defined requirements # # positional arguments: -# requirements List of project requirements to install. Any project -# requirements that start with any of these values will -# be installed. For instance, including 'pytest' in this -# list would install both pytest and pytest-xdist. +# requirements Whitespace-delimited list of project requirements to install. # # options: # -h, --help show this help message and exit