-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from openfisca/msa_release_gaston
Réintégration de la version 4.0.2 dans la branche MSA
- Loading branch information
Showing
12 changed files
with
237 additions
and
52 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import re | ||
|
||
|
||
with open('./setup.py') as file: | ||
for line in file: | ||
version = re.search(r'(Core|France)\s*>=\s*([\d\.]*)', line) | ||
if version: | ||
print(f'Openfisca-{version[1]}=={version[2]}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#! /usr/bin/env bash | ||
|
||
IGNORE_DIFF_ON="README.md CONTRIBUTING.md Makefile .gitignore .github/*" | ||
|
||
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 | ||
|
||
if git diff-index --name-only --exit-code $last_tagged_commit -- . `echo " $IGNORE_DIFF_ON" | sed 's/ / :(exclude)/g'` # Check if any file that has not be listed in IGNORE_DIFF_ON has changed since the last tag was published. | ||
then | ||
echo "No functional changes detected." | ||
exit 1 | ||
else echo "The functional files above were changed." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#! /usr/bin/env bash | ||
|
||
if [[ ${GITHUB_REF#refs/heads/} == master ]] | ||
then | ||
echo "No need for a version check on master." | ||
exit 0 | ||
fi | ||
|
||
if ! $(dirname "$BASH_SOURCE")/has-functional-changes.sh | ||
then | ||
echo "No need for a version update." | ||
exit 0 | ||
fi | ||
|
||
current_version=`python setup.py --version` | ||
|
||
if git rev-parse --verify --quiet $current_version | ||
then | ||
echo "Version $current_version already exists in commit:" | ||
git --no-pager log -1 $current_version | ||
echo | ||
echo "Update the version number in setup.py before merging this branch into master." | ||
echo "Look at the CONTRIBUTING.md file to learn how the version number should be updated." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#! /usr/bin/env bash | ||
|
||
git tag `python setup.py --version` | ||
git push --tags # update the repository version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
name: OpenFisca Paris | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
openfisca-dependencies: [minimal, maximal] | ||
python-version: ["3.9.9", "3.10.6"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Cache build | ||
id: restore-build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.openfisca-dependencies }} | ||
restore-keys: | # in case of a cache miss (systematically unless the same commit is built repeatedly), the keys below will be used to restore dependencies from previous builds, and the cache will be stored at the end of the job, making up-to-date dependencies available for all jobs of the workflow; see more at https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action | ||
build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} | ||
build-${{ env.pythonLocation }}- | ||
- name: Install test dependancies | ||
run: make install-test | ||
- name: Build package | ||
run: make build | ||
- name: Minimal version | ||
if: matrix.openfisca-dependencies == 'minimal' | ||
run: | # Installs the OpenFisca dependencies minimal version from setup.py | ||
pip install $(python ${GITHUB_WORKSPACE}/.github/get_minimal_version.py) | ||
- name: Cache release | ||
id: restore-release | ||
uses: actions/cache@v3 | ||
with: | ||
path: dist | ||
key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.openfisca-dependencies }} | ||
test-yaml: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
openfisca-dependencies: [minimal, maximal] | ||
needs: [ build ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9.9 | ||
- name: Cache build | ||
id: restore-build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.openfisca-dependencies }} | ||
- name: Run YAML test | ||
run: | | ||
openfisca test tests --country-package openfisca_france --extensions openfisca_paris | ||
check-version: | ||
runs-on: ubuntu-20.04 | ||
needs: [ test-yaml ] # Last job to run | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch all the tags | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9.9 | ||
- 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 | ||
if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch | ||
needs: [ check-version ] | ||
outputs: | ||
status: ${{ steps.stop-early.outputs.status }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch all the tags | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9.9 | ||
- id: stop-early | ||
run: if "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" ; then echo "::set-output name=status::success" ; fi | ||
|
||
deploy: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
openfisca-dependencies: [maximal] | ||
needs: [ check-for-functional-changes ] | ||
if: needs.check-for-functional-changes.outputs.status == 'success' | ||
env: | ||
PYPI_USERNAME: openfisca-bot | ||
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch all the tags | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9.9 | ||
- name: Cache build | ||
id: restore-build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.openfisca-dependencies }} | ||
- name: Cache release | ||
id: restore-release | ||
uses: actions/cache@v3 | ||
with: | ||
path: dist | ||
key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }}-${{ matrix.openfisca-dependencies }} | ||
- name: Upload a Python package to PyPi | ||
run: twine upload dist/* --username $PYPI_USERNAME --password $PYPI_PASSWORD | ||
- name: Publish a git tag | ||
run: "${GITHUB_WORKSPACE}/.github/publish-git-tag.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
from setuptools import setup, find_packages | ||
from setuptools import setup, find_namespace_packages | ||
|
||
setup( | ||
name="Openfisca-Paris", | ||
version="2.4.1", | ||
version="4.0.2", | ||
author="OpenFisca Team", | ||
author_email="[email protected]", | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"License :: OSI Approved :: GNU Affero General Public License v3", | ||
"Operating System :: POSIX", | ||
"Programming Language :: Python", | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
"Topic :: Scientific/Engineering :: Information Analysis", | ||
], | ||
description="Plugin OpenFisca pour les aides sociales de la mairie de Paris", | ||
keywords="benefit france paris microsimulation social tax", | ||
license="http://www.fsf.org/licensing/licenses/agpl-3.0.html", | ||
author="Mairie de Paris, Incubateur de Services Numériques (SGMAP)", | ||
packages=find_packages(), | ||
|
||
packages=find_namespace_packages(), | ||
include_package_data=True, | ||
install_requires=[ | ||
'OpenFisca-Core >= 35.2.0, < 36', | ||
'OpenFisca-France >= 61, < 81' | ||
'OpenFisca-Core >= 40.0.1, <= 41.0.0', | ||
'OpenFisca-France >= 149.1.1, < 150', | ||
], | ||
extras_require = { | ||
extras_require={ | ||
'test': [ | ||
'nose', | ||
'pytest >= 5.4.2' | ||
] | ||
] | ||
}, | ||
classifiers=[ | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3.7", | ||
] | ||
) |