From 183138cf628c3c4270c6e9482439f89be17a6eb1 Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Thu, 23 Dec 2021 23:53:11 +0800 Subject: [PATCH 01/10] Add .circleci/config.yml --- .circleci/config.yml | 47 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7dc7f85 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,47 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/2.0/configuration-reference +version: 2.1 + +# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. +# See: https://circleci.com/docs/2.0/orb-intro/ +orbs: + # The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files + # Orb commands and jobs help you with common scripting around a language/tool + # so you dont have to copy and paste it everywhere. + # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python + python: circleci/python@1.2 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/2.0/configuration-reference/#jobs +jobs: + build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do! + # These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/ + # You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub + # A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python + # The executor is the environment in which the steps below will be executed - below will use a python 3.8 container + # Change the version below to your required version of python + docker: + - image: cimg/python:3.8 + # Checkout the code as the first step. This is a dedicated CircleCI step. + # The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default. + # Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt. + # Then run your tests! + # CircleCI will report the results back to your VCS provider. + steps: + - checkout + - python/install-packages: + pkg-manager: pip + # app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory. + # 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. + - run: + name: Run tests + # This assumes pytest is installed via the install-package step above + command: pytest + +# Invoke jobs via workflows +# See: https://circleci.com/docs/2.0/configuration-reference/#workflows +workflows: + sample: # This is the name of the workflow, feel free to change it to better match your workflow. + # Inside the workflow, you define the jobs you want to run. + jobs: + - build-and-test From 5cb3c568a86296ad0d7abb883738fc04b024d86f Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Thu, 23 Dec 2021 23:59:06 +0800 Subject: [PATCH 02/10] Update CircleCI to use alog setup.py requirements --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7dc7f85..5978049 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,10 +29,10 @@ jobs: # CircleCI will report the results back to your VCS provider. steps: - checkout - - python/install-packages: - pkg-manager: pip - # app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory. - # 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. + - run: + name: Install test packages + command: | + sudo pip install . - run: name: Run tests # This assumes pytest is installed via the install-package step above From 5be7007bec88990312735900f89896d88c5b9f84 Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Fri, 24 Dec 2021 00:07:02 +0800 Subject: [PATCH 03/10] Try ensurepip --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5978049..c2be91f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,8 @@ jobs: - run: name: Install test packages command: | - sudo pip install . + sudo python -m ensurepip + sudo pip install -e . - run: name: Run tests # This assumes pytest is installed via the install-package step above From aaf93e22d181a0d8fe118730ced030b1dc337103 Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Fri, 24 Dec 2021 00:08:41 +0800 Subject: [PATCH 04/10] Try no sudo --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c2be91f..58d3281 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,8 +32,8 @@ jobs: - run: name: Install test packages command: | - sudo python -m ensurepip - sudo pip install -e . + python -m ensurepip + pip install -e . - run: name: Run tests # This assumes pytest is installed via the install-package step above From 3aa94dd98d65290096f6711e2388b1bcf6768698 Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Fri, 24 Dec 2021 00:11:22 +0800 Subject: [PATCH 05/10] Use tox --- .circleci/config.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 58d3281..8ce6067 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,13 +31,11 @@ jobs: - checkout - run: name: Install test packages - command: | - python -m ensurepip - pip install -e . + command: pip install tox - run: name: Run tests # This assumes pytest is installed via the install-package step above - command: pytest + command: tox # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows From 62746a25920838f2686f8fafbef065485236e0a3 Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Fri, 24 Dec 2021 00:19:20 +0800 Subject: [PATCH 06/10] Try circleci/python:latest --- .circleci/config.yml | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8ce6067..c85851d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,33 +14,19 @@ orbs: # Define a job to be invoked later in a workflow. # See: https://circleci.com/docs/2.0/configuration-reference/#jobs jobs: - build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do! - # These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/ - # You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub - # A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python - # The executor is the environment in which the steps below will be executed - below will use a python 3.8 container - # Change the version below to your required version of python + toxify: docker: - - image: cimg/python:3.8 - # Checkout the code as the first step. This is a dedicated CircleCI step. - # The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default. - # Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt. - # Then run your tests! - # CircleCI will report the results back to your VCS provider. + - image: circleci/python:latest steps: - checkout - run: - name: Install test packages command: pip install tox - run: - name: Run tests - # This assumes pytest is installed via the install-package step above command: tox # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. + build-and-test: jobs: - - build-and-test + - toxify From c2763e583405739796e9d8e35399bb3a628c3016 Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Fri, 24 Dec 2021 00:29:01 +0800 Subject: [PATCH 07/10] Try tox-pyenv --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c85851d..3f81c0d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,9 @@ jobs: steps: - checkout - run: - command: pip install tox + command: | + pip install tox tox-pyenv + pyenv install 2.7.18 3.6.15 3.7.12 3.8/12 3.9.9 - run: command: tox From 89b26bd7cfd4c9fd21ea98a13a0c4345f3a7ffff Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Fri, 24 Dec 2021 00:30:55 +0800 Subject: [PATCH 08/10] Using cimg/python:3.8 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f81c0d..672d8bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ orbs: jobs: toxify: docker: - - image: circleci/python:latest + - image: cimg/python:3.8 steps: - checkout - run: From cbf5acd38695d2585ee6f4a47622d10219017440 Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Fri, 24 Dec 2021 00:32:40 +0800 Subject: [PATCH 09/10] Fix pyenv command --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 672d8bc..b5aa7ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,7 @@ jobs: - run: command: | pip install tox tox-pyenv - pyenv install 2.7.18 3.6.15 3.7.12 3.8/12 3.9.9 + pyenv install 2.7.18 3.6.15 3.7.12 3.8.12 3.9.9 - run: command: tox From 778706838b3bedc10a8988677c59e4aab675f38f Mon Sep 17 00:00:00 2001 From: Keith Yang Date: Fri, 24 Dec 2021 00:35:42 +0800 Subject: [PATCH 10/10] Split pyenv versions --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b5aa7ff..7690dd8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,11 @@ jobs: - run: command: | pip install tox tox-pyenv - pyenv install 2.7.18 3.6.15 3.7.12 3.8.12 3.9.9 + pyenv install 2.7.18 + pyenv install 3.6.15 + pyenv install 3.7.12 + pyenv install 3.8.12 + pyenv install 3.9.9 - run: command: tox