-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6bb147
commit eb4fc5b
Showing
4 changed files
with
39 additions
and
15 deletions.
There are no files selected for viewing
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,17 +1,35 @@ | ||
#!/usr/bin/env python | ||
|
||
"""Fetch and print the minimal versions of Openfisca. | ||
This script fetches and prints the minimal versions of Openfisca-Core and | ||
Openfisca-France dependencies in order to ensure their compatibility during CI | ||
testing. | ||
""" | ||
|
||
import re | ||
|
||
# This script fetches and prints the minimal versions of Openfisca-Core and Openfisca-France | ||
# dependencies in order to ensure their compatibility during CI testing | ||
with open('./setup.py') as file: | ||
for line in file: | ||
#: Check for released versions. | ||
version = re.search(r'(Core|France)\s*>=\s*([\d\.]*)', line) | ||
|
||
#: Check for pre-release versions. | ||
pre = re.search(r'(Core|France)\s@\s(.*)\'\,$', line) | ||
def fetch_versions_from_setup(): | ||
"""Fetch the versions from the setup.py file.""" | ||
with open('./setup.py') as file: | ||
for line in file: | ||
check_and_print_released(line) | ||
check_and_print_pre(line) | ||
|
||
|
||
def check_and_print_released(line): | ||
"""Check for released versions.""" | ||
if version := re.search(r'(Core|France)\s*>=\s*([\d.]*)', line): | ||
print(f'OpenFisca-{version[1]}=={version[2]}') # noqa: T201 <- This is to avoid flake8 print detection. | ||
|
||
|
||
def check_and_print_pre(line): | ||
"""Check for pre-release versions.""" | ||
if pre := re.search(r'(Core|France)\s@\s(.*)\',$', line): | ||
print(f'{pre[2]}') # noqa: T201 <- The same as supra. | ||
|
||
if version: | ||
print(f'OpenFisca-{version[1]}=={version[2]}') # noqa: T201 <- This is to avoid flake8 print detection. | ||
|
||
if pre: | ||
print(f'{pre[2]}') # noqa: T201 <- The same as supra. | ||
if __name__ == '__main__': | ||
fetch_versions_from_setup() |
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
setup( | ||
name = 'OpenFisca-France', | ||
version = '168.1.3', | ||
version = '168.1.4', | ||
author = 'OpenFisca Team', | ||
author_email = '[email protected]', | ||
classifiers = [ | ||
|
@@ -65,7 +65,7 @@ | |
}, | ||
include_package_data = True, # Will read MANIFEST.in | ||
install_requires = [ | ||
'OpenFisca-Core @ https://github.com/openfisca/openfisca-core/archive/fix-mypy-checks-periods.zip', | ||
'OpenFisca-Core >=42.0.0, <43.0', | ||
], | ||
packages = find_namespace_packages(exclude = [ | ||
'openfisca_france.tests*', | ||
|