Skip to content

Commit

Permalink
build(pip): restructure requirements (#297)
Browse files Browse the repository at this point in the history
devcontainer: use quay.io/ignition-devs/devcontainer-base as base image
  • Loading branch information
cesarcoatl authored Aug 21, 2024
1 parent dd430ce commit 5f125e6
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 428 deletions.
62 changes: 9 additions & 53 deletions .github/workflows/pip-compile-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,16 @@ name: pip-compile-upgrade

on:
schedule:
- cron: '0 20 * * 1'
- cron: '30 20 * * 1'
workflow_dispatch:

jobs:
pip-compile-upgrade:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: pip-compile-dev-requirements
uses: coatl-dev/actions/pip-compile@v3
with:
path: requirements/dev.txt
python-version: '2.7'

- name: pip-compile-build-requirements
uses: coatl-dev/actions/pip-compile@v3
with:
path: requirements/build.txt
python-version: '3.12'

- name: Detect changes
id: git-diff
uses: coatl-dev/actions/simple-git-diff@v3

- name: Import GPG key
if: ${{ steps.git-diff.outputs.diff == 'true' }}
id: gpg-import
uses: coatl-dev/actions/gpg-import@v3
with:
passphrase: ${{ secrets.COATL_BOT_GPG_PASSPHRASE }}
private-key: ${{ secrets.COATL_BOT_GPG_PRIVATE_KEY }}

- name: Build commit message
if: ${{ steps.git-diff.outputs.diff == 'true' }}
run: |
echo "chore(requirements): pip-compile upgrade" > "$RUNNER_TEMP/commit.txt"
{
echo ""
echo "updates:"
git status --porcelain | awk 'match($1, "M") {print " - " $2}'
} >> "$RUNNER_TEMP/commit.txt"
- name: Commit and push changes
if: ${{ steps.git-diff.outputs.diff == 'true' }}
run: |
git checkout -B coatl-dev-pip-compile-upgrade
git add -u
git commit --file="${RUNNER_TEMP}/commit.txt"
git push --force --set-upstream origin coatl-dev-pip-compile-upgrade
- name: Create pull request
if: ${{ steps.git-diff.outputs.diff == 'true' }}
uses: coatl-dev/actions/pr-create@v3
with:
gh-token: ${{ secrets.COATL_BOT_GH_TOKEN }}
uses: coatl-dev/workflows/.github/workflows/pip-compile-upgrade.yml@v4
with:
path: requirements.txt
python-version: '2.7'
secrets:
gh-token: ${{ secrets.COATL_BOT_GH_TOKEN }}
gpg-sign-passphrase: ${{ secrets.COATL_BOT_GPG_PASSPHRASE }}
gpg-sign-private-key: ${{ secrets.COATL_BOT_GPG_PRIVATE_KEY }}
2 changes: 1 addition & 1 deletion .mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mypy]
python_version = 2.7
mypy_path = src
mypy_path = $MYPY_CONFIG_FILE_DIR/src
strict = true
enable_error_code = ignore-without-code
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
FROM coatldev/six:3.12 as devcontainer
FROM quay.io/ignition-devs/devcontainer-base:python as devcontainer

COPY requirements /tmp/requirements/
COPY requirements.txt /tmp/requirements.txt

# hadolint ignore=DL3042
RUN set -eux; \
\
python2 -m pip install --requirement \
/tmp/requirements/dev.txt; \
\
python3 -m pip install --requirement \
/tmp/requirements/build.txt
/tmp/requirements.txt

CMD ["/bin/bash"]
File renamed without changes.
17 changes: 16 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
--requirement requirements/dev.txt
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --generate-hashes requirements.in
#
enum34==1.1.10 \
--hash=sha256:a98a201d6de3f2ab3db284e70a33b0f896fbf35f8086594e8c9e74b909058d53 \
--hash=sha256:c3858660960c984d6ab0ebad691265180da2b43f07e061c0f8dca9ef3cffd328 \
--hash=sha256:cce6a7477ed816bd2542d03d53db9f0db935dd013b70f336a95c73979289f248
# via -r requirements.in
typing==3.10.0.0 \
--hash=sha256:12fbdfbe7d6cca1a42e485229afcb0b0c8259258cfb919b8a5e2a5c953742f89 \
--hash=sha256:13b4ad211f54ddbf93e5901a9967b1e07720c1d1b78d596ac6a439641aa1b130 \
--hash=sha256:c7219ef20c5fbf413b4567092adfc46fa6203cb8454eda33c3fc1afe1398a308
# via -r requirements.in
4 changes: 0 additions & 4 deletions requirements/build.in

This file was deleted.

347 changes: 0 additions & 347 deletions requirements/build.txt

This file was deleted.

16 changes: 0 additions & 16 deletions requirements/dev.txt

This file was deleted.

0 comments on commit 5f125e6

Please sign in to comment.