Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.8 #1168

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e1d4514
Add matrix
bonjourmauko Dec 1, 2022
edcf671
Add Python 3.8
bonjourmauko Dec 1, 2022
26c2307
Drop support for 3.8
bonjourmauko Dec 1, 2022
fefe25c
Fix typo in matrix.os
bonjourmauko Dec 1, 2022
8448784
Remove leftover check-numpy
bonjourmauko Dec 1, 2022
3c0cdd7
Fix matrix def
bonjourmauko Dec 1, 2022
4cb61a4
Fix doctest in Holder
bonjourmauko Dec 1, 2022
5739948
Fix cache in Windows
bonjourmauko Dec 1, 2022
7e0fede
Do not test country-package in Windows
bonjourmauko Dec 1, 2022
eac6784
Skip failing tests on Windows
bonjourmauko Dec 1, 2022
ebda8aa
Optimise cache
bonjourmauko Dec 1, 2022
5d99c4f
Fix dependency conflict
bonjourmauko Dec 1, 2022
8a3d63c
Reduce cache size
bonjourmauko Dec 1, 2022
b932925
Fix lint
bonjourmauko Dec 2, 2022
675c4a6
Fix tests
bonjourmauko Dec 2, 2022
713ae39
Collect tests
bonjourmauko Dec 2, 2022
4c7b4df
Fix core tests path
bonjourmauko Dec 2, 2022
c3489f1
Run template tests on Windows
bonjourmauko Dec 2, 2022
050a268
Cache openfisca bin
bonjourmauko Dec 2, 2022
5b333bf
Use virtualenv
bonjourmauko Dec 2, 2022
1cc90e8
Apply suggestions from code review
bonjourmauko Dec 12, 2022
5809252
Refactor git tag into Makefile
bonjourmauko Dec 12, 2022
3c9de5c
Update README.md
bonjourmauko Dec 12, 2022
046f7f9
Document dependencies inclusion change
MattiSG Dec 13, 2022
67ec505
Refactor the deps action
bonjourmauko Dec 13, 2022
6563f1f
Fix typo in 'input'
bonjourmauko Dec 13, 2022
b497e69
Fix typo in 'input' (2/2)
bonjourmauko Dec 13, 2022
68171eb
Refactor the build action
bonjourmauko Dec 13, 2022
f5897e1
Fix dependency in job
bonjourmauko Dec 13, 2022
5669775
Refactor test & lint actions
bonjourmauko Dec 13, 2022
467198b
Fix jobs dependencies
bonjourmauko Dec 13, 2022
0bce283
Fix typo in lint-style
bonjourmauko Dec 13, 2022
c5c016d
Add web trigger
bonjourmauko Dec 13, 2022
319d015
Fix deploy in Github Actions
bonjourmauko Dec 13, 2022
1fce7fb
Rename workflows
bonjourmauko Dec 13, 2022
51272c3
Remove spurious newline
bonjourmauko Dec 13, 2022
b8434b0
Skip web workflow for now
bonjourmauko Jan 22, 2023
76856d6
Sync Conda deps with PyPi
benoit-cty Jan 24, 2023
51272ee
Bump version
bonjourmauko Dec 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 35 additions & 28 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,24 @@ requirements:
- python
- pip
run:
- python >=3.6,<4.0
- dpath >=1.5.0,<3.0.0
- nptyping ==1.4.4
- numexpr >=2.7.0,<=3.0
- numpy >=1.11,<1.21
- psutil >=5.4.7,<6.0.0
- pytest >=4.4.1,<6.0.0
- PyYAML >=3.10
- sortedcontainers ==2.2.2
- typing-extensions ==3.10.0.2
- python >= 3.7, < 4.0
- PyYAML >= 6.0.0, < 7.0.0
- dpath >= 2.1.0, < 3.0.0
- importlib-metadata < 4.3.0
- nptyping == 1.4.4
- numexpr >= 2.8.0, <= 3.0.0
- numpy >= 1.20, < 1.21
- psutil >= 5.9.0, < 6.0.0
- pytest >= 5.4.0, < 6.0.0
- sortedcontainers == 2.2.2
- typing-extensions >= 4.4.0, < 5.0.0

test:
imports:
- openfisca_core
- openfisca_core.commons
requires:
- pytest >=4.4.1,<6.0.0
- pytest >= 5.4.0, < 6.0.0
- pip
commands:
- pip check
Expand All @@ -61,11 +62,12 @@ outputs:
host:
- python
run:
- python >=3.6,<4.0
- flask ==1.1.2
- flask-cors ==3.0.10
- gunicorn >=20.0.0,<21.0.0
- werkzeug >=1.0.0,<2.0.0
- python >= 3.7, < 4.0
- markupsafe == 2.0.1
- flask == 1.1.4
- flask-cors == 3.0.10
- gunicorn >= 20.1.0, < 21.0.0
- werkzeug >= 1.0.0, < 2.0.0
- {{ pin_subpackage('openfisca-core', exact=True) }}

- name: openfisca-core-dev
Expand All @@ -75,18 +77,23 @@ outputs:
host:
- python
run:
- autopep8 >=1.4.0,<1.6.0
- coverage ==6.0.2
- darglint ==1.8.0
- flake8 >=3.9.0,<4.0.0
- flake8-bugbear >=19.3.0,<20.0.0
- flake8-docstrings ==1.6.0
- flake8-print >=3.1.0,<4.0.0
- flake8-rst-docstrings ==0.2.3
- mypy ==0.910
- openfisca-country-template >=3.10.0,<4.0.0
- openfisca-extension-template >=1.2.0rc0,<2.0.0
- pylint ==2.10.2
- autopep8 >= 1.5.0, < 1.6.0
- coverage >= 6.5.0, < 7.0.0
- darglint == 1.8.0
- flake8 >= 4.0.0, < 4.1.0
- flake8-bugbear >= 19.8.0, < 20.0.0
- flake8-docstrings == 1.6.0
- flake8-print >= 3.1.0, < 4.0.0
- flake8-rst-docstrings == 0.2.3
- idna >= 3.4.0, < 4.0.0
- isort >= 5.11.0, < 6.0.0
- mypy == 0.910
- openapi-spec-validator >= 0.5.0, < 0.6.0
- pycodestyle >= 2.8.0, < 2.9.0
- pylint == 2.10.2
- xdoctest >= 1.1.0, < 2.0.0
- openfisca-country-template >= 5.0.0, < 6.0.0
- openfisca-extension-template >= 1.3.13, < 2.0.0
- {{ pin_subpackage('openfisca-core-api', exact=True) }}

about:
Expand Down
8 changes: 0 additions & 8 deletions .github/dependabot.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/get-numpy-version.py

This file was deleted.

4 changes: 0 additions & 4 deletions .github/publish-git-tag.sh

This file was deleted.

102 changes: 102 additions & 0 deletions .github/workflows/_before.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Setup package

on:
workflow_call:
inputs:
os:
required: true
type: string

numpy:
required: true
type: string

python:
required: true
type: string

activate_command:
required: true
type: string

jobs:
deps:
runs-on: ${{ inputs.os }}
name: deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}
env:
TERM: xterm-256color # To colorize output of make tasks.

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python }}

- name: Use zstd for faster cache restore (windows)
if: ${{ startsWith(inputs.os, 'windows') }}
shell: cmd
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"

- name: Cache dependencies
id: restore-deps
uses: actions/cache@v3
with:
path: venv
key: deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}
restore-keys: deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-

- name: Install dependencies
run: |
python -m venv venv
${{ inputs.activate_command }}
make install-deps install-dist

build:
runs-on: ${{ inputs.os }}
needs: [ deps ]
name: build-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}
env:
TERM: xterm-256color # To colorize output of make tasks.

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python }}

- name: Use zstd for faster cache restore (windows)
if: ${{ startsWith(inputs.os, 'windows') }}
shell: cmd
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: venv
key: deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}

- name: Cache build
uses: actions/cache@v3
with:
path: venv/**/[Oo]pen[Ff]isca*
key: build-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}-${{ github.sha }}
restore-keys: |
build-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}-
build-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-

- name: Cache release
uses: actions/cache@v3
with:
path: dist
key: release-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}-${{ github.sha }}

- name: Build package
run: |
${{ inputs.activate_command }}
make install-test clean build
62 changes: 62 additions & 0 deletions .github/workflows/_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Lint package

on:
workflow_call:
inputs:
os:
required: true
type: string

numpy:
required: true
type: string

python:
required: true
type: string

activate_command:
required: true
type: string

jobs:
lint:
runs-on: ${{ inputs.os }}
name: lint-doc-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}
env:
TERM: xterm-256color # To colorize output of make tasks.

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python }}

- name: Use zstd for faster cache restore (windows)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how setting GITHUB_PATH make the cache use zstd ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This a recipe that comes straight from the doc. When we tested in actually worked.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which doc are you referring to ? I don't find anything on the relationship between GITHUB_PATH and zstd.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the Github Doc, however I do not find that piece of code anymore https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows . I suspect it is because of this particular version of windoes as with new python versions they use a new one, as with ubuntu.

if: ${{ startsWith(inputs.os, 'windows') }}
shell: cmd
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: venv
key: deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}

- name: Lint doc
run: |
${{ inputs.activate_command }}
make clean compile lint-doc

- name: Lint styles
run: |
${{ inputs.activate_command }}
make clean compile lint-style

- name: Lint typing
run: |
${{ inputs.activate_command }}
make clean compile lint-typing lint-typing-strict
72 changes: 72 additions & 0 deletions .github/workflows/_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Test package

on:
workflow_call:
inputs:
os:
required: true
type: string

numpy:
required: true
type: string

python:
required: true
type: string

activate_command:
required: true
type: string

jobs:
test:
runs-on: ${{ inputs.os }}
name: test-core-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TERM: xterm-256color # To colorize output of make tasks.

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python }}

- name: Use zstd for faster cache restore (windows)
bonjourmauko marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ startsWith(inputs.os, 'windows') }}
shell: cmd
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: venv
key: deps-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}

- name: Cache build
uses: actions/cache@v3
with:
path: venv/**/[Oo]pen[Ff]isca*
key: build-${{ inputs.os }}-np${{ inputs.numpy }}-py${{ inputs.python }}-${{ hashFiles('setup.py') }}-${{ github.sha }}

- name: Run Openfisca Core tests
run: |
${{ inputs.activate_command }}
make test-core
python -m coveralls --service=github

- name: Run Country Template tests
if: ${{ startsWith(inputs.os, 'ubuntu') }}
run: |
${{ inputs.activate_command }}
make test-country

- name: Run Extension Template tests
if: ${{ startsWith(inputs.os, 'ubuntu') }}
run: |
${{ inputs.activate_command }}
make test-extension
Loading