You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .circleci/config.yml
+18-11Lines changed: 18 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,41 @@
1
1
version: 2.1
2
2
3
3
orbs:
4
-
# The node orb contains a set of prepackaged circleci configuration you can use
5
-
#Orbs commands and jobs help you with common scripting around a language/tool
4
+
# The python orb contains a set of prepackaged circleci configuration you can use repeatedly in your configurations files
5
+
#Orb commands and jobs help you with common scripting around a language/tool
6
6
# so you dont have to copy and paste it everywhere.
7
+
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python
7
8
python: circleci/python@1.2
8
9
9
10
workflows:
10
-
sample:
11
+
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
12
+
# Inside the workflow, you define the jobs you want to run.
13
+
# For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows
11
14
jobs:
12
15
- build-and-test
13
16
17
+
14
18
jobs:
15
-
build-and-test:
19
+
build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do!
20
+
# These next lines defines a docker executors: https://circleci.com/docs/2.0/executor-types/
21
+
# You can specify an image from dockerhub or use one of the convenience images from CircleCI's Developer Hub
22
+
# A list of available CircleCI docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python
23
+
# The executor is the environment in which the steps below will be executed - below will use a python 3.9 container
24
+
# Change the version below to your required version of python
16
25
docker:
17
-
# Be sure to change this to major.minor version of python you need to support.
18
-
- image: cimg/python:3.9
19
-
# Checkout the code as the first step.
26
+
- image: cimg/python:3.8
27
+
# Checkout the code as the first step. This is a dedicated CircleCI step.
20
28
# The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default.
21
-
# Here we're making sure we use just use the global env pip. By default it uses the project root's requirements.txt.
29
+
# Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt.
22
30
# Then run your tests!
23
31
# CircleCI will report the results back to your VCS provider.
24
32
steps:
25
33
- checkout
26
34
- python/install-packages:
27
35
pkg-manager: pip
28
-
# app-dir: ~/project/package-directory/ If you're requirements.txt isn't in the root directory.
29
-
pip-dependency-file: test-requirements.txt # if you have a different name for your requirements file, maybe one that combines your runtime and test requirements.
36
+
# app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
37
+
#pip-dependency-file: test-requirements.txt # if you have a different name for your requirements file, maybe one that combines your runtime and test requirements.
30
38
- run:
31
39
name: Run tests
32
40
# This assumes pytest is installed via the install-package step above
The sample app here is designed to demonstrate one of the most simple python CircleCI workflows. Here in this application we're simply installing dev python packages and then running tests with pytest.
9
+
The sample app here is designed to demonstrate a simple python CircleCI workflows.
10
+
11
+
In this sample pipeline, we're simply installing dev python packages, with the [CircleCI python orb](https://circleci.com/developer/orbs/orb/circleci/python), and then running tests with pytest.
8
12
9
13
## Getting Started
10
14
11
-
You can see this CICD pipeline running live on CircleCI: https://app.circleci.com/pipelines/github/dsayling/sample-flask?branch=main
15
+
You can see the CI pipeline for this application running [live on CircleCI](https://app.circleci.com/pipelines/github/dsayling/sample-flask?branch=main).
16
+
17
+
Here you can find the CircleCI configuration file, aka [config.yml](https://github.com/dsayling/sample-flask/blob/main/.circleci/config.yml).
12
18
13
-
TODO: Show config here
19
+
## Adapting to your workflow
14
20
15
-
## Adapting your workflow
21
+
If you would like to copy the [config.yml](https://github.com/dsayling/sample-flask/blob/main/.circleci/config.yml), be sure to follow the steps below to ensure the config.yml works for your project:
16
22
17
-
Something something about copying config file into your project
18
-
Link to convience images for other versions.
19
-
Set the expecations for the user copying the config and how they can use it.
23
+
* Find the definition of the executor and ensure the correct version of python is used for your application via the convenience image tag on the [CircleCI Developer Hub](https://circleci.com/developer/images/image/cimg/python).
24
+
* Find the `install-packages` command in the configuration file, here you can define an alternative `requirements.txt` file, if necessary.
25
+
* The `install-packages` command will effective run `pip install requirements.txt` as a part of your config, while automatically caching those dependencies for faster CI runs later.
26
+
* Find the `Run Tests` step and include any additional runtime arguments necessary for `pytest` or update it to the testing tool you're using, e.g. `nosetests`.
20
27
21
28
## Build and Test Locally
22
29
23
30
If you would like to try this application out locally, you can find runtime instructions below.
0 commit comments