From 3e8c1759105d6c28c04dc05fe3ab3c8b3a0f6e12 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 18 Aug 2021 09:44:50 +0200 Subject: [PATCH 01/30] =?UTF-8?q?S=C3=A9pare=20le=20job=20test-python=20du?= =?UTF-8?q?=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 65c7cc31f5..75e743cc77 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,9 +37,25 @@ jobs: - run: name: Run tests - command: | - pytest `circleci tests glob "tests/**/[^_]*.py" | circleci tests split` - openfisca test `circleci tests glob "tests/**/*.{yaml,yml}" | circleci tests split` + command: openfisca test `circleci tests glob "tests/**/*.{yaml,yml}" | circleci tests split` + + test-python: + docker: + - image: python:3.7 + + steps: + - checkout + + - restore_cache: + key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + + - run: + name: Avtivate virtualenv + command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV + + - run: + name: Run Python tests + command: pytest `circleci tests glob "tests/**/[^_]*.py" | circleci tests split` lint_yaml_files: docker: @@ -155,6 +171,9 @@ workflows: jobs: - check_version_and_changelog - build + - test-python: + requires: + - build - test_api: requires: - build @@ -169,6 +188,7 @@ workflows: - check_version_and_changelog - build - test_api + - test-python - lint_yaml_files - lint_python_files filters: From 12eb901e1b6ee111c77b72561bfafabe91d4c107 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 18 Aug 2021 09:59:18 +0200 Subject: [PATCH 02/30] =?UTF-8?q?S=C3=A9pare=20le=20job=20test-yaml=20du?= =?UTF-8?q?=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 52 +++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 75e743cc77..f366e9d921 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,6 @@ version: 2 jobs: build: - parallelism: 2 # Speed up the tests, while letting two containers available for other builds. docker: - image: python:3.7 @@ -35,10 +34,6 @@ jobs: paths: - dist - - run: - name: Run tests - command: openfisca test `circleci tests glob "tests/**/*.{yaml,yml}" | circleci tests split` - test-python: docker: - image: python:3.7 @@ -57,7 +52,26 @@ jobs: name: Run Python tests command: pytest `circleci tests glob "tests/**/[^_]*.py" | circleci tests split` - lint_yaml_files: + test-yaml: + parallelism: 2 # Speed up the yaml tests, while letting two containers available for other jobs. + docker: + - image: python:3.7 + + steps: + - checkout + + - restore_cache: + key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + + - run: + name: Avtivate virtualenv + command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV + + - run: + name: Run YAML tests + command: openfisca test `circleci tests glob "tests/**/*.{yaml,yml}" | circleci tests split` + + test_api: docker: - image: python:3.7 @@ -73,11 +87,11 @@ jobs: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV - run: - name: Lint files + name: Test the Web API command: | - .circleci/lint-changed-yaml-tests.sh + .circleci/test-api.sh - lint_python_files: + lint_yaml_files: docker: - image: python:3.7 @@ -95,10 +109,9 @@ jobs: - run: name: Lint files command: | - make check-syntax-errors check-style - .circleci/lint-changed-python-files.sh + .circleci/lint-changed-yaml-tests.sh - test_api: + lint_python_files: docker: - image: python:3.7 @@ -114,9 +127,10 @@ jobs: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV - run: - name: Test the Web API + name: Lint files command: | - .circleci/test-api.sh + make check-syntax-errors check-style + .circleci/lint-changed-python-files.sh check_version_and_changelog: docker: @@ -174,9 +188,12 @@ workflows: - test-python: requires: - build - - test_api: + - test-yaml: requires: - - build + - build + - test_api: + requires: + - build - lint_yaml_files: requires: - build @@ -187,8 +204,9 @@ workflows: requires: - check_version_and_changelog - build - - test_api - test-python + - test-yaml + - test_api - lint_yaml_files - lint_python_files filters: From 6cb6661f88d8f657ecfffa5ef831eb9b804ffe40 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 18 Aug 2021 10:10:55 +0200 Subject: [PATCH 03/30] Regroupe les jobs de linting --- .circleci/config.yml | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f366e9d921..2cbb66a872 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -91,27 +91,7 @@ jobs: command: | .circleci/test-api.sh - lint_yaml_files: - docker: - - image: python:3.7 - - steps: - - checkout - - - restore_cache: - key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - - - run: - name: Activate virtualenv - command: | - echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV - - - run: - name: Lint files - command: | - .circleci/lint-changed-yaml-tests.sh - - lint_python_files: + lint_files: docker: - image: python:3.7 @@ -131,6 +111,7 @@ jobs: command: | make check-syntax-errors check-style .circleci/lint-changed-python-files.sh + .circleci/lint-changed-yaml-tests.sh check_version_and_changelog: docker: @@ -194,10 +175,7 @@ workflows: - test_api: requires: - build - - lint_yaml_files: - requires: - - build - - lint_python_files: + - lint_files: requires: - build - deploy: @@ -207,8 +185,7 @@ workflows: - test-python - test-yaml - test_api - - lint_yaml_files - - lint_python_files + - lint_files filters: branches: only: master From 199e071291066ab9919d5e1be879649a45991da0 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 18 Aug 2021 10:23:51 +0200 Subject: [PATCH 04/30] =?UTF-8?q?Ajoute=20des=20d=C3=A9pendances=20au=20jo?= =?UTF-8?q?b=20check=5Fversion=5Fand=5Fchangelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2cbb66a872..bf64800fe2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -164,7 +164,6 @@ workflows: version: 2 build_and_deploy: jobs: - - check_version_and_changelog - build - test-python: requires: @@ -178,6 +177,12 @@ workflows: - lint_files: requires: - build + - check_version_and_changelog: + requires: + - build + - test-python + - test-yaml + - lint_files - deploy: requires: - check_version_and_changelog From 256e197dd9f97187efaa9849f8e9023dc8b9ee08 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 18 Aug 2021 15:21:34 +0200 Subject: [PATCH 05/30] Corrige typos --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bf64800fe2..ba38c9153b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,7 +45,7 @@ jobs: key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - run: - name: Avtivate virtualenv + name: Activate virtualenv command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV - run: @@ -64,7 +64,7 @@ jobs: key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - run: - name: Avtivate virtualenv + name: Activate virtualenv command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV - run: From dae2772109cb420840ea2ef792cb412c1dd31816 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 18 Aug 2021 16:50:24 +0200 Subject: [PATCH 06/30] Ajoute explication du job test-python --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ba38c9153b..e80fd2510e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: paths: - dist - test-python: + test-python: # Python tests are separated from YAML tests, because the latter take longer. This would allow Python tests to use any other available container and yield it, once finished, to another job instead of counting only on the two containers assigned to the YAML tests. docker: - image: python:3.7 From 1f7b8caaac787ce59b4318b423b7779c6eec6735 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 20 Aug 2021 14:24:19 +0200 Subject: [PATCH 07/30] Unify job names --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e80fd2510e..fd17e61306 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: paths: - dist - test-python: # Python tests are separated from YAML tests, because the latter take longer. This would allow Python tests to use any other available container and yield it, once finished, to another job instead of counting only on the two containers assigned to the YAML tests. + test_python: # Python tests are separated from YAML tests, because the latter take longer. This would allow Python tests to use any other available container and yield it, once finished, to another job instead of counting only on the two containers assigned to the YAML tests. docker: - image: python:3.7 @@ -52,7 +52,7 @@ jobs: name: Run Python tests command: pytest `circleci tests glob "tests/**/[^_]*.py" | circleci tests split` - test-yaml: + test_yaml: parallelism: 2 # Speed up the yaml tests, while letting two containers available for other jobs. docker: - image: python:3.7 @@ -165,10 +165,10 @@ workflows: build_and_deploy: jobs: - build - - test-python: + - test_python: requires: - build - - test-yaml: + - test_yaml: requires: - build - test_api: @@ -180,15 +180,15 @@ workflows: - check_version_and_changelog: requires: - build - - test-python - - test-yaml + - test_python + - test_yaml - lint_files - deploy: requires: - check_version_and_changelog - build - - test-python - - test-yaml + - test_python + - test_yaml - test_api - lint_files filters: From 95b1c16bdb11dba903a0e331d5c8417a1a8c78c4 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 20 Aug 2021 15:24:17 +0200 Subject: [PATCH 08/30] =?UTF-8?q?S=C3=A9pare=20le=20build=20de=20l'install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fd17e61306..4d4aa16af9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ # CircleCI 2.0 configuration file. See . version: 2 jobs: - build: + install: docker: - image: python:3.7 @@ -21,7 +21,7 @@ jobs: - run: name: Install dependencies command: | - make build + make install # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core # use a specific branch of OpenFisca-Core - save_cache: @@ -34,6 +34,25 @@ jobs: paths: - dist + build: + docker: + - image: python:3.7 + + steps: + - checkout + + - restore_cache: + key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + + - run: + name: Activate virtualenv + command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV + + - run: + command: | + make build + # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core # use a specific branch of OpenFisca-Core + test_python: # Python tests are separated from YAML tests, because the latter take longer. This would allow Python tests to use any other available container and yield it, once finished, to another job instead of counting only on the two containers assigned to the YAML tests. docker: - image: python:3.7 @@ -164,6 +183,7 @@ workflows: version: 2 build_and_deploy: jobs: + - install - build - test_python: requires: @@ -176,9 +196,10 @@ workflows: - build - lint_files: requires: - - build + - install - check_version_and_changelog: requires: + - install - build - test_python - test_yaml @@ -186,6 +207,7 @@ workflows: - deploy: requires: - check_version_and_changelog + - install - build - test_python - test_yaml From 51b7bb3640149dcf6fb6d3253694b792a3f44d7e Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 20 Aug 2021 15:29:40 +0200 Subject: [PATCH 09/30] =?UTF-8?q?Ajoute=20la=20d=C3=A9pendance=20install?= =?UTF-8?q?=20au=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d4aa16af9..cd0c5808fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -184,7 +184,9 @@ workflows: build_and_deploy: jobs: - install - - build + - build: + requires: + - install - test_python: requires: - build From 510f8b335e114a225362667b6d16d8934b9a59ce Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 20 Aug 2021 15:31:28 +0200 Subject: [PATCH 10/30] Sauvegarde le cache du build --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd0c5808fc..3985dd1800 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,11 +29,6 @@ jobs: paths: - /tmp/venv/openfisca_france - - save_cache: - key: v1-py3-build-{{ .Revision }} - paths: - - dist - build: docker: - image: python:3.7 @@ -53,6 +48,11 @@ jobs: make build # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core # use a specific branch of OpenFisca-Core + - save_cache: + key: v1-py3-build-{{ .Revision }} + paths: + - dist + test_python: # Python tests are separated from YAML tests, because the latter take longer. This would allow Python tests to use any other available container and yield it, once finished, to another job instead of counting only on the two containers assigned to the YAML tests. docker: - image: python:3.7 From ab3137dd80b4f3902a4d16faaae5074d8aeb6cd7 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 20 Aug 2021 15:37:17 +0200 Subject: [PATCH 11/30] Nomme le job build --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3985dd1800..6132c3cb21 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,6 +44,7 @@ jobs: command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV - run: + name: Build package command: | make build # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core # use a specific branch of OpenFisca-Core From b6942b94be1848f28e7f3e88dc45f77227c9e31c Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 20 Aug 2021 15:44:53 +0200 Subject: [PATCH 12/30] =?UTF-8?q?Ajoute=20la=20d=C3=A9pendance=20test=5Fap?= =?UTF-8?q?i=20au=20check=5Fversion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6132c3cb21..7330cb2dcc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -206,6 +206,7 @@ workflows: - build - test_python - test_yaml + - test_api - lint_files - deploy: requires: From 6a502afc37bc1764ae0d0b3f6a2d8baf6d1555f1 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Fri, 20 Aug 2021 16:40:01 +0200 Subject: [PATCH 13/30] =?UTF-8?q?Am=C3=A9liore=20la=20formulation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/lint-changed-python-files.sh | 4 ++-- .circleci/lint-changed-yaml-tests.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/lint-changed-python-files.sh b/.circleci/lint-changed-python-files.sh index a1be79cf0a..72d8aad639 100755 --- a/.circleci/lint-changed-python-files.sh +++ b/.circleci/lint-changed-python-files.sh @@ -4,8 +4,8 @@ last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-pa if ! changes=$(git diff-index --name-only --diff-filter=ACMR --exit-code $last_tagged_commit -- "*.py") then - echo "Hello boss, I'm linting the following changed files:" + echo "Linting the following Python files:" echo $changes flake8 $changes -else echo "Could't find changed files, come visit again!" +else echo "No changed Python files to lint" fi diff --git a/.circleci/lint-changed-yaml-tests.sh b/.circleci/lint-changed-yaml-tests.sh index b23451f810..16e99432b6 100755 --- a/.circleci/lint-changed-yaml-tests.sh +++ b/.circleci/lint-changed-yaml-tests.sh @@ -4,8 +4,8 @@ last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-pa if ! changes=$(git diff-index --name-only --diff-filter=ACMR --exit-code $last_tagged_commit -- "tests/*.yaml") then - echo "Hello boss, I'm linting the following changed files:" + echo "Linting the following changed YAML tests:" echo $changes yamllint $changes -else echo "Could't find changed files, come visit again!" +else echo "No changed YAML tests to lint" fi From f5dfc4d756985da5268302301712d7044aa5bfab Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 24 Aug 2021 15:19:33 +0200 Subject: [PATCH 14/30] =?UTF-8?q?Sauvegarde=20le=20cache=20apr=C3=A8s=20le?= =?UTF-8?q?=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7330cb2dcc..34bd567207 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,6 +49,11 @@ jobs: make build # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core # use a specific branch of OpenFisca-Core + - save_cache: + key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + paths: + - /tmp/venv/openfisca_france + - save_cache: key: v1-py3-build-{{ .Revision }} paths: From a5e4b26d8e7ce9b0bd394dfbd133e701d0d9d5b5 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 24 Aug 2021 17:14:01 +0200 Subject: [PATCH 15/30] Supprime la redondance de l'utilisation de OpenFisca Core --- .circleci/config.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 34bd567207..bc464b77ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,9 +20,11 @@ jobs: - run: name: Install dependencies - command: | - make install - # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core # use a specific branch of OpenFisca-Core + command: make install + + # - run: + # name: Use a specific branch of OpenFisca-Core for testing purposes + # command: pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core - save_cache: key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} @@ -45,9 +47,7 @@ jobs: - run: name: Build package - command: | - make build - # pip install --editable git+https://github.com/openfisca/openfisca-core.git@BRANCH_NAME#egg=OpenFisca-Core # use a specific branch of OpenFisca-Core + command: make build - save_cache: key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} @@ -59,7 +59,7 @@ jobs: paths: - dist - test_python: # Python tests are separated from YAML tests, because the latter take longer. This would allow Python tests to use any other available container and yield it, once finished, to another job instead of counting only on the two containers assigned to the YAML tests. + test_python: # Python tests are separated from YAML tests, because the latter take longer. This allows Python tests to use any other available container and yield it, once finished, to another job instead of relying only on the two containers assigned to the YAML tests. docker: - image: python:3.7 From 5c1f067896234b2204cc47c663dbc0bdbe4cb06a Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 24 Aug 2021 17:14:44 +0200 Subject: [PATCH 16/30] Supprime le split des tests Python --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc464b77ce..82779d245a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,7 +75,7 @@ jobs: - run: name: Run Python tests - command: pytest `circleci tests glob "tests/**/[^_]*.py" | circleci tests split` + command: pytest `circleci tests glob "tests/**/[^_]*.py"` test_yaml: parallelism: 2 # Speed up the yaml tests, while letting two containers available for other jobs. From 2cb7b282bb1d5e83c3c95dc1e54750b22f84aa1f Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 24 Aug 2021 17:26:34 +0200 Subject: [PATCH 17/30] Restructure la config --- .circleci/config.yml | 93 ++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 82779d245a..921467fcd1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,6 +31,45 @@ jobs: paths: - /tmp/venv/openfisca_france + lint_files: + docker: + - image: python:3.7 + + steps: + - checkout + + - restore_cache: + key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + + - run: + name: Activate virtualenv + command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV + + - run: make check-syntax-errors + + - run: make check-style + + - run: + name: Lint Python files + command: .circleci/lint-changed-python-files.sh + + - run: + name: Lint YAML tests + command: .circleci/lint-changed-yaml-tests.sh + + check_version_and_changelog: + docker: + - image: python:3.7 + + steps: + - checkout + + - run: + name: Check version number has been properly updated + command: | + git fetch + .circleci/is-version-number-acceptable.sh + build: docker: - image: python:3.7 @@ -113,43 +152,7 @@ jobs: - run: name: Test the Web API - command: | - .circleci/test-api.sh - - lint_files: - docker: - - image: python:3.7 - - steps: - - checkout - - - restore_cache: - key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - - - run: - name: Activate virtualenv - command: | - echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV - - - run: - name: Lint files - command: | - make check-syntax-errors check-style - .circleci/lint-changed-python-files.sh - .circleci/lint-changed-yaml-tests.sh - - check_version_and_changelog: - docker: - - image: python:3.7 - - steps: - - checkout - - - run: - name: Check version number has been properly updated - command: | - git fetch - .circleci/is-version-number-acceptable.sh + command: .circleci/test-api.sh deploy: docker: @@ -190,6 +193,9 @@ workflows: build_and_deploy: jobs: - install + - lint_files: + requires: + - install - build: requires: - install @@ -202,26 +208,19 @@ workflows: - test_api: requires: - build - - lint_files: - requires: - - install - check_version_and_changelog: requires: - - install - - build + - lint_files - test_python - test_yaml - test_api - - lint_files - deploy: requires: - - check_version_and_changelog - - install - - build + - lint_files - test_python - test_yaml - test_api - - lint_files + - check_version_and_changelog filters: branches: only: master From f039ea39a944a42c5b0f20834495fbe6a925f500 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 24 Aug 2021 17:33:46 +0200 Subject: [PATCH 18/30] =?UTF-8?q?Supprime=20les=20redondances=20des=20d?= =?UTF-8?q?=C3=A9pendances=20dans=20deploy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 921467fcd1..e2644a2b52 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -216,10 +216,6 @@ workflows: - test_api - deploy: requires: - - lint_files - - test_python - - test_yaml - - test_api - check_version_and_changelog filters: branches: From 781d9e1618d1b78f51a08f56394f5f8f9afee286 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Tue, 24 Aug 2021 18:42:42 +0200 Subject: [PATCH 19/30] =?UTF-8?q?Change=20l'ordre=20des=20d=C3=A9claration?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e2644a2b52..eda8cc5afc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,19 +57,6 @@ jobs: name: Lint YAML tests command: .circleci/lint-changed-yaml-tests.sh - check_version_and_changelog: - docker: - - image: python:3.7 - - steps: - - checkout - - - run: - name: Check version number has been properly updated - command: | - git fetch - .circleci/is-version-number-acceptable.sh - build: docker: - image: python:3.7 @@ -154,6 +141,19 @@ jobs: name: Test the Web API command: .circleci/test-api.sh + check_version_and_changelog: + docker: + - image: python:3.7 + + steps: + - checkout + + - run: + name: Check version number has been properly updated + command: | + git fetch + .circleci/is-version-number-acceptable.sh + deploy: docker: - image: python:3.7 From c937ebd4af6198c40fe2e9022b5c79d4a31926dc Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 25 Aug 2021 10:19:02 +0200 Subject: [PATCH 20/30] Teste sans le cache du build --- .circleci/config.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eda8cc5afc..6ceae05831 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,11 +75,6 @@ jobs: name: Build package command: make build - - save_cache: - key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - paths: - - /tmp/venv/openfisca_france - - save_cache: key: v1-py3-build-{{ .Revision }} paths: From 2f60c8cd025be608a682d430781cc072cc85d460 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 25 Aug 2021 10:23:38 +0200 Subject: [PATCH 21/30] Teste avec le cache du build --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ceae05831..eda8cc5afc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,6 +75,11 @@ jobs: name: Build package command: make build + - save_cache: + key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + paths: + - /tmp/venv/openfisca_france + - save_cache: key: v1-py3-build-{{ .Revision }} paths: From 8c0e1d063617d36fabde7e3718948f903032db2a Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 25 Aug 2021 16:42:26 +0200 Subject: [PATCH 22/30] =?UTF-8?q?Change=20la=20d=C3=A9pendance=20des=20tes?= =?UTF-8?q?ts=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eda8cc5afc..6def88bcab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -201,7 +201,7 @@ workflows: - install - test_python: requires: - - build + - install - test_yaml: requires: - build From 54acb6652cc6a5b9aeb9042d30e136a6374fd661 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 25 Aug 2021 17:02:58 +0200 Subject: [PATCH 23/30] Ajoute revision cache aux tests Python --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6def88bcab..6fb4a5998b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,6 +95,9 @@ jobs: - restore_cache: key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + - restore_cache: + key: v1-py3-build-{{ .Revision }} + - run: name: Activate virtualenv command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV @@ -201,7 +204,7 @@ workflows: - install - test_python: requires: - - install + - build - test_yaml: requires: - build From 16d6925108a72084bb4be92bf48562fd7bf9b0c9 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 25 Aug 2021 17:17:38 +0200 Subject: [PATCH 24/30] Supprime le job install --- .circleci/config.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6fb4a5998b..9e78ab8341 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,8 +68,11 @@ jobs: key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - run: - name: Activate virtualenv - command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV + name: Create a virtualenv + command: | + mkdir -p /tmp/venv/openfisca_france + python -m venv /tmp/venv/openfisca_france + echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV - run: name: Build package @@ -195,13 +198,10 @@ workflows: version: 2 build_and_deploy: jobs: - - install + - build - lint_files: requires: - - install - - build: - requires: - - install + - build - test_python: requires: - build From 623fdbca3ca75cada9ed91727e5663de8f5819b9 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 25 Aug 2021 17:24:27 +0200 Subject: [PATCH 25/30] Ajoute le job install --- .circleci/config.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e78ab8341..e7705d50b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,11 +68,8 @@ jobs: key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - run: - name: Create a virtualenv - command: | - mkdir -p /tmp/venv/openfisca_france - python -m venv /tmp/venv/openfisca_france - echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV + name: Activate virtualenv + command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV - run: name: Build package @@ -198,19 +195,22 @@ workflows: version: 2 build_and_deploy: jobs: - - build + - install - lint_files: requires: - - build + - install + - build: + requires: + - install - test_python: requires: - build - test_yaml: requires: - - build + - build - test_api: - requires: - - build + requires: + - build - check_version_and_changelog: requires: - lint_files From 206e9f05d2383b89305d43a86cc71dcefe0297fc Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 25 Aug 2021 18:03:54 +0200 Subject: [PATCH 26/30] Ajoute au job test_python --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7705d50b9..00234e1fe9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -102,6 +102,9 @@ jobs: name: Activate virtualenv command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV + - run: + command: make install + - run: name: Run Python tests command: pytest `circleci tests glob "tests/**/[^_]*.py"` From c35aaede84b538bd25c69593930bcd72522edf91 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 25 Aug 2021 18:17:17 +0200 Subject: [PATCH 27/30] =?UTF-8?q?Ajoute=20deuxi=C3=A8me=20cache=20pour=20l?= =?UTF-8?q?e=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 00234e1fe9..701cd61932 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,7 +76,7 @@ jobs: command: make build - save_cache: - key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + key: v2-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} paths: - /tmp/venv/openfisca_france @@ -93,7 +93,7 @@ jobs: - checkout - restore_cache: - key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + key: v2-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - restore_cache: key: v1-py3-build-{{ .Revision }} @@ -102,9 +102,6 @@ jobs: name: Activate virtualenv command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV - - run: - command: make install - - run: name: Run Python tests command: pytest `circleci tests glob "tests/**/[^_]*.py"` From 346cd07ae7fe82b76147d42b8ac9b298c5913fdd Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 25 Aug 2021 18:28:47 +0200 Subject: [PATCH 28/30] =?UTF-8?q?Change=20le=20cache=20utilis=C3=A9=20dans?= =?UTF-8?q?=20les=20jobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 701cd61932..ba46b4e1b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,9 +95,6 @@ jobs: - restore_cache: key: v2-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - - restore_cache: - key: v1-py3-build-{{ .Revision }} - - run: name: Activate virtualenv command: echo "source /tmp/venv/openfisca_france/bin/activate" >> $BASH_ENV @@ -115,7 +112,7 @@ jobs: - checkout - restore_cache: - key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + key: v2-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - run: name: Activate virtualenv @@ -133,7 +130,7 @@ jobs: - checkout - restore_cache: - key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + key: v2-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - run: name: Activate virtualenv @@ -168,7 +165,7 @@ jobs: - checkout - restore_cache: - key: v1-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} + key: v2-py3-deps-{{ .Branch }}-{{ checksum "setup.py" }} - restore_cache: key: v1-py3-build-{{ .Revision }} From 79f5a52928d88dde3acd7432e5f8abcc0b1e9361 Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 1 Sep 2021 10:40:57 +0200 Subject: [PATCH 29/30] =?UTF-8?q?Met=C3=A0=20jour=20le=20CHANGELOG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06bd05cc29..7abc914ac1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +### 72.1.2 [#1650](https://github.com/openfisca/openfisca-france/pull/1650) + +* Amélioration technique. +* Zones impactées : configuration de l'intégration continue. +* Détails : + - Sépare les jobs `test_python` et `test_yaml` du `build`. + - Sépare le job `install` du job `build`. + - Regroupe les deux jobs `lint_python_files` et `lint_yaml_files` dans un seul job. + - Rend le job `check-version-and-changelog` dépendant de tous les autres jobs. + ## 72.1.1 [#1657](https://github.com/openfisca/openfisca-france/pull/1657) * Changement mineur. From 511f6bdfcea5832ba2feb4d60f123c9f1dae71ee Mon Sep 17 00:00:00 2001 From: HAEKADI Date: Wed, 1 Sep 2021 10:41:28 +0200 Subject: [PATCH 30/30] =?UTF-8?q?Met=20=C3=A0=20jour=20le=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7bd47260ac..4e2d44899e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name = "OpenFisca-France", - version = "72.1.1", + version = "72.1.2", author = "OpenFisca Team", author_email = "contact@openfisca.fr", classifiers = [