Skip to content

Commit 745f711

Browse files
committed
fix(build): introduce poetry as build tool
This commit updates the project to use poetry as a tool for building and publishing the project. Signed-off-by: Phil Adams <[email protected]>
1 parent dcd2d0f commit 745f711

File tree

6 files changed

+849
-50
lines changed

6 files changed

+849
-50
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ jobs:
5555
with:
5656
python-version: ${{ matrix.python-version }}
5757

58+
- name: Install Poetry
59+
run: |
60+
apt install pipx
61+
pipx ensurepath --global
62+
pipx install poetry
63+
5864
- name: Build & Test
5965
run: make ci
6066

.github/workflows/publish.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@ jobs:
2525
uses: actions/setup-python@v5
2626
with:
2727
python-version: 3.13
28+
29+
- name: Install Poetry
30+
run: |
31+
apt install pipx
32+
pipx ensurepath --global
33+
pipx install poetry
2834
2935
- name: Build and publish distribution
3036
env:
31-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
37+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
3238
run: |
3339
make ci
3440
make publish-release

.secrets.baseline

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-01-09T22:39:35Z",
6+
"generated_at": "2025-05-19T21:05:36Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -82,19 +82,29 @@
8282
"hashed_secret": "a2190c299b60e882d9fb33736d5e6ab6ffe42708",
8383
"is_secret": false,
8484
"is_verified": false,
85-
"line_number": 939,
85+
"line_number": 948,
8686
"type": "Secret Keyword",
8787
"verified_result": null
8888
},
8989
{
9090
"hashed_secret": "cf4d2385b84329a52ca542285b93d9c4618420df",
9191
"is_secret": false,
9292
"is_verified": false,
93-
"line_number": 1618,
93+
"line_number": 1627,
9494
"type": "Secret Keyword",
9595
"verified_result": null
9696
}
9797
],
98+
"poetry.lock": [
99+
{
100+
"hashed_secret": "6888d6c14621a80f6ed98f5ebfe99de740de3f1c",
101+
"is_secret": false,
102+
"is_verified": false,
103+
"line_number": 796,
104+
"type": "Hex High Entropy String",
105+
"verified_result": null
106+
}
107+
],
98108
"test/integration/test_catalog_management_v1_old.py": [
99109
{
100110
"hashed_secret": "178fb14190d81e76cb90c5f64b7e4655e24f621c",
@@ -120,15 +130,15 @@
120130
"hashed_secret": "a2190c299b60e882d9fb33736d5e6ab6ffe42708",
121131
"is_secret": false,
122132
"is_verified": false,
123-
"line_number": 1148,
133+
"line_number": 1223,
124134
"type": "Secret Keyword",
125135
"verified_result": null
126136
},
127137
{
128138
"hashed_secret": "cf4d2385b84329a52ca542285b93d9c4618420df",
129139
"is_secret": false,
130140
"is_verified": false,
131-
"line_number": 1702,
141+
"line_number": 1777,
132142
"type": "Secret Keyword",
133143
"verified_result": null
134144
}
@@ -270,31 +280,31 @@
270280
"hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030",
271281
"is_secret": false,
272282
"is_verified": false,
273-
"line_number": 1575,
283+
"line_number": 1574,
274284
"type": "Secret Keyword",
275285
"verified_result": null
276286
},
277287
{
278288
"hashed_secret": "cf4d2385b84329a52ca542285b93d9c4618420df",
279289
"is_secret": false,
280290
"is_verified": false,
281-
"line_number": 4055,
291+
"line_number": 4057,
282292
"type": "Secret Keyword",
283293
"verified_result": null
284294
},
285295
{
286296
"hashed_secret": "469f62fa9e1c6afe62e8808180668934ee548e8f",
287297
"is_secret": false,
288298
"is_verified": false,
289-
"line_number": 9511,
299+
"line_number": 9921,
290300
"type": "Secret Keyword",
291301
"verified_result": null
292302
},
293303
{
294304
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
295305
"is_secret": false,
296306
"is_verified": false,
297-
"line_number": 10632,
307+
"line_number": 11125,
298308
"type": "Secret Keyword",
299309
"verified_result": null
300310
}

Makefile

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
1-
# This makefile is used to make it easier to get the project set up
2-
# to be ready for development work in the local sandbox.
3-
# example: "make setup"
4-
51
PYTHON=python
62
LINT=black
3+
POETRY=poetry
74
LINT_DIRS=ibm_platform_services test/unit test/integration examples
85

9-
setup: deps dev-deps install-project
10-
11-
all: upgrade-pip setup test-unit lint
6+
all: upgrade-pip deps test-unit lint
127

138
ci: all
149

15-
publish-release: publish-deps build-dist publish-dist
10+
publish-release: build-dist publish-dist
1611

1712
upgrade-pip:
1813
${PYTHON} -m pip install --upgrade pip
1914

2015
deps:
21-
${PYTHON} -m pip install .
22-
23-
dev-deps:
24-
${PYTHON} -m pip install .[dev]
16+
${POETRY} install
2517

2618
detect-secrets:
2719
detect-secrets scan --update .secrets.baseline
2820
detect-secrets audit .secrets.baseline
2921

30-
publish-deps:
31-
${PYTHON} -m pip install .[publish]
32-
33-
install-project:
34-
${PYTHON} -m pip install -e .
35-
3622
test: test-unit test-int
3723

3824
test-unit:
@@ -52,9 +38,8 @@ lint-fix:
5238
${LINT} ${LINT_DIRS}
5339

5440
build-dist:
55-
rm -fr dist
56-
${PYTHON} -m build
41+
${POETRY} build --clean
5742

58-
# This target requires the TWINE_PASSWORD env variable to be set to the user's pypi.org API token.
43+
# This target requires the POETRY_PYPI_TOKEN_PYPI env variable to be set to the user's pypi.org API token.
5944
publish-dist:
60-
TWINE_USERNAME=__token__ ${PYTHON} -m twine upload --non-interactive --verbose dist/*
45+
${POETRY} publish --dry-run

0 commit comments

Comments
 (0)