Skip to content

Commit 5f125e6

Browse files
authored
build(pip): restructure requirements (#297)
devcontainer: use quay.io/ignition-devs/devcontainer-base as base image
1 parent dd430ce commit 5f125e6

File tree

8 files changed

+29
-428
lines changed

8 files changed

+29
-428
lines changed

Diff for: .github/workflows/pip-compile-upgrade.yml

+9-53
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,16 @@ name: pip-compile-upgrade
22

33
on:
44
schedule:
5-
- cron: '0 20 * * 1'
5+
- cron: '30 20 * * 1'
66
workflow_dispatch:
77

88
jobs:
99
pip-compile-upgrade:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: Checkout repo
13-
uses: actions/checkout@v4
14-
15-
- name: pip-compile-dev-requirements
16-
uses: coatl-dev/actions/pip-compile@v3
17-
with:
18-
path: requirements/dev.txt
19-
python-version: '2.7'
20-
21-
- name: pip-compile-build-requirements
22-
uses: coatl-dev/actions/pip-compile@v3
23-
with:
24-
path: requirements/build.txt
25-
python-version: '3.12'
26-
27-
- name: Detect changes
28-
id: git-diff
29-
uses: coatl-dev/actions/simple-git-diff@v3
30-
31-
- name: Import GPG key
32-
if: ${{ steps.git-diff.outputs.diff == 'true' }}
33-
id: gpg-import
34-
uses: coatl-dev/actions/gpg-import@v3
35-
with:
36-
passphrase: ${{ secrets.COATL_BOT_GPG_PASSPHRASE }}
37-
private-key: ${{ secrets.COATL_BOT_GPG_PRIVATE_KEY }}
38-
39-
- name: Build commit message
40-
if: ${{ steps.git-diff.outputs.diff == 'true' }}
41-
run: |
42-
echo "chore(requirements): pip-compile upgrade" > "$RUNNER_TEMP/commit.txt"
43-
{
44-
echo ""
45-
echo "updates:"
46-
git status --porcelain | awk 'match($1, "M") {print " - " $2}'
47-
} >> "$RUNNER_TEMP/commit.txt"
48-
49-
- name: Commit and push changes
50-
if: ${{ steps.git-diff.outputs.diff == 'true' }}
51-
run: |
52-
git checkout -B coatl-dev-pip-compile-upgrade
53-
git add -u
54-
git commit --file="${RUNNER_TEMP}/commit.txt"
55-
git push --force --set-upstream origin coatl-dev-pip-compile-upgrade
56-
57-
- name: Create pull request
58-
if: ${{ steps.git-diff.outputs.diff == 'true' }}
59-
uses: coatl-dev/actions/pr-create@v3
60-
with:
61-
gh-token: ${{ secrets.COATL_BOT_GH_TOKEN }}
10+
uses: coatl-dev/workflows/.github/workflows/pip-compile-upgrade.yml@v4
11+
with:
12+
path: requirements.txt
13+
python-version: '2.7'
14+
secrets:
15+
gh-token: ${{ secrets.COATL_BOT_GH_TOKEN }}
16+
gpg-sign-passphrase: ${{ secrets.COATL_BOT_GPG_PASSPHRASE }}
17+
gpg-sign-private-key: ${{ secrets.COATL_BOT_GPG_PRIVATE_KEY }}

Diff for: .mypy.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[mypy]
22
python_version = 2.7
3-
mypy_path = src
3+
mypy_path = $MYPY_CONFIG_FILE_DIR/src
44
strict = true
55
enable_error_code = ignore-without-code

Diff for: Dockerfile

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
FROM coatldev/six:3.12 as devcontainer
1+
FROM quay.io/ignition-devs/devcontainer-base:python as devcontainer
22

3-
COPY requirements /tmp/requirements/
3+
COPY requirements.txt /tmp/requirements.txt
44

55
# hadolint ignore=DL3042
66
RUN set -eux; \
77
\
88
python2 -m pip install --requirement \
9-
/tmp/requirements/dev.txt; \
10-
\
11-
python3 -m pip install --requirement \
12-
/tmp/requirements/build.txt
9+
/tmp/requirements.txt
1310

1411
CMD ["/bin/bash"]

Diff for: requirements/dev.in renamed to requirements.in

File renamed without changes.

Diff for: requirements.txt

+16-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
--requirement requirements/dev.txt
1+
#
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
4+
#
5+
# pip-compile --generate-hashes requirements.in
6+
#
7+
enum34==1.1.10 \
8+
--hash=sha256:a98a201d6de3f2ab3db284e70a33b0f896fbf35f8086594e8c9e74b909058d53 \
9+
--hash=sha256:c3858660960c984d6ab0ebad691265180da2b43f07e061c0f8dca9ef3cffd328 \
10+
--hash=sha256:cce6a7477ed816bd2542d03d53db9f0db935dd013b70f336a95c73979289f248
11+
# via -r requirements.in
12+
typing==3.10.0.0 \
13+
--hash=sha256:12fbdfbe7d6cca1a42e485229afcb0b0c8259258cfb919b8a5e2a5c953742f89 \
14+
--hash=sha256:13b4ad211f54ddbf93e5901a9967b1e07720c1d1b78d596ac6a439641aa1b130 \
15+
--hash=sha256:c7219ef20c5fbf413b4567092adfc46fa6203cb8454eda33c3fc1afe1398a308
16+
# via -r requirements.in

Diff for: requirements/build.in

-4
This file was deleted.

Diff for: requirements/build.txt

-347
This file was deleted.

Diff for: requirements/dev.txt

-16
This file was deleted.

0 commit comments

Comments
 (0)