Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.md: Update examples to use supported Python versions #253

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ For example:
jobs:
build:
docker:
- image: cimg/python:3.8
- image: cimg/python:3.12
steps:
- checkout
- run: python --version
```

In the above example, the CircleCI Python Docker image is used as the primary container.
More specifically, the tag `3.8` is used meaning the version of Python will be Python v3.8.
More specifically, the tag `3.12` is used meaning the version of Python will be Python v3.8.
You can now use Python within the steps for this job.


Expand All @@ -68,7 +68,7 @@ The Node.js variant can be used by appending `-node` to the end of an existing `
jobs:
build:
docker:
- image: cimg/python:3.7-node
- image: cimg/python:3.11-node
steps:
- checkout
- run: python --version
Expand All @@ -89,7 +89,7 @@ orbs:
jobs:
build:
docker:
- image: cimg/python:3.7-browsers
- image: cimg/python:3.11-browsers
steps:
- browser-tools/install-browser-tools
- checkout
Expand All @@ -109,12 +109,12 @@ cimg/python:<python-version>[-variant]
```

`<python-version>` - The version of Python to use.
This can be a full SemVer point release (such as `3.8.1`) or just the minor release (such as `3.8`).
This can be a full SemVer point release (such as `3.12.1`) or just the minor release (such as `3.12`).
If you use the minor release tag, it will automatically point to future patch updates as they are released by the Python project.
For example, the tag `3.8` points to Python v3.8.5 now, but when the next release comes out, it will point to Python v3.8.6.
For example, the tag `3.12` points to Python v3.12.7 now, but when the next release comes out, it will point to Python v3.12.8.

`[-variant]` - Variant tags, if available, can optionally be used.
For example, the Node.js variant could be used like this: `cimg/python:3.7-node`.
For example, the Node.js variant could be used like this: `cimg/python:3.11-node`.


## Development
Expand Down Expand Up @@ -154,19 +154,19 @@ git clone --recurse-submodules [email protected]:CircleCI-Public/cimg-python.git
### Generating Dockerfiles

Dockerfiles can be generated for a specific Python version using the `gen-dockerfiles.sh` script.
For example, to generate the Dockerfile for Python v3.7.7, you would run the following from the root of the repo:
For example, to generate the Dockerfile for Python v3.11.10, you would run the following from the root of the repo:

```bash
./shared/gen-dockerfiles.sh 3.7.7
./shared/gen-dockerfiles.sh 3.11.10
```

The generated Dockerfile will be located at `./3.7/Dockefile`.
The generated Dockerfile will be located at `./3.11/Dockefile`.
To build this image locally and try it out, you can run the following:

```bash
cd 3.7
docker build -t test/python:3.7.7 .
docker run -it test/python:3.7.7 bash
cd 3.11
docker build -t test/python:3.11.10 .
docker run -it test/python:3.11.10 bash
```

### Building the Dockerfiles
Expand Down