From 394a9584293f9f9050561ad4bd4eb24993c088b4 Mon Sep 17 00:00:00 2001 From: benoit-cty Date: Wed, 23 Oct 2024 11:49:28 +0200 Subject: [PATCH 01/15] wip: fix conda upload --- .github/workflows/workflow.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 471188fbe4..4a41010547 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -224,7 +224,7 @@ jobs: test-on-windows: runs-on: "windows-latest" - if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch + # if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch needs: [ build-conda ] steps: - uses: conda-incubator/setup-miniconda@v3 @@ -240,7 +240,7 @@ jobs: - name: Get version run: | # chcp 65001 #set code page to utf-8 - echo ("PACKAGE_VERSION=" + (python3 ./setup.py --version) ) >> $env:GITHUB_ENV + echo ("PACKAGE_VERSION=" + (python3 .github/pyproject_version.py --only_package_version True) ) >> $env:GITHUB_ENV echo "Version setup.py: ${{ env.PACKAGE_VERSION }}" - name: Download conda build uses: actions/download-artifact@v3 @@ -249,7 +249,7 @@ jobs: path: conda-build-tmp - name: Install with conda run: | - conda install -c ./conda-build-tmp/noarch/openfisca-france-dev-${{ env.PACKAGE_VERSION }}-py_0.tar.bz2 openfisca-france-dev + conda install -c ./conda-build-tmp/noarch/openfisca-france-${{ env.PACKAGE_VERSION }}-py_0.tar.bz2 openfisca-france - name: openfisca test run: openfisca test --country-package openfisca_france tests @@ -333,11 +333,18 @@ jobs: # Add conda-forge for OpenFisca-Core channels: conda-forge activate-environment: true - - name: Get source code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Get version - run: echo "PACKAGE_VERSION=$(python3 ./pyproject.toml --version)" >> $GITHUB_ENV - # Get the last commit hash on the PR (-2 : before the merge commit) + run: | + # chcp 65001 #set code page to utf-8 + echo ("PACKAGE_VERSION=" + (python3 .github/pyproject_version.py --only_package_version True) ) >> $env:GITHUB_ENV + echo "Version setup.py: ${{ env.PACKAGE_VERSION }}" + - name: Download conda build + uses: actions/download-artifact@v3 + with: + name: conda-build-${{ env.PACKAGE_VERSION }}-${{ github.sha }} + path: conda-build-tmp + - name: Install with conda - uses: actions/github-script@v6 id: last_pr_commit with: @@ -349,6 +356,5 @@ jobs: # This shell is made necessary by https://github.com/conda-incubator/setup-miniconda/issues/128 shell: bash -l {0} run: | - conda install --yes conda-build anaconda-client - conda config --set anaconda_upload yes - conda build --channel conda-forge --channel openfisca --token ${{ secrets.ANACONDA_TOKEN }} --user openfisca .conda + conda install --yes anaconda-client + anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --user openfisca ./conda-build-tmp/noarch/openfisca-france-${{ env.PACKAGE_VERSION }}-py_0.tar.bz2 From ed4b047d7d16164d326eb1211c519d46ccf11b27 Mon Sep 17 00:00:00 2001 From: benoit-cty Date: Wed, 23 Oct 2024 11:54:37 +0200 Subject: [PATCH 02/15] better conda workflow Checkout needed to get github.sha ci : use-mamba ci : use-mamba wip: try to understand why cache key changes use only github.sha enableCrossOsArchive remove ${{ hashFiles('.conda/recipe.yaml') Add mamba to publish Fix conda publish --- .github/workflows/workflow.yml | 106 +++++++++++++-------------------- 1 file changed, 43 insertions(+), 63 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4a41010547..8ff6010c00 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -52,10 +52,7 @@ jobs: uses: actions/cache@v4 with: path: /tmp/conda-bld - key: build-conda-${{ hashFiles('.conda/recipe.yaml') }}-${{ github.sha }} - restore-keys: | - build-conda-${{ hashFiles('.conda/recipe.yaml') }} - build-conda- + key: build-conda-${{ github.sha }} - name: set version run: | python3 .github/pyproject_version.py --replace True @@ -65,19 +62,13 @@ jobs: build-args: --channel openfisca --channel conda-forge --output-dir /tmp/conda-bld recipe-path: .conda/recipe.yaml upload-artifact: false - - name: Upload Conda build - uses: actions/upload-artifact@v4 - with: - name: conda-build-${{ env.PACKAGE_VERSION }}-${{ github.sha }} - path: /tmp/conda-bld - retention-days: 30 test-conda: runs-on: ubuntu-22.04 needs: [ build-conda ] steps: + # Checkout needed to get github.sha - uses: actions/checkout@v4 - - name: Setup conda uses: conda-incubator/setup-miniconda@v3 with: @@ -85,17 +76,15 @@ jobs: miniforge-version: latest python-version: 3.9.12 use-mamba: true - - name: Restore build uses: actions/cache@v4 with: path: /tmp/conda-bld - key: build-conda-${{ hashFiles('.conda/recipe.yaml') }}-${{ github.sha }} - + key: build-conda-${{ github.sha }} + fail-on-cache-miss: true - name: Install package shell: bash -l {0} run: mamba install --channel file:///tmp/conda-bld --channel openfisca openfisca-france - - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml @@ -224,34 +213,32 @@ jobs: test-on-windows: runs-on: "windows-latest" - # if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch - needs: [ build-conda ] + if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch + needs: [ test-conda ] steps: + # Checkout needed to get github.sha + - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v3 with: - auto-update-conda: true - python-version: "3.9.9" - # Add conda-forge for OpenFisca-Core - channels: openfisca,conda-forge - activate-environment: true - - uses: actions/checkout@v4 + activate-environment: openfisca + miniforge-version: latest + python-version: 3.9.12 + use-mamba: true + - name: Restore build + uses: actions/cache@v4 + with: + path: /tmp/conda-bld + key: build-conda-${{ github.sha }} + fail-on-cache-miss: true + enableCrossOsArchive: true # To allow restore on windows - name: Test max path length run: "python3 openfisca_france/scripts/check_path_length.py" - - name: Get version - run: | - # chcp 65001 #set code page to utf-8 - echo ("PACKAGE_VERSION=" + (python3 .github/pyproject_version.py --only_package_version True) ) >> $env:GITHUB_ENV - echo "Version setup.py: ${{ env.PACKAGE_VERSION }}" - - name: Download conda build - uses: actions/download-artifact@v3 - with: - name: conda-build-${{ env.PACKAGE_VERSION }}-${{ github.sha }} - path: conda-build-tmp - - name: Install with conda - run: | - conda install -c ./conda-build-tmp/noarch/openfisca-france-${{ env.PACKAGE_VERSION }}-py_0.tar.bz2 openfisca-france - - name: openfisca test - run: openfisca test --country-package openfisca_france tests + - name: Install package + shell: bash -l {0} + run: mamba install --channel file:///tmp/conda-bld --channel openfisca openfisca-france + - name: Test conda package + shell: bash -l {0} + run: openfisca test tests/formulas/irpp.yaml check-version-and-changelog: runs-on: ubuntu-20.04 @@ -326,35 +313,28 @@ jobs: runs-on: "ubuntu-20.04" needs: [ deploy, test-on-windows ] steps: - - uses: conda-incubator/setup-miniconda@v3 - with: - auto-update-conda: true - python-version: "3.9.9" - # Add conda-forge for OpenFisca-Core - channels: conda-forge - activate-environment: true - uses: actions/checkout@v4 - - name: Get version - run: | - # chcp 65001 #set code page to utf-8 - echo ("PACKAGE_VERSION=" + (python3 .github/pyproject_version.py --only_package_version True) ) >> $env:GITHUB_ENV - echo "Version setup.py: ${{ env.PACKAGE_VERSION }}" - - name: Download conda build - uses: actions/download-artifact@v3 + - name: Restore build + uses: actions/cache@v4 with: - name: conda-build-${{ env.PACKAGE_VERSION }}-${{ github.sha }} - path: conda-build-tmp - - name: Install with conda - - uses: actions/github-script@v6 - id: last_pr_commit + path: /tmp/conda-bld + key: build-conda-${{ github.sha }} + fail-on-cache-miss: true + - uses: conda-incubator/setup-miniconda@v3 with: - script: | - const commits = ${{ toJSON(github.event.commits) }} - return commits.at(-2).id; - result-encoding: string - - name: Conda build and upload + activate-environment: openfisca + miniforge-version: latest + python-version: 3.9.12 + use-mamba: true + - name: Install package + shell: bash -l {0} + run: mamba install --channel file:///tmp/conda-bld --channel openfisca openfisca-france + - name: Test conda package + shell: bash -l {0} + run: openfisca test tests/formulas/irpp.yaml + - name: Conda upload already build package # This shell is made necessary by https://github.com/conda-incubator/setup-miniconda/issues/128 shell: bash -l {0} run: | conda install --yes anaconda-client - anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --user openfisca ./conda-build-tmp/noarch/openfisca-france-${{ env.PACKAGE_VERSION }}-py_0.tar.bz2 + anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --user openfisca /tmp/conda-bld/noarch/openfisca-france-* From cfbf87acb6a455377b4b4c5dd86a73e61ff4a1f2 Mon Sep 17 00:00:00 2001 From: Benoit Courty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:19:03 +0100 Subject: [PATCH 03/15] Suggested change Co-authored-by: sandcha --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 8ff6010c00..9feda33439 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -332,7 +332,7 @@ jobs: - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml - - name: Conda upload already build package + - name: Conda upload already built package # This shell is made necessary by https://github.com/conda-incubator/setup-miniconda/issues/128 shell: bash -l {0} run: | From ed93f1222a5357f8138931974f92007970f4433a Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:15:37 +0100 Subject: [PATCH 04/15] Reduce verbosity to avoid "This step has been truncated due to its large size" --- .conda/recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conda/recipe.yaml b/.conda/recipe.yaml index 5ebb33b12f..530b57eccb 100644 --- a/.conda/recipe.yaml +++ b/.conda/recipe.yaml @@ -19,7 +19,7 @@ source: build: noarch: python number: 0 - script: "pip install . -v" + script: "pip install ." requirements: host: From b91d57291a2b4a23bd873ac6ff6c1aed76519a52 Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:19:12 +0100 Subject: [PATCH 05/15] Ajout d'un commentaire sur l'usage --- openfisca_france/scripts/check_path_length.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openfisca_france/scripts/check_path_length.py b/openfisca_france/scripts/check_path_length.py index cf8b1275ce..60ea8468a7 100644 --- a/openfisca_france/scripts/check_path_length.py +++ b/openfisca_france/scripts/check_path_length.py @@ -4,7 +4,8 @@ FR: Ce script sert à estimer la longueur des chemins d'arborescence des paramètres, afin de ne pas avoir de chemins > 150 caractères (incompatible Windows). -Il est à utiliser avant de contribuer à l'harmonisation +Il est à utiliser avant de contribuer à l'harmonisation. +⚠️ Il est également utilisé par la CI, dans l'étape de test sur Windows. ''' From 09147e436b2d3ee59c6b8d5348059564dd96b2be Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:15:16 +0100 Subject: [PATCH 06/15] Conda uniquement sur Windows --- .github/workflows/workflow.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9feda33439..50b7cea39e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,4 +1,5 @@ name: OpenFisca France +# Mettre tout en windows et remettre le hash du pyproject.toml on: push: @@ -44,7 +45,7 @@ jobs: key: release-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }}-${{ matrix.os }}-${{ matrix.openfisca-dependencies }} build-conda: - runs-on: ubuntu-22.04 + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -52,7 +53,7 @@ jobs: uses: actions/cache@v4 with: path: /tmp/conda-bld - key: build-conda-${{ github.sha }} + key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} - name: set version run: | python3 .github/pyproject_version.py --replace True @@ -64,7 +65,7 @@ jobs: upload-artifact: false test-conda: - runs-on: ubuntu-22.04 + runs-on: windows-latest needs: [ build-conda ] steps: # Checkout needed to get github.sha @@ -80,17 +81,17 @@ jobs: uses: actions/cache@v4 with: path: /tmp/conda-bld - key: build-conda-${{ github.sha }} + key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} fail-on-cache-miss: true - name: Install package + # `bash -l {0}` démarre un login shell avec les variables d'environnement + # voir https://github.com/conda-incubator/setup-miniconda/issues/128 shell: bash -l {0} run: mamba install --channel file:///tmp/conda-bld --channel openfisca openfisca-france - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml - - lint-files: runs-on: ubuntu-20.04 strategy: @@ -212,8 +213,8 @@ jobs: run: "${GITHUB_WORKSPACE}/.github/test-api.sh" test-on-windows: - runs-on: "windows-latest" - if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch + runs-on: windows-latest + # if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch needs: [ test-conda ] steps: # Checkout needed to get github.sha @@ -222,13 +223,13 @@ jobs: with: activate-environment: openfisca miniforge-version: latest - python-version: 3.9.12 + python-version: 3.10.6 use-mamba: true - name: Restore build uses: actions/cache@v4 with: path: /tmp/conda-bld - key: build-conda-${{ github.sha }} + key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} fail-on-cache-miss: true enableCrossOsArchive: true # To allow restore on windows - name: Test max path length @@ -310,15 +311,16 @@ jobs: run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" publish-to-conda: - runs-on: "ubuntu-20.04" - needs: [ deploy, test-on-windows ] + runs-on: windows-latest + # needs: [ deploy, test-on-windows ] + needs: [ test-on-windows ] steps: - uses: actions/checkout@v4 - name: Restore build uses: actions/cache@v4 with: path: /tmp/conda-bld - key: build-conda-${{ github.sha }} + key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} fail-on-cache-miss: true - uses: conda-incubator/setup-miniconda@v3 with: @@ -333,7 +335,6 @@ jobs: shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml - name: Conda upload already built package - # This shell is made necessary by https://github.com/conda-incubator/setup-miniconda/issues/128 shell: bash -l {0} run: | conda install --yes anaconda-client From 5be45e866a0ecd5c98b6d76cdf92b47b42afef27 Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:19:53 +0100 Subject: [PATCH 07/15] =?UTF-8?q?Passe=20=C3=A0=20un=20chemin=20windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/workflow.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 50b7cea39e..cddddf316b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -52,7 +52,7 @@ jobs: - name: Cache build uses: actions/cache@v4 with: - path: /tmp/conda-bld + path: c:\tmp\conda-bld key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} - name: set version run: | @@ -60,7 +60,7 @@ jobs: - name: Build conda package uses: prefix-dev/rattler-build-action@v0.2.16 with: - build-args: --channel openfisca --channel conda-forge --output-dir /tmp/conda-bld + build-args: --channel openfisca --channel conda-forge --output-dir c:\tmp\conda-bld recipe-path: .conda/recipe.yaml upload-artifact: false @@ -80,14 +80,14 @@ jobs: - name: Restore build uses: actions/cache@v4 with: - path: /tmp/conda-bld + path: c:\tmp\conda-bld key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} fail-on-cache-miss: true - name: Install package # `bash -l {0}` démarre un login shell avec les variables d'environnement # voir https://github.com/conda-incubator/setup-miniconda/issues/128 shell: bash -l {0} - run: mamba install --channel file:///tmp/conda-bld --channel openfisca openfisca-france + run: mamba install --channel file://c:\tmp\conda-bld --channel openfisca openfisca-france - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml @@ -228,7 +228,7 @@ jobs: - name: Restore build uses: actions/cache@v4 with: - path: /tmp/conda-bld + path: c:\tmp\conda-bld key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} fail-on-cache-miss: true enableCrossOsArchive: true # To allow restore on windows @@ -236,7 +236,7 @@ jobs: run: "python3 openfisca_france/scripts/check_path_length.py" - name: Install package shell: bash -l {0} - run: mamba install --channel file:///tmp/conda-bld --channel openfisca openfisca-france + run: mamba install --channel file://c:\tmp\conda-bld --channel openfisca openfisca-france - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml @@ -319,7 +319,7 @@ jobs: - name: Restore build uses: actions/cache@v4 with: - path: /tmp/conda-bld + path: c:\tmp\conda-bld key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} fail-on-cache-miss: true - uses: conda-incubator/setup-miniconda@v3 @@ -330,7 +330,7 @@ jobs: use-mamba: true - name: Install package shell: bash -l {0} - run: mamba install --channel file:///tmp/conda-bld --channel openfisca openfisca-france + run: mamba install --channel file://c:\tmp\conda-bld --channel openfisca openfisca-france - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml @@ -338,4 +338,4 @@ jobs: shell: bash -l {0} run: | conda install --yes anaconda-client - anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --user openfisca /tmp/conda-bld/noarch/openfisca-france-* + anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --user openfisca c:\tmp\conda-bld/noarch/openfisca-france-* From a59a5acec26d55d985f9acf6e963602ee2d251b6 Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:28:58 +0100 Subject: [PATCH 08/15] Utilise ${{ runner.temp }} --- .github/workflows/workflow.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index cddddf316b..0ee7d5df70 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -52,7 +52,7 @@ jobs: - name: Cache build uses: actions/cache@v4 with: - path: c:\tmp\conda-bld + path: ${{ runner.temp }}\conda-bld key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} - name: set version run: | @@ -60,7 +60,7 @@ jobs: - name: Build conda package uses: prefix-dev/rattler-build-action@v0.2.16 with: - build-args: --channel openfisca --channel conda-forge --output-dir c:\tmp\conda-bld + build-args: --channel openfisca --channel conda-forge --output-dir ${{ runner.temp }}\conda-bld recipe-path: .conda/recipe.yaml upload-artifact: false @@ -80,14 +80,14 @@ jobs: - name: Restore build uses: actions/cache@v4 with: - path: c:\tmp\conda-bld + path: ${{ runner.temp }}\conda-bld key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} fail-on-cache-miss: true - name: Install package # `bash -l {0}` démarre un login shell avec les variables d'environnement # voir https://github.com/conda-incubator/setup-miniconda/issues/128 shell: bash -l {0} - run: mamba install --channel file://c:\tmp\conda-bld --channel openfisca openfisca-france + run: mamba install --channel file://${{ runner.temp }}\conda-bld --channel openfisca openfisca-france - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml @@ -228,7 +228,7 @@ jobs: - name: Restore build uses: actions/cache@v4 with: - path: c:\tmp\conda-bld + path: ${{ runner.temp }}\conda-bld key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} fail-on-cache-miss: true enableCrossOsArchive: true # To allow restore on windows @@ -236,7 +236,7 @@ jobs: run: "python3 openfisca_france/scripts/check_path_length.py" - name: Install package shell: bash -l {0} - run: mamba install --channel file://c:\tmp\conda-bld --channel openfisca openfisca-france + run: mamba install --channel file://${{ runner.temp }}\conda-bld --channel openfisca openfisca-france - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml @@ -319,7 +319,7 @@ jobs: - name: Restore build uses: actions/cache@v4 with: - path: c:\tmp\conda-bld + path: ${{ runner.temp }}\conda-bld key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} fail-on-cache-miss: true - uses: conda-incubator/setup-miniconda@v3 @@ -330,7 +330,7 @@ jobs: use-mamba: true - name: Install package shell: bash -l {0} - run: mamba install --channel file://c:\tmp\conda-bld --channel openfisca openfisca-france + run: mamba install --channel file://${{ runner.temp }}\conda-bld --channel openfisca openfisca-france - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml @@ -338,4 +338,4 @@ jobs: shell: bash -l {0} run: | conda install --yes anaconda-client - anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --user openfisca c:\tmp\conda-bld/noarch/openfisca-france-* + anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --user openfisca ${{ runner.temp }}\conda-bld/noarch/openfisca-france-* From dc9ae445d55cbb4f6a3a1b21a007921002229f78 Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:57:28 +0100 Subject: [PATCH 09/15] fix path --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0ee7d5df70..4561361a65 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -87,7 +87,7 @@ jobs: # `bash -l {0}` démarre un login shell avec les variables d'environnement # voir https://github.com/conda-incubator/setup-miniconda/issues/128 shell: bash -l {0} - run: mamba install --channel file://${{ runner.temp }}\conda-bld --channel openfisca openfisca-france + run: mamba install --channel file:///${RUNNER_TEMP//\\//}/conda-bld --channel openfisca openfisca-france - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml @@ -236,7 +236,7 @@ jobs: run: "python3 openfisca_france/scripts/check_path_length.py" - name: Install package shell: bash -l {0} - run: mamba install --channel file://${{ runner.temp }}\conda-bld --channel openfisca openfisca-france + run: mamba install --channel file:///${RUNNER_TEMP//\\//}/conda-bld --channel openfisca openfisca-france - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml @@ -330,7 +330,7 @@ jobs: use-mamba: true - name: Install package shell: bash -l {0} - run: mamba install --channel file://${{ runner.temp }}\conda-bld --channel openfisca openfisca-france + run: mamba install --channel file:///${RUNNER_TEMP//\\//}/conda-bld --channel openfisca openfisca-france - name: Test conda package shell: bash -l {0} run: openfisca test tests/formulas/irpp.yaml From 2f645d1cecb71774f9bfc4fad902e51fd0c0b09e Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:25:02 +0100 Subject: [PATCH 10/15] try fix cache --- .github/workflows/workflow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4561361a65..0fec7f42a2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -231,7 +231,6 @@ jobs: path: ${{ runner.temp }}\conda-bld key: build-conda-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} fail-on-cache-miss: true - enableCrossOsArchive: true # To allow restore on windows - name: Test max path length run: "python3 openfisca_france/scripts/check_path_length.py" - name: Install package From 426a3a12bf99f97f99cc1423f270dd5521769fa1 Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:54:19 +0100 Subject: [PATCH 11/15] Remet seulement sur master --- .github/workflows/workflow.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0fec7f42a2..60d9c557f5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -214,7 +214,7 @@ jobs: test-on-windows: runs-on: windows-latest - # if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch + if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch needs: [ test-conda ] steps: # Checkout needed to get github.sha @@ -311,8 +311,7 @@ jobs: publish-to-conda: runs-on: windows-latest - # needs: [ deploy, test-on-windows ] - needs: [ test-on-windows ] + needs: [ deploy, test-on-windows ] steps: - uses: actions/checkout@v4 - name: Restore build From dd809e2922edf7dd394bd6374f7d3358711d2849 Mon Sep 17 00:00:00 2001 From: Benoit Courty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:47:19 +0100 Subject: [PATCH 12/15] Retire TODO Co-authored-by: sandcha --- .github/workflows/workflow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 60d9c557f5..99e4db801b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,5 +1,4 @@ name: OpenFisca France -# Mettre tout en windows et remettre le hash du pyproject.toml on: push: From b93e95f5805f1972cd83b593e0d02f51f07adb15 Mon Sep 17 00:00:00 2001 From: Benoit Courty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:54:41 +0100 Subject: [PATCH 13/15] CI python version Co-authored-by: sandcha --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 99e4db801b..706608ea76 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -323,7 +323,7 @@ jobs: with: activate-environment: openfisca miniforge-version: latest - python-version: 3.9.12 + python-version: 3.10.6 use-mamba: true - name: Install package shell: bash -l {0} From c7edbb9d3722c841a4e04200a15ff63d5414e89a Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:56:31 +0100 Subject: [PATCH 14/15] anti-slash --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 706608ea76..babadda9d0 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -335,4 +335,4 @@ jobs: shell: bash -l {0} run: | conda install --yes anaconda-client - anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --user openfisca ${{ runner.temp }}\conda-bld/noarch/openfisca-france-* + anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --user openfisca ${{ runner.temp }}\conda-bld\noarch\openfisca-france-* From 998e14cf11aa43f56b6e7a3e59f7062e2bbb1746 Mon Sep 17 00:00:00 2001 From: benoit-cty <6603048+benoit-cty@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:02:37 +0100 Subject: [PATCH 15/15] bump --- CHANGELOG.md | 9 +++++++++ pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2b3587b44..b641fa7bf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +### 169.3.1 [2374](https://github.com/openfisca/openfisca-france/pull/2374) + +* Correction d'un crash. +* Périodes concernées : aucune. +* Zones impactées : `workflow.yml`. +* Détails : + - La publication conda ne fonctionnait plus suite au passage à `pyproject.toml` : `C:\hostedtoolcache\windows\Python\3.9.13\x64\python3.exe: can't open file 'D:\a\openfisca-france\openfisca-france\setup.py': [Errno 2] No such file or directory` + - Met en place la pipeline conda faite dans Openfisca/country-template + ### 169.3.0 [2376](https://github.com/openfisca/openfisca-france/pull/2376) * Évolution du système socio-fiscal diff --git a/pyproject.toml b/pyproject.toml index 3490f537b0..83aec454b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "OpenFisca-France" -version = "169.3.0" +version = "169.3.1" description = "OpenFisca Rules as Code model for France." readme = "README.md" keywords = ["microsimulation", "tax", "benefit", "rac", "rules-as-code", "france"]