Skip to content

Commit d843a18

Browse files
committed
install classiq separately, for dev environment
debug reorder CI Fix pip url Fix pip url Remove debug Update pip installation to dev-daily
1 parent 68deba4 commit d843a18

File tree

2 files changed

+85
-29
lines changed

2 files changed

+85
-29
lines changed

.github/workflows/Test-CI-dev-daily.yml

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,18 @@ jobs:
2121
runs-on: ubuntu-latest
2222

2323
steps:
24+
#
25+
# Setup Repository
26+
#
2427
- name: Checkout repository
2528
uses: actions/checkout@v4
2629

27-
- name: Set up Python
28-
uses: actions/setup-python@v5
29-
with:
30-
python-version: "3.11"
31-
3230
- name: Debug
3331
run: git status
3432

35-
- name: Install dependencies
36-
run: |
37-
set -e
38-
python -m pip install -U pip
39-
python -m pip install --extra-index-url https://pypi.org/simple --pre -U -r requirements.txt
40-
python -m pip install --extra-index-url https://pypi.org/simple -U -r requirements_tests.txt
41-
33+
#
34+
# Setup Environment
35+
#
4236
# Configure AWS credentials
4337
- name: Configure AWS Credentials
4438
uses: aws-actions/configure-aws-credentials@v4.0.2
@@ -54,6 +48,45 @@ jobs:
5448
IS_DEV: "true"
5549
M2M_SECRET_ARN: "${{ secrets.NIGHTLY_M2M_SECRET_ARN }}"
5650

51+
#
52+
# Setup Python
53+
# (needs to run after "Setup Environment", since we install classiq's version from aws)
54+
#
55+
- name: Set up Python
56+
uses: actions/setup-python@v5
57+
with:
58+
python-version: "3.11"
59+
60+
- name: Install dependencies
61+
run: |
62+
# Some weird behavior, that we should understand soon:
63+
# "pip" defaults to use the aws url, and doesn't use the normal url
64+
# so we need to add the normal pip url to every line..
65+
set -e
66+
67+
python -m pip install -U pip \
68+
--extra-index-url https://pypi.org/simple
69+
70+
# Install "classiq" separately
71+
export CODEARTIFACT_AUTH_TOKEN="$( \
72+
aws codeartifact get-authorization-token \
73+
--domain ${{ secrets.CODEARTIFACT_DOMAIN }} \
74+
--domain-owner ${{ secrets.CODEARTIFACT_OWNER }} \
75+
--region ${{ secrets.CODEARTIFACT_REGION }} \
76+
--query authorizationToken \
77+
--output text \
78+
)"
79+
python -m pip install -U --pre \
80+
--extra-index-url "https://aws:$CODEARTIFACT_AUTH_TOKEN@${{ secrets.CODEARTIFACT_DOMAIN }}-${{ secrets.CODEARTIFACT_OWNER }}.d.codeartifact.${{ secrets.CODEARTIFACT_REGION }}.amazonaws.com/pypi/${{ secrets.PYPI_NIGHTLY_NAME }}/simple/" \
81+
--extra-index-url https://pypi.org/simple \
82+
classiq
83+
84+
# Install everything from the requirements, other than "classiq".
85+
python -m pip install -U $(grep -ivE "classiq" requirements.txt) \
86+
--extra-index-url https://pypi.org/simple
87+
python -m pip install -U -r requirements_tests.txt \
88+
--extra-index-url https://pypi.org/simple
89+
5790
# Run Notebook Tests
5891
- name: Run Notebooks
5992
run: python -m pytest --log-cli-level=INFO tests

.github/workflows/Test-CI-dev.yml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,6 @@ jobs:
7373
echo "==== Git status after checkout ===="
7474
git status
7575
76-
#
77-
# Setup Python
78-
#
79-
- name: Set up Python
80-
uses: actions/setup-python@v5
81-
with:
82-
python-version: "3.11"
83-
84-
- name: Install dependencies
85-
if: steps.cache-pip.outputs.cache-hit != 'true'
86-
run: |
87-
set -e
88-
python -m pip install -U pip
89-
# The `--pre` allows the installation of pre-release versions of packages (needed for Dev)
90-
python -m pip install --extra-index-url https://pypi.org/simple --pre -U -r requirements.txt
91-
python -m pip install --extra-index-url https://pypi.org/simple -U -r requirements_tests.txt
92-
9376
#
9477
# Setup Environment
9578
#
@@ -108,6 +91,46 @@ jobs:
10891
IS_DEV: "true"
10992
M2M_SECRET_ARN: "${{ secrets.NIGHTLY_M2M_SECRET_ARN }}"
11093

94+
#
95+
# Setup Python
96+
# (needs to run after "Setup Environment", since we install classiq's version from aws)
97+
#
98+
- name: Set up Python
99+
uses: actions/setup-python@v5
100+
with:
101+
python-version: "3.11"
102+
103+
- name: Install dependencies
104+
if: steps.cache-pip.outputs.cache-hit != 'true'
105+
run: |
106+
# Some weird behavior, that we should understand soon:
107+
# "pip" defaults to use the aws url, and doesn't use the normal url
108+
# so we need to add the normal pip url to every line..
109+
set -e
110+
111+
python -m pip install -U pip \
112+
--extra-index-url https://pypi.org/simple
113+
114+
# Install "classiq" separately
115+
export CODEARTIFACT_AUTH_TOKEN="$( \
116+
aws codeartifact get-authorization-token \
117+
--domain ${{ secrets.CODEARTIFACT_DOMAIN }} \
118+
--domain-owner ${{ secrets.CODEARTIFACT_OWNER }} \
119+
--region ${{ secrets.CODEARTIFACT_REGION }} \
120+
--query authorizationToken \
121+
--output text \
122+
)"
123+
python -m pip install -U --pre \
124+
--extra-index-url "https://aws:$CODEARTIFACT_AUTH_TOKEN@${{ secrets.CODEARTIFACT_DOMAIN }}-${{ secrets.CODEARTIFACT_OWNER }}.d.codeartifact.${{ secrets.CODEARTIFACT_REGION }}.amazonaws.com/pypi/${{ secrets.PYPI_NIGHTLY_NAME }}/simple/" \
125+
--extra-index-url https://pypi.org/simple \
126+
classiq
127+
128+
# Install everything from the requirements, other than "classiq".
129+
python -m pip install -U $(grep -ivE "classiq" requirements.txt) \
130+
--extra-index-url https://pypi.org/simple
131+
python -m pip install -U -r requirements_tests.txt \
132+
--extra-index-url https://pypi.org/simple
133+
111134
#
112135
# Propagate CI information to python tests
113136
#

0 commit comments

Comments
 (0)