From 95d5a7bf2525764410986db36e31611c259aa8bd Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 16:35:08 +0200 Subject: [PATCH 1/9] Rename to tasks --- Makefile | 14 +++++++------- {openfisca_tasks => tasks}/install.mk | 0 {openfisca_tasks => tasks}/lint.mk | 0 {openfisca_tasks => tasks}/publish.mk | 4 ++-- {openfisca_tasks => tasks}/serve.mk | 0 {openfisca_tasks => tasks}/test_code.mk | 0 {openfisca_tasks => tasks}/test_doc.mk | 0 7 files changed, 9 insertions(+), 9 deletions(-) rename {openfisca_tasks => tasks}/install.mk (100%) rename {openfisca_tasks => tasks}/lint.mk (100%) rename {openfisca_tasks => tasks}/publish.mk (88%) rename {openfisca_tasks => tasks}/serve.mk (100%) rename {openfisca_tasks => tasks}/test_code.mk (100%) rename {openfisca_tasks => tasks}/test_doc.mk (100%) diff --git a/Makefile b/Makefile index 2691268681..b70dbadcc2 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ -include openfisca_tasks/install.mk -include openfisca_tasks/lint.mk -include openfisca_tasks/publish.mk -include openfisca_tasks/serve.mk -include openfisca_tasks/test_code.mk -include openfisca_tasks/test_doc.mk +include tasks/install.mk +include tasks/lint.mk +include tasks/publish.mk +include tasks/serve.mk +include tasks/test_code.mk +include tasks/test_doc.mk ## To share info with the user, but no action is needed. print_info = $$(tput setaf 6)[i]$$(tput sgr0) @@ -21,7 +21,7 @@ print_pass = echo $$(tput setaf 2)[✓]$$(tput sgr0) $$(tput setaf 8)$1$$(tput s ## Similar to `print_work`, but this will read the comments above a task, and ## print them to the user at the start of each task. The `$1` is a function ## argument. -print_help = sed -n "/^$1/ { x ; p ; } ; s/\#\#/$(print_work)/ ; s/\./…/ ; x" ${MAKEFILE_LIST} +print_help = sed -n "/^$1/ { x ; p ; } ; s/\#\#/\r$(print_work)/ ; s/\./…/ ; x" ${MAKEFILE_LIST} ## Same as `make`. .DEFAULT_GOAL := all diff --git a/openfisca_tasks/install.mk b/tasks/install.mk similarity index 100% rename from openfisca_tasks/install.mk rename to tasks/install.mk diff --git a/openfisca_tasks/lint.mk b/tasks/lint.mk similarity index 100% rename from openfisca_tasks/lint.mk rename to tasks/lint.mk diff --git a/openfisca_tasks/publish.mk b/tasks/publish.mk similarity index 88% rename from openfisca_tasks/publish.mk rename to tasks/publish.mk index 2f34599fd9..ac0ef2c053 100644 --- a/openfisca_tasks/publish.mk +++ b/tasks/publish.mk @@ -1,7 +1,7 @@ ## Install openfisca-core for deployment and publishing. -build: setup.py +build: @## This allows us to be sure tests are run against the packaged version @## of openfisca-core, the same we put in the hands of users and reusers. @$(call print_help,$@:) - @python $? bdist_wheel + @python setup.py bdist_wheel @find dist -name "*.whl" -exec pip install --force-reinstall {}[dev] \; diff --git a/openfisca_tasks/serve.mk b/tasks/serve.mk similarity index 100% rename from openfisca_tasks/serve.mk rename to tasks/serve.mk diff --git a/openfisca_tasks/test_code.mk b/tasks/test_code.mk similarity index 100% rename from openfisca_tasks/test_code.mk rename to tasks/test_code.mk diff --git a/openfisca_tasks/test_doc.mk b/tasks/test_doc.mk similarity index 100% rename from openfisca_tasks/test_doc.mk rename to tasks/test_doc.mk From b6fb481961919b611af95b6a5fe82166677fad54 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 16:36:03 +0200 Subject: [PATCH 2/9] Do not install publishing tools in dev --- tasks/install.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/install.mk b/tasks/install.mk index f37d17f26f..f3b59d00cb 100644 --- a/tasks/install.mk +++ b/tasks/install.mk @@ -1,7 +1,7 @@ ## Install project dependencies. install: @$(call print_help,$@:) - @pip install --upgrade pip twine wheel + @pip install --upgrade pip @pip install --editable .[dev] --upgrade --use-deprecated=legacy-resolver ## Uninstall project dependencies. From 76e21c532dedf0dee650703d4cd2bbd9431c27e9 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 16:52:21 +0200 Subject: [PATCH 3/9] Add publish tasks to make --- .circleci/publish-python-package.sh | 4 ---- tasks/publish.mk | 27 +++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 6 deletions(-) delete mode 100755 .circleci/publish-python-package.sh diff --git a/.circleci/publish-python-package.sh b/.circleci/publish-python-package.sh deleted file mode 100755 index 8d331bd946..0000000000 --- a/.circleci/publish-python-package.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash - -python setup.py bdist_wheel # build this package in the dist directory -twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD # publish diff --git a/tasks/publish.mk b/tasks/publish.mk index ac0ef2c053..6311d6a231 100644 --- a/tasks/publish.mk +++ b/tasks/publish.mk @@ -1,7 +1,30 @@ -## Install openfisca-core for deployment and publishing. +## Install building utils. +install-builder: + @$(call print_help,$@:) + @pip install --upgrade pip setuptools wheel + +## Install publishing tools. +install-publisher: + @$(call print_help,$@:) + @pip install --upgrade twine + +## Install build dependencies. +install-deps: + @## Create a requirements file & install openfisca's dependencies. + @$(call print_help,$@:) + python setup.py egg_info + pip install $(shell grep -v "^\[" *.egg-info/requires.txt) + @$(call print_pass,$@:) + +## Build & install openfisca-core for deployment and publishing. build: @## This allows us to be sure tests are run against the packaged version @## of openfisca-core, the same we put in the hands of users and reusers. @$(call print_help,$@:) @python setup.py bdist_wheel - @find dist -name "*.whl" -exec pip install --force-reinstall {}[dev] \; + @find dist -name "*.whl" -exec pip install --force-reinstall --no-dependencies {} \; + @$(call print_pass,$@:) + +## Upload openfisca-core package to PyPi. +publish: + @twine upload dist/* --username $${PYPI_USERNAME} --password $${PYPI_PASSWORD} From d58dff495863f44b2a0999e7354ca93de7540502 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 17:00:00 +0200 Subject: [PATCH 4/9] Adapt circleci --- .circleci/config.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ea7148b39b..7d78dabe8a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,11 +19,14 @@ jobs: python -m venv /tmp/venv/openfisca_core echo "source /tmp/venv/openfisca_core/bin/activate" >> $BASH_ENV + - run: + name: Install building utils + command: make install-builder + - run: name: Install dependencies command: | - make install - make clean + make install-deps # pip install --editable git+https://github.com/openfisca/country-template.git@BRANCH_NAME#egg=OpenFisca-Country-Template # use a specific branch of OpenFisca-Country-Template # pip install --editable git+https://github.com/openfisca/extension-template.git@BRANCH_NAME#egg=OpenFisca-Extension-Template # use a specific branch of OpenFisca-Extension-Template @@ -32,13 +35,17 @@ jobs: paths: - /tmp/venv/openfisca_core + - run: + name: Build & install openfisca-core + command: make build + - run: name: Run linters - command: make lint + command: make clean lint - run: name: Run openfisca-core tests - command: make test-core pytest_args="--exitfirst" + command: make clean test-core pytest_args="--exitfirst" - run: name: Check NumPy typing against latest 3 minor versions @@ -151,10 +158,10 @@ jobs: command: if ! .circleci/has-functional-changes.sh ; then circleci step halt ; fi - run: - name: Upload a Python package to Pypi + name: Upload openfisca-core package to PyPi command: | source /tmp/venv/openfisca_core/bin/activate - .circleci/publish-python-package.sh + make install-publisher build clean publish - run: name: Publish a git tag From 4a30993a2d8f06269fcdcdf8a668ef99a860b46c Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 18:11:06 +0200 Subject: [PATCH 5/9] Rename install to dev --- Makefile | 2 +- tasks/{install.mk => dev.mk} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tasks/{install.mk => dev.mk} (100%) diff --git a/Makefile b/Makefile index b70dbadcc2..3e1bea5454 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -include tasks/install.mk +include tasks/dev.mk include tasks/lint.mk include tasks/publish.mk include tasks/serve.mk diff --git a/tasks/install.mk b/tasks/dev.mk similarity index 100% rename from tasks/install.mk rename to tasks/dev.mk From 11b216501c05daedf63ff0025a6e708155ea50f2 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 18:26:39 +0200 Subject: [PATCH 6/9] Fix install-deps --- 1 | 28 ++++++++++++++++++++++++++++ tasks/publish.mk | 7 ++----- 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 1 diff --git a/1 b/1 new file mode 100644 index 0000000000..5e9acaeb2a --- /dev/null +++ b/1 @@ -0,0 +1,28 @@ +dpath<2.0.0,>=1.5.0 +pytest<6.0.0,>=4.4.1 +numpy<1.21,>=1.11 +psutil<6.0.0,>=5.4.7 +PyYAML>=3.10 +sortedcontainers==2.2.2 +numexpr<=3.0,>=2.7.0 + +autopep8<1.6.0,>=1.4.0 +flake8<4.0.0,>=3.9.0 +flake8-bugbear<20.0.0,>=19.3.0 +flake8-print<4.0.0,>=3.1.0 +flake8-rst-docstrings<1.0.0 +pytest-cov<3.0.0,>=2.6.1 +mypy<0.800,>=0.701 +openfisca-country-template<4.0.0,>=3.10.0 +openfisca-extension-template<2.0.0,>=1.2.0rc0 +werkzeug<2.0.0,>=1.0.0 +flask==1.1.2 +flask-cors==3.0.10 +gunicorn<21.0.0,>=20.0.0 + +openfisca-tracker==0.4.0 + +werkzeug<2.0.0,>=1.0.0 +flask==1.1.2 +flask-cors==3.0.10 +gunicorn<21.0.0,>=20.0.0 diff --git a/tasks/publish.mk b/tasks/publish.mk index 6311d6a231..cf56853aea 100644 --- a/tasks/publish.mk +++ b/tasks/publish.mk @@ -10,16 +10,13 @@ install-publisher: ## Install build dependencies. install-deps: - @## Create a requirements file & install openfisca's dependencies. @$(call print_help,$@:) - python setup.py egg_info - pip install $(shell grep -v "^\[" *.egg-info/requires.txt) + @python setup.py egg_info + @pip install $$(grep -v "^\[" *.egg-info/requires.txt) @$(call print_pass,$@:) ## Build & install openfisca-core for deployment and publishing. build: - @## This allows us to be sure tests are run against the packaged version - @## of openfisca-core, the same we put in the hands of users and reusers. @$(call print_help,$@:) @python setup.py bdist_wheel @find dist -name "*.whl" -exec pip install --force-reinstall --no-dependencies {} \; From c465927df23999568b53c510587da42628fed54d Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 18:44:59 +0200 Subject: [PATCH 7/9] Fix circleci --- .circleci/config.yml | 6 +++--- .circleci/has-functional-changes.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d78dabe8a..986bf3cc33 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,7 +37,7 @@ jobs: - run: name: Build & install openfisca-core - command: make build + command: make clean build - run: name: Run linters @@ -45,7 +45,7 @@ jobs: - run: name: Run openfisca-core tests - command: make clean test-core pytest_args="--exitfirst" + command: make test-core pytest_args="--exitfirst" - run: name: Check NumPy typing against latest 3 minor versions @@ -161,7 +161,7 @@ jobs: name: Upload openfisca-core package to PyPi command: | source /tmp/venv/openfisca_core/bin/activate - make install-publisher build clean publish + make install-publisher clean build publish - run: name: Publish a git tag diff --git a/.circleci/has-functional-changes.sh b/.circleci/has-functional-changes.sh index 049a94d6cd..1a909476dc 100755 --- a/.circleci/has-functional-changes.sh +++ b/.circleci/has-functional-changes.sh @@ -1,6 +1,6 @@ #! /usr/bin/env bash -IGNORE_DIFF_ON="README.md CONTRIBUTING.md Makefile .gitignore LICENSE* .circleci/* .github/* tests/*" +IGNORE_DIFF_ON=".circleci/* .github/* tasks/* tests/* .gitignore conftest.py CONTRIBUTING.md LICENSE* Makefile README.md STYLEGUIDE.md" last_tagged_commit=`git describe --tags --abbrev=0 --first-parent` # --first-parent ensures we don't follow tags not published in master through an unlikely intermediary merge commit From 412ac4da7bee42610e392a1903ca828a9567957a Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 17:05:23 +0200 Subject: [PATCH 8/9] Bump patch to 35.5.3 --- 1 | 28 ---------------------------- CHANGELOG.md | 6 ++++++ setup.py | 2 +- 3 files changed, 7 insertions(+), 29 deletions(-) delete mode 100644 1 diff --git a/1 b/1 deleted file mode 100644 index 5e9acaeb2a..0000000000 --- a/1 +++ /dev/null @@ -1,28 +0,0 @@ -dpath<2.0.0,>=1.5.0 -pytest<6.0.0,>=4.4.1 -numpy<1.21,>=1.11 -psutil<6.0.0,>=5.4.7 -PyYAML>=3.10 -sortedcontainers==2.2.2 -numexpr<=3.0,>=2.7.0 - -autopep8<1.6.0,>=1.4.0 -flake8<4.0.0,>=3.9.0 -flake8-bugbear<20.0.0,>=19.3.0 -flake8-print<4.0.0,>=3.1.0 -flake8-rst-docstrings<1.0.0 -pytest-cov<3.0.0,>=2.6.1 -mypy<0.800,>=0.701 -openfisca-country-template<4.0.0,>=3.10.0 -openfisca-extension-template<2.0.0,>=1.2.0rc0 -werkzeug<2.0.0,>=1.0.0 -flask==1.1.2 -flask-cors==3.0.10 -gunicorn<21.0.0,>=20.0.0 - -openfisca-tracker==0.4.0 - -werkzeug<2.0.0,>=1.0.0 -flask==1.1.2 -flask-cors==3.0.10 -gunicorn<21.0.0,>=20.0.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fcb535f9a..82ea091375 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 35.5.3 [#1058](https://github.com/openfisca/openfisca-core/pull/1058) + +#### Non-technical changes + +- Moves building workflow to `Makefile`. + ### 35.5.2 [#1048](https://github.com/openfisca/openfisca-core/pull/1048) #### Bug fix diff --git a/setup.py b/setup.py index 01e036df50..1935635464 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ setup( name = 'OpenFisca-Core', - version = '35.5.2', + version = '35.5.3', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [ From 7600bc462a18385bfdccbb8ca51e448421d0a561 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Wed, 6 Oct 2021 10:34:25 +0200 Subject: [PATCH 9/9] Rename ci task to install build dependencies Co-authored-by: Matti Schneider --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 986bf3cc33..4d338eaffd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ jobs: echo "source /tmp/venv/openfisca_core/bin/activate" >> $BASH_ENV - run: - name: Install building utils + name: Install build dependencies command: make install-builder - run: