Commit 55453cec authored by Federico Falconieri's avatar Federico Falconieri
Browse files

Merge branch 'docspyversion' into 'main'

docs: pinning python version

Closes #66

See merge request just-ci/templates!128
parents 8b08ed0c cbafc2b6
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -80,10 +80,19 @@ is an example `.gitlab-ci.yml` importing the python template:
---
include:
  - remote: https://just-ci.gitlab.io/jobs/v6.11.0/templates/python.yml

variables:
  PYVERSION: 3.9-slim
```

The above is a template for Python projects. Other templates can be found in
`templates/`, for example:
The above is a template for Python projects. Here we also add a variable to
specify the python version your project uses. If you omit this variable, all CI
jobs are run using the latest python version. This may introduce unexpected
results, so this variable is highly recommended. You can also omit `-slim` to
use the full debian image, or replace it with `-alpine` if you intend to support
an alpine based image.

Other templates can be found in `templates/`, for example:

- Python projects with a `Dockerfile`: `templates/container/python.yml`. This
  template will use your `Dockerfile` to create an image in which we run tests.
@@ -100,6 +109,9 @@ you want you can always disable specific jobs with custom rules.
include:
  - remote: https://just-ci.gitlab.io/jobs/v6.11.0/templates/python.yml

variables:
  PYVERSION: 3.9-slim

python:pytest:
  rules:
    when: never
@@ -118,7 +130,10 @@ there has been a breaking change in `master`, use an older tag like this:
```yaml
---
include:
  - remote: https://just-ci.gitlab.io/jobs/v3.19.2/python/pylint.yml
  - remote: https://just-ci.gitlab.io/jobs/v5.1.0/python/pylint.yml

variables:
  PYVERSION: 3.7-slim
```

# Monorepo (multiple Dockerfiles) or polyrepo (one Dockerfile)