Skip to content

Commit c66fbb6

Browse files
author
Adrian Chang
committed
Publish to test pypi
1 parent 522757e commit c66fbb6

File tree

4 files changed

+76
-31
lines changed

4 files changed

+76
-31
lines changed

.github/actions/lbox-matrix/index.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26837,22 +26837,31 @@ try {
2683726837
"da-test-key": "DA_GCP_LABELBOX_API_KEY"
2683826838
}
2683926839
];
26840-
const finalMatrix = [];
26840+
const testMatrix = [];
2684126841
const packages = files.map(file => {
2684226842
return file.split('/')[1];
2684326843
});
2684426844
const uniquePackages = [... new Set(packages)];
2684526845
uniquePackages.forEach(package => {
2684626846
startingMatrix.forEach(matrixItem => {
26847-
finalMatrix.push({
26847+
testMatrix.push({
2684826848
...matrixItem,
2684926849
package
2685026850
});
2685126851
});
2685226852
});
26853-
const finalMatrixJSON = JSON.stringify(finalMatrix);
26854-
core.info(finalMatrixJSON);
26855-
core.setOutput("matrix", finalMatrixJSON);
26853+
const publishMatrix = [];
26854+
uniquePackages.forEach(package => {
26855+
publishMatrix.push({
26856+
package
26857+
});
26858+
});
26859+
const testMatrixJSON = JSON.stringify(testMatrix);
26860+
core.info("Test Matrix");
26861+
core.info(testMatrixJSON);
26862+
core.setOutput("test-matrix", testMatrixJSON);
26863+
core.info("Publish Matrix");
26864+
core.setOutput("publish-matrix", publishMatrix);
2685626865
} catch(e) {
2685726866
core.error(e);
2685826867
core.setFailed("Could not create matrix");

.github/workflows/lbox-develop.yml

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818
runs-on: ubuntu-latest
1919
outputs:
2020
lbox: ${{ steps.filter.outputs.lbox }}
21-
matrix: ${{ steps.matrix.outputs.matrix }}
21+
test-matrix: ${{ steps.matrix.outputs.test-matrix }}
22+
package-matrix: ${{ steps.matrix.outputs.publish-matrix }}
2223
steps:
2324
- uses: actions/checkout@v4
2425
with:
@@ -42,10 +43,10 @@ jobs:
4243
strategy:
4344
fail-fast: false
4445
matrix:
45-
include: ${{ fromJSON(needs.path-filter.outputs.matrix) }}
46+
include: ${{ fromJSON(needs.path-filter.outputs.test-matrix) }}
4647
concurrency:
47-
group: labelbox-python-${{ inputs.test-env }}-${{ inputs.python-version }}
48-
cancel-in-progress: false
48+
group: lbox-staging-${{ matrix.python-version }}-${{ matrix.package }}
49+
cancel-in-progress: false
4950
steps:
5051
- uses: actions/checkout@v4
5152
with:
@@ -65,8 +66,43 @@ jobs:
6566
- name: Integration
6667
working-directory: libs/${{ matrix.package }}
6768
env:
68-
PYTEST_XDIST_AUTO_NUM_WORKERS: 20
69-
LABELBOX_TEST_API_KEY: ${{ secrets[inputs.api-key] }}
70-
DA_GCP_LABELBOX_API_KEY: ${{ secrets[inputs.da-test-key] }}
71-
LABELBOX_TEST_ENVIRON: ${{ inputs.test-env }}
72-
run: rye run integration
69+
LABELBOX_TEST_API_KEY: ${{ secrets[matrix.api-key] }}
70+
DA_GCP_LABELBOX_API_KEY: ${{ secrets[matrix.da-test-key] }}
71+
LABELBOX_TEST_ENVIRON: 'staging'
72+
run: rye run integration
73+
test-pypi:
74+
runs-on: ubuntu-latest
75+
needs: ['build', 'path-filter']
76+
if: ${{ needs.path-filter.outputs.lbox == 'true' }}
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
include: ${{ fromJSON(needs.path-filter.outputs.package-matrix) }}
81+
environment:
82+
name: Test-PyPI-${{ matrix.package }}
83+
url: 'https://test.pypi.org/p/${{ matrix.package }}'
84+
permissions:
85+
# IMPORTANT: this permission is mandatory for trusted publishing
86+
id-token: write
87+
steps:
88+
- uses: actions/checkout@v4
89+
with:
90+
ref: ${{ github.head_ref }}
91+
- uses: ./.github/actions/python-package-shared-setup
92+
with:
93+
rye-version: ${{ vars.RYE_VERSION }}
94+
python-version: '3.8'
95+
- name: Create build
96+
id: create-build
97+
working-directory: libs/${{ matrix.package }}
98+
run: |
99+
VERSION=$(date +"%Y.%m.%d.%H.%M")
100+
echo "pip install --index-url https://test.pypi.org/simple/ --extra-index-url=https://pypi.org/simple/ ${{ matrix.package }}@$VERSION" >> "$GITHUB_STEP_SUMMARY"
101+
rye version "$VERSION"
102+
rye run toml set --toml-path pyproject.toml project.name ${{ matrix.package }}
103+
rye build
104+
- name: Publish package distributions to Test PyPI
105+
uses: pypa/gh-action-pypi-publish@release/v1
106+
with:
107+
packages-dir: dist/
108+
repository-url: https://test.pypi.org/legacy/

requirements-dev.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bleach==6.1.0
3434
# via nbconvert
3535
cachetools==5.3.3
3636
# via google-auth
37-
certifi==2024.6.2
37+
certifi==2024.7.4
3838
# via pyproj
3939
# via requests
4040
charset-normalizer==3.3.2
@@ -62,7 +62,7 @@ execnet==2.1.1
6262
# via pytest-xdist
6363
executing==2.0.1
6464
# via stack-data
65-
faker==25.9.1
65+
faker==26.0.0
6666
fastjsonschema==2.20.0
6767
# via nbformat
6868
geojson==3.1.0
@@ -73,7 +73,7 @@ gitpython==3.1.43
7373
# via databooks
7474
google-api-core==2.19.1
7575
# via labelbox
76-
google-auth==2.30.0
76+
google-auth==2.31.0
7777
# via google-api-core
7878
googleapis-common-protos==1.63.2
7979
# via google-api-core
@@ -82,7 +82,7 @@ idna==3.7
8282
imagesize==1.4.1
8383
# via labelbox
8484
# via sphinx
85-
importlib-metadata==7.2.1
85+
importlib-metadata==8.0.0
8686
# via jupyter-client
8787
# via nbconvert
8888
# via sphinx
@@ -123,7 +123,7 @@ matplotlib-inline==0.1.7
123123
# via ipython
124124
mistune==3.0.2
125125
# via nbconvert
126-
mypy==1.10.0
126+
mypy==1.10.1
127127
mypy-extensions==1.0.0
128128
# via black
129129
# via mypy
@@ -158,7 +158,7 @@ pexpect==4.9.0
158158
# via ipython
159159
pickleshare==0.7.5
160160
# via ipython
161-
pillow==10.3.0
161+
pillow==10.4.0
162162
# via labelbox
163163
pkgutil-resolve-name==1.3.10
164164
# via jsonschema
@@ -172,7 +172,7 @@ prompt-toolkit==3.0.47
172172
# via ipython
173173
proto-plus==1.24.0
174174
# via google-api-core
175-
protobuf==5.27.1
175+
protobuf==5.27.2
176176
# via google-api-core
177177
# via googleapis-common-protos
178178
# via proto-plus
@@ -185,10 +185,10 @@ pyasn1==0.6.0
185185
# via rsa
186186
pyasn1-modules==0.4.0
187187
# via google-auth
188-
pydantic==2.7.4
188+
pydantic==2.8.2
189189
# via databooks
190190
# via labelbox
191-
pydantic-core==2.18.4
191+
pydantic-core==2.20.1
192192
# via pydantic
193193
pygeotile==1.0.6
194194
# via labelbox
@@ -282,7 +282,7 @@ tinycss2==1.3.0
282282
# via nbconvert
283283
tokenize-rt==5.2.0
284284
# via black
285-
toml-cli==0.6.1
285+
toml-cli==0.7.0
286286
tomli==2.0.1
287287
# via black
288288
# via coverage

requirements.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ babel==2.15.0
2020
# via sphinx
2121
cachetools==5.3.3
2222
# via google-auth
23-
certifi==2024.6.2
23+
certifi==2024.7.4
2424
# via pyproj
2525
# via requests
2626
charset-normalizer==3.3.2
@@ -32,7 +32,7 @@ geojson==3.1.0
3232
# via labelbox
3333
google-api-core==2.19.1
3434
# via labelbox
35-
google-auth==2.30.0
35+
google-auth==2.31.0
3636
# via google-api-core
3737
googleapis-common-protos==1.63.2
3838
# via google-api-core
@@ -41,7 +41,7 @@ idna==3.7
4141
imagesize==1.4.1
4242
# via labelbox
4343
# via sphinx
44-
importlib-metadata==7.2.1
44+
importlib-metadata==8.0.0
4545
# via sphinx
4646
# via typeguard
4747
jinja2==3.1.4
@@ -56,11 +56,11 @@ opencv-python-headless==4.10.0.84
5656
# via labelbox
5757
packaging==24.1
5858
# via sphinx
59-
pillow==10.3.0
59+
pillow==10.4.0
6060
# via labelbox
6161
proto-plus==1.24.0
6262
# via google-api-core
63-
protobuf==5.27.1
63+
protobuf==5.27.2
6464
# via google-api-core
6565
# via googleapis-common-protos
6666
# via proto-plus
@@ -69,9 +69,9 @@ pyasn1==0.6.0
6969
# via rsa
7070
pyasn1-modules==0.4.0
7171
# via google-auth
72-
pydantic==2.7.4
72+
pydantic==2.8.2
7373
# via labelbox
74-
pydantic-core==2.18.4
74+
pydantic-core==2.20.1
7575
# via pydantic
7676
pygeotile==1.0.6
7777
# via labelbox

0 commit comments

Comments
 (0)