Skip to content

Commit a8577be

Browse files
authored
Update python image version (#37)
* Update python image version * Update .gitignore * Update python version and add note * Install poetry This is not included in cimg/python:3.13 * Add path to poetry install * Install poetry using a different approach * Swap poetry source for poetry config * Switch source for config command
1 parent 0da0477 commit a8577be

10 files changed

+50
-22
lines changed

.circleci/test-deploy.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
test-set_env_vars_for_pip:
2525
docker:
26-
- image: cimg/python:3.9
26+
- image: cimg/python:3.13
2727
resource_class: small
2828
steps:
2929
- checkout
@@ -46,7 +46,7 @@ jobs:
4646
4747
test-pip_install_package_example:
4848
docker:
49-
- image: cimg/python:3.9
49+
- image: cimg/python:3.13
5050
steps:
5151
- checkout
5252
- cloudsmith-python/set_env_vars_for_pip:
@@ -55,7 +55,7 @@ jobs:
5555

5656
test-pip_install_requirements_example:
5757
docker:
58-
- image: cimg/python:3.9
58+
- image: cimg/python:3.13
5959
steps:
6060
- checkout
6161
- run: echo "simplepkg==0.0.1" > requirements.txt
@@ -65,7 +65,7 @@ jobs:
6565

6666
test-pipenv_install_package_example:
6767
docker:
68-
- image: cimg/python:3.9
68+
- image: cimg/python:3.13
6969
steps:
7070
- checkout
7171
- run: python -m ensurepip --upgrade
@@ -83,13 +83,13 @@ jobs:
8383
[packages]
8484
simplepkg = "0.4.3"
8585
[requires]
86-
python_version = "3.9"
86+
python_version = "3.13"
8787
EOT
8888
- run: pipenv install
8989

9090
test-set_env_vars_for_poetry:
9191
docker:
92-
- image: cimg/python:3.9
92+
- image: cimg/python:3.13
9393
resource_class: small
9494
steps:
9595
- checkout
@@ -112,10 +112,18 @@ jobs:
112112
113113
test-upload_package_using_poetry:
114114
docker:
115-
- image: cimg/python:3.9
115+
- image: cimg/python:3.13
116116
resource_class: small
117117
steps:
118118
- checkout
119+
- run:
120+
name: Install Poetry using official installer
121+
command: |
122+
curl -sSL https://install.python-poetry.org | python3 -
123+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $BASH_ENV
124+
source $BASH_ENV
125+
poetry --version
126+
poetry config --list
119127
- cloudsmith-python/set_env_vars_for_poetry:
120128
repository: circleci-orb-testing
121129
- run:
@@ -124,16 +132,25 @@ jobs:
124132
command: |
125133
poetry new poetry-package
126134
cd poetry-package
127-
poetry source add --priority=default cloudsmith-source-url https://python.cloudsmith.io/financial-times/circleci-orb-testing/
135+
# Configure the repository for publishing (not just as a source)
136+
poetry config repositories.cloudsmith-source-url https://python.cloudsmith.io/financial-times/circleci-orb-testing/
128137
poetry config http-basic.cloudsmith-source-url $CLOUDSMITH_POETRY_USERNAME $CLOUDSMITH_POETRY_PASSWORD
129138
poetry build
130139
poetry publish -r cloudsmith-source-url
131140
132141
test-poetry_install_packages_example:
133142
docker:
134-
- image: cimg/python:3.9
143+
- image: cimg/python:3.13
135144
steps:
136145
- checkout
146+
- run:
147+
name: Install Poetry using official installer
148+
command: |
149+
curl -sSL https://install.python-poetry.org | python3 -
150+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $BASH_ENV
151+
source $BASH_ENV
152+
poetry --version
153+
poetry config --list
137154
- cloudsmith-python/set_env_vars_for_poetry:
138155
repository: circleci-orb-testing
139156
- run:
@@ -142,15 +159,16 @@ jobs:
142159
command: |
143160
poetry new poetry-package
144161
cd poetry-package
145-
poetry source add --priority=default cloudsmith-source-url https://packages.ft.com/basic/circleci-orb-testing/python/simple/
162+
# Configure the repository for publishing (not just as a source)
163+
poetry config repositories.cloudsmith-source-url https://python.cloudsmith.io/financial-times/circleci-orb-testing/
146164
poetry config http-basic.cloudsmith-source-url $CLOUDSMITH_POETRY_USERNAME $CLOUDSMITH_POETRY_PASSWORD
147165
poetry add -q simplepkg
148166
poetry install
149167
poetry show
150168
151169
test-configure_pip_example:
152170
docker:
153-
- image: cimg/python:3.9
171+
- image: cimg/python:3.13
154172
steps:
155173
- checkout
156174
- run: echo "simplepkg==0.4.3" > requirements.txt
@@ -161,7 +179,7 @@ jobs:
161179

162180
test-set_env_vars_for_twine:
163181
docker:
164-
- image: cimg/python:3.9
182+
- image: cimg/python:3.13
165183
resource_class: small
166184
steps:
167185
- checkout
@@ -189,7 +207,7 @@ jobs:
189207
190208
test-upload_package_using_twine:
191209
docker:
192-
- image: cimg/python:3.9
210+
- image: cimg/python:3.13
193211
resource_class: small
194212
steps:
195213
- checkout
@@ -218,7 +236,7 @@ jobs:
218236

219237
test-upload_package_using_cli:
220238
docker:
221-
- image: cimg/python:3.9
239+
- image: cimg/python:3.13
222240
resource_class: small
223241
steps:
224242
- checkout

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ orb.yml
55

66
.circleci/simplepkg-py/dist
77
.circleci/simplepkg-py/simplepkg.egg-info
8+
9+
# Folders
10+
/bin
11+
/lib

src/examples/configure_pip_index_url.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ usage:
77
jobs:
88
build:
99
docker:
10-
- image: cimg/python:3.9
10+
- image: cimg/python:3.13
1111
steps:
1212
- checkout
1313
- run: python -m ensurepip --upgrade

src/examples/pip_install_package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ usage:
77
jobs:
88
build:
99
docker:
10-
- image: cimg/python:3.9
10+
- image: cimg/python:3.13
1111
steps:
1212
- checkout
1313
- run: python -m ensurepip --upgrade

src/examples/pip_install_requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ usage:
77
jobs:
88
build:
99
docker:
10-
- image: cimg/python:3.9
10+
- image: cimg/python:3.13
1111
steps:
1212
- checkout
1313
- run: python -m ensurepip --upgrade

src/examples/pipenv_install_packages.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
description: >
22
Install a package from Cloudsmith using pipenv. The source URL in the Pipfile must reference $CLOUDSMITH_PIP_INDEX_URL.
3+
Note: Ensure the python_version in your Pipfile matches the Python version in your Docker image to avoid installation errors.
34
usage:
45
version: 2.1
56
orbs:
67
cloudsmith-python: ft-circleci-orbs/[email protected]
78
jobs:
89
build:
910
docker:
10-
- image: cimg/python:3.9
11+
- image: cimg/python:3.13
1112
steps:
1213
- checkout
1314
- run: python -m ensurepip --upgrade

src/examples/poetry_install_packages.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@ description: >
22
Install a package from Cloudsmith using poetry.
33
The source URL in pyproject.toml must be set to https://packages.ft.com/basic/your-repository-id/python/simple/
44
and the corresponding cloudsmith-source-url parameter is an arbitrary label for the Cloudsmith Source URL.
5+
Note: Ensure the Python version requirement in your pyproject.toml matches the Python version in your Docker image.
56
usage:
67
version: 2.1
78
orbs:
89
cloudsmith-python: ft-circleci-orbs/[email protected]
910
jobs:
1011
build:
1112
docker:
12-
- image: cimg/python:3.9
13+
- image: cimg/python:3.13
1314
steps:
1415
- checkout
16+
- run: python -m ensurepip --upgrade
17+
- run: python -m pip install poetry --upgrade --user
1518
- cloudsmith-python/set_env_vars_for_poetry:
1619
repository: your-repository-id
1720
- run:

src/examples/upload_package_using_cli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ usage:
77
jobs:
88
build:
99
docker:
10-
- image: cimg/python:3.9
10+
- image: cimg/python:3.13
1111
steps:
1212
- checkout
1313
- run: python -m ensurepip --upgrade

src/examples/upload_package_using_poetry.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ usage:
99
jobs:
1010
build:
1111
docker:
12-
- image: cimg/python:3.9
12+
- image: cimg/python:3.13
1313
steps:
1414
- checkout
15+
- run: python -m ensurepip --upgrade
16+
- run: python -m pip install poetry --upgrade --user
1517
- cloudsmith-python/set_env_vars_for_poetry:
1618
repository: your-repository-id
1719
- run:

src/examples/upload_package_using_twine.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ usage:
77
jobs:
88
build:
99
docker:
10-
- image: cimg/python:3.9
10+
- image: cimg/python:3.13
1111
steps:
1212
- checkout
1313
- run: python -m ensurepip --upgrade

0 commit comments

Comments
 (0)