Skip to content

Commit

Permalink
Fix build (#322)
Browse files Browse the repository at this point in the history
* Fix build

* Fix PR number

* Fix workflow

* Fix Python version for ubuntu-24.04

---------

Co-authored-by: benoit-cty <4-benoit-cty@users.noreply.git.leximpact.dev>
  • Loading branch information
benjello and benoit-cty authored Nov 29, 2024
1 parent 3305302 commit caafc7c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 86 deletions.
5 changes: 0 additions & 5 deletions .github/publish-python-package.sh

This file was deleted.

96 changes: 16 additions & 80 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
strategy:
fail-fast: true
matrix:
os: ["ubuntu-20.04"] # On peut ajouter "macos-latest" si besoin
python-version: ["3.9.9", "3.10.6"]
os: ["ubuntu-24.04"] # On peut ajouter "macos-latest" si besoin
python-version: ["3.9.13", "3.10.6"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -36,32 +36,10 @@ jobs:
uses: actions/cache@v4
with:
path: dist
key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.os }}

# buid-conda:
# runs-on: "ubuntu-24.04"
# needs: [ build ]
# steps:
# - uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# python-version: 3.10.6
# # Add openfisca channel for OpenFisca-Core
# channels: conda-forge, openfisca
# activate-environment: true
# - uses: actions/checkout@v4
# with:
# fetch-depth: 1 # Fetch all the tags
# - name: Conda config
# run: |
# conda install conda-build
# conda info
# - name: Conda build
# # See .conda/meta.yaml for more information on the built package
# run: conda build --channel openfisca .conda
key: release-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }}-${{ matrix.os }}

lint-files:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs: [ build ]
steps:
- uses: actions/checkout@v4
Expand All @@ -70,13 +48,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9.9
python-version: 3.9.13
- name: Cache build
id: restore-build
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }}-ubuntu-20.04
key: build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }}-ubuntu-24.04
- run: pip install -e .[dev] # Need to install linter
- run: make check-syntax-errors
- run: make check-style
Expand All @@ -87,8 +65,8 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ "ubuntu-20.04" ] # On peut ajouter "macos-latest" si besoin
python-version: ["3.9.9", "3.10.6"]
os: [ "ubuntu-24.04" ] # On peut ajouter "macos-latest" si besoin
python-version: ["3.9.13", "3.10.6"]
env:
# Needed for coveralls
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -112,7 +90,7 @@ jobs:
run: coveralls --service=github

check-version-and-changelog:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs: [ lint-files, build ] # TODO: Replace build by test-python
steps:
- uses: actions/checkout@v4
Expand All @@ -121,15 +99,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9.9
python-version: 3.9.13
- name: Check version number has been properly updated
run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh"

# GitHub Actions does not have a halt job option, to stop from deploying if no functional changes were found.
# We build a separate job to substitute the halt option.
# The `deploy` job is dependent on the output of the `check-for-functional-changes` job.
check-for-functional-changes:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch
needs: [ check-version-and-changelog ]
outputs:
Expand All @@ -141,12 +119,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9.9
python-version: 3.9.13
- id: stop-early
run: if "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" ; then echo "has_functional_changes_status=detected_functional_changes" >> $GITHUB_OUTPUT ; fi

deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs: [ check-for-functional-changes ]
if: needs.check-for-functional-changes.outputs.status == 'detected_functional_changes'
env:
Expand All @@ -158,62 +136,20 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9.9
python-version: 3.9.13
- name: Cache build
id: restore-build
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }}-ubuntu-20.04
key: build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }}-ubuntu-24.04
- name: Cache release
id: restore-release
uses: actions/cache@v4
with:
path: dist
key: release-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }}-ubuntu-20.04
key: release-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }}-ubuntu-24.04
- name: Upload a Python package to PyPi
run: twine upload dist/* --username __token__ --password $PYPI_TOKEN_OPENFISCA_BOT
- name: Publish a git tag
run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh"

# publish-to-conda:
# runs-on: "ubuntu-24.04"
# needs: [ deploy, buid-conda ]
# steps:
# - uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# python-version: 3.10.6
# # Add openfisca channel for OpenFisca-Core
# channels: conda-forge, openfisca
# activate-environment: true
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0 # Fetch all the tags
# - name: Conda config
# run: |
# conda install conda-build anaconda-client
# conda info
# conda config --set anaconda_upload yes
# - name: Conda build
# # See .conda/meta.yaml for more information on the built package
# run: conda build --token ${{ secrets.ANACONDA_TOKEN }} --user openfisca --channel openfisca .conda

# test-on-windows:
# runs-on: "windows-latest"
# needs: [ publish-to-conda ]
# steps:
# - uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# python-version: 3.10.6
# # Add openfisca channel for OpenFisca-Core
# channels: conda-forge, openfisca
# activate-environment: true
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0 # Fetch all the tags
# - name: Install with conda
# run: conda install openfisca-survey-manager
# - name: Buid Collection
# run: build-collection
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

# 3.0.1 [#322](https://github.com/openfisca/openfisca-survey-manager/pull/322)

* Technical changes
- Fix build.

# 3.0.0 [#320](https://github.com/openfisca/openfisca-survey-manager/pull/320)

* Technical changes
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "OpenFisca-Survey-Manager"
version = "3.0.0"
version = "3.0.1"
description = "A tool for managing survey/administrative data and import them in OpenFisca"
readme = "README.md"
keywords = ["microsimulation", "tax", "benefit", "rac", "rules-as-code", "survey", "data"]
Expand Down

0 comments on commit caafc7c

Please sign in to comment.