Skip to content

Commit

Permalink
Merge branch 'master' into add-protocol-data-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Sep 25, 2023
2 parents 0e2fedb + 2c04dae commit 7bc28a8
Show file tree
Hide file tree
Showing 191 changed files with 9,048 additions and 5,806 deletions.
64 changes: 31 additions & 33 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
###############################################################################
## File for Anaconda.org
## WARNING : strings PYPI VERSION, PYPI URL and PYPI SHA256 will be replaced
## by CI script get_pypi_info.py, leave them as is.
## It use Jinja2 templating code to retreive information from setup.py
###############################################################################

{% set name = "OpenFisca-Core" %}
{% set version = "PYPI_VERSION" %}
{% set data = load_setup_py_data() %}
{% set version = data.get('version') %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: PYPI_URL
sha256: PYPI_SHA256
path: ..

build:
noarch: python
Expand All @@ -28,23 +27,26 @@ 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
{% for req in data.get('install_requires', []) %}
- {{ req }}
{% endfor %}
# - PyYAML >=6.0,<7.0
# - dpath >=2.1.4,<3.0.0
# - importlib-metadata >=6.1.0,<7.0
# - numexpr >=2.8.4,<=3.0
# - numpy >=1.24.2,<1.25.0
# - pendulum >=2.1.2,<3.0.0
# - psutil >=5.9.4,<6.0.0
# - pytest >=7.2.2,<8.0.0
# - python >=3.9,<4.0
# - sortedcontainers >=2.4.0
# - typing-extensions >=4.5.0,<5.0

test:
imports:
- openfisca_core
- openfisca_core.commons
requires:
- pytest >=4.4.1,<6.0.0
- pip
commands:
- pip check
Expand All @@ -61,11 +63,15 @@ 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.9,<4.0
{% for req in data.get('api_requirements', []) %}
- {{ req }}
{% endfor %}
#
# - flask >=2.2.3,<3.0
# - flask-cors >=3.0.10,<4.0
# - gunicorn >=20.1.0,<21.0.0
# - werkzeug >=2.2.3,<3.0.0
- {{ pin_subpackage('openfisca-core', exact=True) }}

- name: openfisca-core-dev
Expand All @@ -75,18 +81,10 @@ 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
- python >=3.9,<4.0
{% for req in data.get('dev_requirements', []) %}
- {{ req }}
{% endfor %}
- {{ pin_subpackage('openfisca-core-api', exact=True) }}

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

This file was deleted.

14 changes: 8 additions & 6 deletions .github/get_pypi_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_info(package_name: str = "") -> dict:
if package_name == "":
raise ValueError("Package name not provided.")
url = f"https://pypi.org/pypi/{package_name}/json"
print(f"Calling {url}") # noqa: T001
print(f"Calling {url}") # noqa: T201
resp = requests.get(url)
if resp.status_code != 200:
raise Exception(f"ERROR calling PyPI ({url}) : {resp}")
Expand All @@ -34,7 +34,7 @@ def get_info(package_name: str = "") -> dict:
"last_version": version,
"url": v["url"],
"sha256": v["digests"]["sha256"],
}
}
return {}


Expand All @@ -52,7 +52,7 @@ def replace_in_file(filepath: str, info: dict):
meta = meta.replace("PYPI_SHA256", info["sha256"])
with open(filepath, "wt", encoding="utf-8") as fout:
fout.write(meta)
print(f"File {filepath} has been updated with info from PyPi.") # noqa: T001
print(f"File {filepath} has been updated with info from PyPi.") # noqa: T201


if __name__ == "__main__":
Expand All @@ -64,15 +64,17 @@ def replace_in_file(filepath: str, info: dict):
default="",
required=True,
help="The name of the package",
)
)
parser.add_argument(
"-f",
"--filename",
type=str,
default=".conda/meta.yaml",
help="Path to meta.yaml, with filename",
)
)
args = parser.parse_args()
info = get_info(args.package)
print("Information of the last published PyPi package :", info["last_version"]) # noqa: T001
print( # noqa: T201
"Information of the last published PyPi package :", info["last_version"]
)
replace_in_file(args.filename, info)
Loading

0 comments on commit 7bc28a8

Please sign in to comment.