diff --git a/.circleci/config.yml b/.circleci/config.yml index 986bf3cc33..00a2995b34 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ jobs: - run: name: Install dependencies command: | - make install-deps + make clean install-deps # pip install --editable git+https://github.com/openfisca/country-template.git@BRANCH_NAME#egg=OpenFisca-Country-Template # use a specific branch of OpenFisca-Country-Template # pip install --editable git+https://github.com/openfisca/extension-template.git@BRANCH_NAME#egg=OpenFisca-Extension-Template # use a specific branch of OpenFisca-Extension-Template diff --git a/CHANGELOG.md b/CHANGELOG.md index 82ea091375..42ea9b44f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### 35.5.4 [#1059](https://github.com/openfisca/openfisca-core/pull/1059) + +#### Non-technical changes + +- Move published code to `src`. +- Use `setup.cfg` for metadata. + ### 35.5.3 [#1058](https://github.com/openfisca/openfisca-core/pull/1058) #### Non-technical changes diff --git a/MANIFEST.in b/MANIFEST.in index 166788d7fa..dfdedebca3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ -recursive-include openfisca_core/scripts * -include openfisca_web_api/openAPI.yml +recursive-include src * +global-exclude *.py[cod] diff --git a/setup.cfg b/setup.cfg index 4f98591eeb..3e9bf9b0e4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,46 @@ -; E128/133: We prefer hang-closing visual indents -; E251: We prefer `function(x = 1)` over `function(x=1)` -; E501: We do not enforce a maximum line length -; F403/405: We ignore * imports -; W503/504: We break lines before binary operators (Knuth's style) +[metadata] +name = OpenFisca-Core +version = 35.5.4 +author = OpenFisca Team +author_email = contact@openfisca.org +license = https://www.fsf.org/licensing/licenses/agpl-3.0.html +license_files = file: LICENSE +url = https://github.com/openfisca/openfisca-core +keywords = benefit, microsimulation, social, tax +description = A versatile microsimulation free software +long_description = file: README.md, CONTRIBUTING.md, STYLEGUIDE.md, CHANGELOG.md +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.6 + Programming Language :: Python :: 3.7 + Topic :: Scientific/Engineering :: Information Analysis + +[options] +packages = find: +package_dir = = src +include_package_data = True +python_requires = >= 3.6 + +[options.packages.find] +where = src + +[options.entry_points] +console_scripts = + openfisca = openfisca_core.scripts.openfisca_command:main + openfisca-run-test = openfisca_core.scripts.openfisca_command:main + +[coverage:run] +disable_warnings = module-not-measured [flake8] +# E128/133: We prefer hang-closing visual indents. +# E251: We prefer `function(x = 1)` over `function(x=1)`. +# E501: We do not enforce a maximum line length. +# F403/405: We ignore * imports. +# W503/504: We break lines before binary operators (Knuth's style). hang-closing = true ignore = E128,E251,F403,F405,E501,W503,W504 in-place = true @@ -12,9 +48,9 @@ rst-roles = any, class, exc, meth, obj rst-directives = attribute [tool:pytest] -addopts = --showlocals --doctest-modules --disable-pytest-warnings -testpaths = tests -python_files = **/*.py +addopts = --showlocals --doctest-modules --disable-pytest-warnings +testpaths = tests +python_files = **/*.py [mypy] ignore_missing_imports = True diff --git a/setup.py b/setup.py index 1935635464..9e4205615f 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ #! /usr/bin/env python -from setuptools import setup, find_packages +from setuptools import setup # Please make sure to cap all dependency versions, in order to avoid unwanted # functional and integration breaks caused by external code updates. @@ -36,35 +36,7 @@ setup( name = 'OpenFisca-Core', - version = '35.5.3', - author = 'OpenFisca Team', - author_email = 'contact@openfisca.org', - 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.6', - 'Programming Language :: Python :: 3.7', - 'Topic :: Scientific/Engineering :: Information Analysis', - ], - description = 'A versatile microsimulation free software', - keywords = 'benefit microsimulation social tax', - license = 'https://www.fsf.org/licensing/licenses/agpl-3.0.html', - url = 'https://github.com/openfisca/openfisca-core', - - data_files = [ - ( - 'share/openfisca/openfisca-core', - ['CHANGELOG.md', 'LICENSE', 'README.md'], - ), - ], - entry_points = { - 'console_scripts': [ - 'openfisca=openfisca_core.scripts.openfisca_command:main', - 'openfisca-run-test=openfisca_core.scripts.openfisca_command:main', - ], - }, + install_requires = general_requirements, extras_require = { 'web-api': api_requirements, 'dev': dev_requirements, @@ -72,7 +44,4 @@ 'openfisca-tracker == 0.4.0', ], }, - include_package_data = True, # Will read MANIFEST.in - install_requires = general_requirements, - packages = find_packages(exclude=['tests*']), ) diff --git a/openfisca_core/__init__.py b/src/openfisca_core/__init__.py similarity index 100% rename from openfisca_core/__init__.py rename to src/openfisca_core/__init__.py diff --git a/openfisca_core/commons/__init__.py b/src/openfisca_core/commons/__init__.py similarity index 100% rename from openfisca_core/commons/__init__.py rename to src/openfisca_core/commons/__init__.py diff --git a/openfisca_core/commons/dummy.py b/src/openfisca_core/commons/dummy.py similarity index 100% rename from openfisca_core/commons/dummy.py rename to src/openfisca_core/commons/dummy.py diff --git a/openfisca_core/commons/formulas.py b/src/openfisca_core/commons/formulas.py similarity index 100% rename from openfisca_core/commons/formulas.py rename to src/openfisca_core/commons/formulas.py diff --git a/openfisca_core/commons/misc.py b/src/openfisca_core/commons/misc.py similarity index 100% rename from openfisca_core/commons/misc.py rename to src/openfisca_core/commons/misc.py diff --git a/openfisca_core/commons/rates.py b/src/openfisca_core/commons/rates.py similarity index 100% rename from openfisca_core/commons/rates.py rename to src/openfisca_core/commons/rates.py diff --git a/openfisca_core/data_storage/__init__.py b/src/openfisca_core/data_storage/__init__.py similarity index 100% rename from openfisca_core/data_storage/__init__.py rename to src/openfisca_core/data_storage/__init__.py diff --git a/openfisca_core/data_storage/in_memory_storage.py b/src/openfisca_core/data_storage/in_memory_storage.py similarity index 100% rename from openfisca_core/data_storage/in_memory_storage.py rename to src/openfisca_core/data_storage/in_memory_storage.py diff --git a/openfisca_core/data_storage/on_disk_storage.py b/src/openfisca_core/data_storage/on_disk_storage.py similarity index 100% rename from openfisca_core/data_storage/on_disk_storage.py rename to src/openfisca_core/data_storage/on_disk_storage.py diff --git a/openfisca_core/entities/__init__.py b/src/openfisca_core/entities/__init__.py similarity index 100% rename from openfisca_core/entities/__init__.py rename to src/openfisca_core/entities/__init__.py diff --git a/openfisca_core/entities/entity.py b/src/openfisca_core/entities/entity.py similarity index 100% rename from openfisca_core/entities/entity.py rename to src/openfisca_core/entities/entity.py diff --git a/openfisca_core/entities/group_entity.py b/src/openfisca_core/entities/group_entity.py similarity index 100% rename from openfisca_core/entities/group_entity.py rename to src/openfisca_core/entities/group_entity.py diff --git a/openfisca_core/entities/helpers.py b/src/openfisca_core/entities/helpers.py similarity index 100% rename from openfisca_core/entities/helpers.py rename to src/openfisca_core/entities/helpers.py diff --git a/openfisca_core/entities/role.py b/src/openfisca_core/entities/role.py similarity index 100% rename from openfisca_core/entities/role.py rename to src/openfisca_core/entities/role.py diff --git a/openfisca_core/errors/__init__.py b/src/openfisca_core/errors/__init__.py similarity index 100% rename from openfisca_core/errors/__init__.py rename to src/openfisca_core/errors/__init__.py diff --git a/openfisca_core/errors/cycle_error.py b/src/openfisca_core/errors/cycle_error.py similarity index 100% rename from openfisca_core/errors/cycle_error.py rename to src/openfisca_core/errors/cycle_error.py diff --git a/openfisca_core/errors/empty_argument_error.py b/src/openfisca_core/errors/empty_argument_error.py similarity index 100% rename from openfisca_core/errors/empty_argument_error.py rename to src/openfisca_core/errors/empty_argument_error.py diff --git a/openfisca_core/errors/nan_creation_error.py b/src/openfisca_core/errors/nan_creation_error.py similarity index 100% rename from openfisca_core/errors/nan_creation_error.py rename to src/openfisca_core/errors/nan_creation_error.py diff --git a/openfisca_core/errors/parameter_not_found_error.py b/src/openfisca_core/errors/parameter_not_found_error.py similarity index 100% rename from openfisca_core/errors/parameter_not_found_error.py rename to src/openfisca_core/errors/parameter_not_found_error.py diff --git a/openfisca_core/errors/parameter_parsing_error.py b/src/openfisca_core/errors/parameter_parsing_error.py similarity index 100% rename from openfisca_core/errors/parameter_parsing_error.py rename to src/openfisca_core/errors/parameter_parsing_error.py diff --git a/openfisca_core/errors/period_mismatch_error.py b/src/openfisca_core/errors/period_mismatch_error.py similarity index 100% rename from openfisca_core/errors/period_mismatch_error.py rename to src/openfisca_core/errors/period_mismatch_error.py diff --git a/openfisca_core/errors/situation_parsing_error.py b/src/openfisca_core/errors/situation_parsing_error.py similarity index 100% rename from openfisca_core/errors/situation_parsing_error.py rename to src/openfisca_core/errors/situation_parsing_error.py diff --git a/openfisca_core/errors/spiral_error.py b/src/openfisca_core/errors/spiral_error.py similarity index 100% rename from openfisca_core/errors/spiral_error.py rename to src/openfisca_core/errors/spiral_error.py diff --git a/openfisca_core/errors/variable_name_config_error.py b/src/openfisca_core/errors/variable_name_config_error.py similarity index 100% rename from openfisca_core/errors/variable_name_config_error.py rename to src/openfisca_core/errors/variable_name_config_error.py diff --git a/openfisca_core/errors/variable_not_found_error.py b/src/openfisca_core/errors/variable_not_found_error.py similarity index 100% rename from openfisca_core/errors/variable_not_found_error.py rename to src/openfisca_core/errors/variable_not_found_error.py diff --git a/openfisca_core/experimental/__init__.py b/src/openfisca_core/experimental/__init__.py similarity index 100% rename from openfisca_core/experimental/__init__.py rename to src/openfisca_core/experimental/__init__.py diff --git a/openfisca_core/experimental/memory_config.py b/src/openfisca_core/experimental/memory_config.py similarity index 100% rename from openfisca_core/experimental/memory_config.py rename to src/openfisca_core/experimental/memory_config.py diff --git a/openfisca_core/formula_helpers.py b/src/openfisca_core/formula_helpers.py similarity index 100% rename from openfisca_core/formula_helpers.py rename to src/openfisca_core/formula_helpers.py diff --git a/openfisca_core/holders/__init__.py b/src/openfisca_core/holders/__init__.py similarity index 100% rename from openfisca_core/holders/__init__.py rename to src/openfisca_core/holders/__init__.py diff --git a/openfisca_core/holders/helpers.py b/src/openfisca_core/holders/helpers.py similarity index 100% rename from openfisca_core/holders/helpers.py rename to src/openfisca_core/holders/helpers.py diff --git a/openfisca_core/holders/holder.py b/src/openfisca_core/holders/holder.py similarity index 100% rename from openfisca_core/holders/holder.py rename to src/openfisca_core/holders/holder.py diff --git a/openfisca_core/indexed_enums/__init__.py b/src/openfisca_core/indexed_enums/__init__.py similarity index 100% rename from openfisca_core/indexed_enums/__init__.py rename to src/openfisca_core/indexed_enums/__init__.py diff --git a/openfisca_core/indexed_enums/config.py b/src/openfisca_core/indexed_enums/config.py similarity index 100% rename from openfisca_core/indexed_enums/config.py rename to src/openfisca_core/indexed_enums/config.py diff --git a/openfisca_core/indexed_enums/enum.py b/src/openfisca_core/indexed_enums/enum.py similarity index 100% rename from openfisca_core/indexed_enums/enum.py rename to src/openfisca_core/indexed_enums/enum.py diff --git a/openfisca_core/indexed_enums/enum_array.py b/src/openfisca_core/indexed_enums/enum_array.py similarity index 100% rename from openfisca_core/indexed_enums/enum_array.py rename to src/openfisca_core/indexed_enums/enum_array.py diff --git a/openfisca_core/memory_config.py b/src/openfisca_core/memory_config.py similarity index 100% rename from openfisca_core/memory_config.py rename to src/openfisca_core/memory_config.py diff --git a/openfisca_core/model_api.py b/src/openfisca_core/model_api.py similarity index 100% rename from openfisca_core/model_api.py rename to src/openfisca_core/model_api.py diff --git a/openfisca_core/parameters/__init__.py b/src/openfisca_core/parameters/__init__.py similarity index 100% rename from openfisca_core/parameters/__init__.py rename to src/openfisca_core/parameters/__init__.py diff --git a/openfisca_core/parameters/at_instant_like.py b/src/openfisca_core/parameters/at_instant_like.py similarity index 100% rename from openfisca_core/parameters/at_instant_like.py rename to src/openfisca_core/parameters/at_instant_like.py diff --git a/openfisca_core/parameters/config.py b/src/openfisca_core/parameters/config.py similarity index 100% rename from openfisca_core/parameters/config.py rename to src/openfisca_core/parameters/config.py diff --git a/openfisca_core/parameters/helpers.py b/src/openfisca_core/parameters/helpers.py similarity index 100% rename from openfisca_core/parameters/helpers.py rename to src/openfisca_core/parameters/helpers.py diff --git a/openfisca_core/parameters/parameter.py b/src/openfisca_core/parameters/parameter.py similarity index 100% rename from openfisca_core/parameters/parameter.py rename to src/openfisca_core/parameters/parameter.py diff --git a/openfisca_core/parameters/parameter_at_instant.py b/src/openfisca_core/parameters/parameter_at_instant.py similarity index 100% rename from openfisca_core/parameters/parameter_at_instant.py rename to src/openfisca_core/parameters/parameter_at_instant.py diff --git a/openfisca_core/parameters/parameter_node.py b/src/openfisca_core/parameters/parameter_node.py similarity index 100% rename from openfisca_core/parameters/parameter_node.py rename to src/openfisca_core/parameters/parameter_node.py diff --git a/openfisca_core/parameters/parameter_node_at_instant.py b/src/openfisca_core/parameters/parameter_node_at_instant.py similarity index 100% rename from openfisca_core/parameters/parameter_node_at_instant.py rename to src/openfisca_core/parameters/parameter_node_at_instant.py diff --git a/openfisca_core/parameters/parameter_scale.py b/src/openfisca_core/parameters/parameter_scale.py similarity index 100% rename from openfisca_core/parameters/parameter_scale.py rename to src/openfisca_core/parameters/parameter_scale.py diff --git a/openfisca_core/parameters/parameter_scale_bracket.py b/src/openfisca_core/parameters/parameter_scale_bracket.py similarity index 100% rename from openfisca_core/parameters/parameter_scale_bracket.py rename to src/openfisca_core/parameters/parameter_scale_bracket.py diff --git a/openfisca_core/parameters/values_history.py b/src/openfisca_core/parameters/values_history.py similarity index 100% rename from openfisca_core/parameters/values_history.py rename to src/openfisca_core/parameters/values_history.py diff --git a/openfisca_core/parameters/vectorial_parameter_node_at_instant.py b/src/openfisca_core/parameters/vectorial_parameter_node_at_instant.py similarity index 100% rename from openfisca_core/parameters/vectorial_parameter_node_at_instant.py rename to src/openfisca_core/parameters/vectorial_parameter_node_at_instant.py diff --git a/openfisca_core/periods/__init__.py b/src/openfisca_core/periods/__init__.py similarity index 100% rename from openfisca_core/periods/__init__.py rename to src/openfisca_core/periods/__init__.py diff --git a/openfisca_core/periods/config.py b/src/openfisca_core/periods/config.py similarity index 100% rename from openfisca_core/periods/config.py rename to src/openfisca_core/periods/config.py diff --git a/openfisca_core/periods/helpers.py b/src/openfisca_core/periods/helpers.py similarity index 100% rename from openfisca_core/periods/helpers.py rename to src/openfisca_core/periods/helpers.py diff --git a/openfisca_core/periods/instant_.py b/src/openfisca_core/periods/instant_.py similarity index 100% rename from openfisca_core/periods/instant_.py rename to src/openfisca_core/periods/instant_.py diff --git a/openfisca_core/periods/period_.py b/src/openfisca_core/periods/period_.py similarity index 100% rename from openfisca_core/periods/period_.py rename to src/openfisca_core/periods/period_.py diff --git a/openfisca_core/populations/__init__.py b/src/openfisca_core/populations/__init__.py similarity index 100% rename from openfisca_core/populations/__init__.py rename to src/openfisca_core/populations/__init__.py diff --git a/openfisca_core/populations/config.py b/src/openfisca_core/populations/config.py similarity index 100% rename from openfisca_core/populations/config.py rename to src/openfisca_core/populations/config.py diff --git a/openfisca_core/populations/group_population.py b/src/openfisca_core/populations/group_population.py similarity index 100% rename from openfisca_core/populations/group_population.py rename to src/openfisca_core/populations/group_population.py diff --git a/openfisca_core/populations/population.py b/src/openfisca_core/populations/population.py similarity index 100% rename from openfisca_core/populations/population.py rename to src/openfisca_core/populations/population.py diff --git a/openfisca_core/projectors/__init__.py b/src/openfisca_core/projectors/__init__.py similarity index 100% rename from openfisca_core/projectors/__init__.py rename to src/openfisca_core/projectors/__init__.py diff --git a/openfisca_core/projectors/entity_to_person_projector.py b/src/openfisca_core/projectors/entity_to_person_projector.py similarity index 100% rename from openfisca_core/projectors/entity_to_person_projector.py rename to src/openfisca_core/projectors/entity_to_person_projector.py diff --git a/openfisca_core/projectors/first_person_to_entity_projector.py b/src/openfisca_core/projectors/first_person_to_entity_projector.py similarity index 100% rename from openfisca_core/projectors/first_person_to_entity_projector.py rename to src/openfisca_core/projectors/first_person_to_entity_projector.py diff --git a/openfisca_core/projectors/helpers.py b/src/openfisca_core/projectors/helpers.py similarity index 100% rename from openfisca_core/projectors/helpers.py rename to src/openfisca_core/projectors/helpers.py diff --git a/openfisca_core/projectors/projector.py b/src/openfisca_core/projectors/projector.py similarity index 100% rename from openfisca_core/projectors/projector.py rename to src/openfisca_core/projectors/projector.py diff --git a/openfisca_core/projectors/unique_role_to_entity_projector.py b/src/openfisca_core/projectors/unique_role_to_entity_projector.py similarity index 100% rename from openfisca_core/projectors/unique_role_to_entity_projector.py rename to src/openfisca_core/projectors/unique_role_to_entity_projector.py diff --git a/openfisca_core/rates.py b/src/openfisca_core/rates.py similarity index 100% rename from openfisca_core/rates.py rename to src/openfisca_core/rates.py diff --git a/openfisca_core/reforms/__init__.py b/src/openfisca_core/reforms/__init__.py similarity index 100% rename from openfisca_core/reforms/__init__.py rename to src/openfisca_core/reforms/__init__.py diff --git a/openfisca_core/reforms/reform.py b/src/openfisca_core/reforms/reform.py similarity index 100% rename from openfisca_core/reforms/reform.py rename to src/openfisca_core/reforms/reform.py diff --git a/openfisca_core/scripts/__init__.py b/src/openfisca_core/scripts/__init__.py similarity index 100% rename from openfisca_core/scripts/__init__.py rename to src/openfisca_core/scripts/__init__.py diff --git a/openfisca_core/scripts/assets/__init__.py b/src/openfisca_core/scripts/assets/__init__.py similarity index 100% rename from openfisca_core/scripts/assets/__init__.py rename to src/openfisca_core/scripts/assets/__init__.py diff --git a/openfisca_core/scripts/assets/index.html b/src/openfisca_core/scripts/assets/index.html similarity index 100% rename from openfisca_core/scripts/assets/index.html rename to src/openfisca_core/scripts/assets/index.html diff --git a/openfisca_core/scripts/find_placeholders.py b/src/openfisca_core/scripts/find_placeholders.py similarity index 100% rename from openfisca_core/scripts/find_placeholders.py rename to src/openfisca_core/scripts/find_placeholders.py diff --git a/openfisca_core/scripts/measure_numpy_condition_notations.py b/src/openfisca_core/scripts/measure_numpy_condition_notations.py similarity index 100% rename from openfisca_core/scripts/measure_numpy_condition_notations.py rename to src/openfisca_core/scripts/measure_numpy_condition_notations.py diff --git a/openfisca_core/scripts/measure_performances.py b/src/openfisca_core/scripts/measure_performances.py similarity index 100% rename from openfisca_core/scripts/measure_performances.py rename to src/openfisca_core/scripts/measure_performances.py diff --git a/openfisca_core/scripts/measure_performances_fancy_indexing.py b/src/openfisca_core/scripts/measure_performances_fancy_indexing.py similarity index 100% rename from openfisca_core/scripts/measure_performances_fancy_indexing.py rename to src/openfisca_core/scripts/measure_performances_fancy_indexing.py diff --git a/openfisca_core/scripts/migrations/__init__.py b/src/openfisca_core/scripts/migrations/__init__.py similarity index 100% rename from openfisca_core/scripts/migrations/__init__.py rename to src/openfisca_core/scripts/migrations/__init__.py diff --git a/openfisca_core/scripts/migrations/v16_2_to_v17/__init__.py b/src/openfisca_core/scripts/migrations/v16_2_to_v17/__init__.py similarity index 100% rename from openfisca_core/scripts/migrations/v16_2_to_v17/__init__.py rename to src/openfisca_core/scripts/migrations/v16_2_to_v17/__init__.py diff --git a/openfisca_core/scripts/migrations/v16_2_to_v17/legislation.xsd b/src/openfisca_core/scripts/migrations/v16_2_to_v17/legislation.xsd similarity index 100% rename from openfisca_core/scripts/migrations/v16_2_to_v17/legislation.xsd rename to src/openfisca_core/scripts/migrations/v16_2_to_v17/legislation.xsd diff --git a/openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_country_template.py b/src/openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_country_template.py similarity index 100% rename from openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_country_template.py rename to src/openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_country_template.py diff --git a/openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_extension_template.py b/src/openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_extension_template.py similarity index 100% rename from openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_extension_template.py rename to src/openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_extension_template.py diff --git a/openfisca_core/scripts/migrations/v24_to_25.py b/src/openfisca_core/scripts/migrations/v24_to_25.py similarity index 100% rename from openfisca_core/scripts/migrations/v24_to_25.py rename to src/openfisca_core/scripts/migrations/v24_to_25.py diff --git a/openfisca_core/scripts/openfisca_command.py b/src/openfisca_core/scripts/openfisca_command.py similarity index 100% rename from openfisca_core/scripts/openfisca_command.py rename to src/openfisca_core/scripts/openfisca_command.py diff --git a/openfisca_core/scripts/remove_fuzzy.py b/src/openfisca_core/scripts/remove_fuzzy.py similarity index 100% rename from openfisca_core/scripts/remove_fuzzy.py rename to src/openfisca_core/scripts/remove_fuzzy.py diff --git a/openfisca_core/scripts/run_test.py b/src/openfisca_core/scripts/run_test.py similarity index 100% rename from openfisca_core/scripts/run_test.py rename to src/openfisca_core/scripts/run_test.py diff --git a/openfisca_core/scripts/simulation_generator.py b/src/openfisca_core/scripts/simulation_generator.py similarity index 100% rename from openfisca_core/scripts/simulation_generator.py rename to src/openfisca_core/scripts/simulation_generator.py diff --git a/openfisca_core/simulation_builder.py b/src/openfisca_core/simulation_builder.py similarity index 100% rename from openfisca_core/simulation_builder.py rename to src/openfisca_core/simulation_builder.py diff --git a/openfisca_core/simulations/__init__.py b/src/openfisca_core/simulations/__init__.py similarity index 100% rename from openfisca_core/simulations/__init__.py rename to src/openfisca_core/simulations/__init__.py diff --git a/openfisca_core/simulations/helpers.py b/src/openfisca_core/simulations/helpers.py similarity index 100% rename from openfisca_core/simulations/helpers.py rename to src/openfisca_core/simulations/helpers.py diff --git a/openfisca_core/simulations/simulation.py b/src/openfisca_core/simulations/simulation.py similarity index 100% rename from openfisca_core/simulations/simulation.py rename to src/openfisca_core/simulations/simulation.py diff --git a/openfisca_core/simulations/simulation_builder.py b/src/openfisca_core/simulations/simulation_builder.py similarity index 100% rename from openfisca_core/simulations/simulation_builder.py rename to src/openfisca_core/simulations/simulation_builder.py diff --git a/openfisca_core/taxbenefitsystems/__init__.py b/src/openfisca_core/taxbenefitsystems/__init__.py similarity index 100% rename from openfisca_core/taxbenefitsystems/__init__.py rename to src/openfisca_core/taxbenefitsystems/__init__.py diff --git a/openfisca_core/taxbenefitsystems/tax_benefit_system.py b/src/openfisca_core/taxbenefitsystems/tax_benefit_system.py similarity index 100% rename from openfisca_core/taxbenefitsystems/tax_benefit_system.py rename to src/openfisca_core/taxbenefitsystems/tax_benefit_system.py diff --git a/openfisca_core/taxscales/__init__.py b/src/openfisca_core/taxscales/__init__.py similarity index 100% rename from openfisca_core/taxscales/__init__.py rename to src/openfisca_core/taxscales/__init__.py diff --git a/openfisca_core/taxscales/abstract_rate_tax_scale.py b/src/openfisca_core/taxscales/abstract_rate_tax_scale.py similarity index 100% rename from openfisca_core/taxscales/abstract_rate_tax_scale.py rename to src/openfisca_core/taxscales/abstract_rate_tax_scale.py diff --git a/openfisca_core/taxscales/abstract_tax_scale.py b/src/openfisca_core/taxscales/abstract_tax_scale.py similarity index 100% rename from openfisca_core/taxscales/abstract_tax_scale.py rename to src/openfisca_core/taxscales/abstract_tax_scale.py diff --git a/openfisca_core/taxscales/amount_tax_scale_like.py b/src/openfisca_core/taxscales/amount_tax_scale_like.py similarity index 100% rename from openfisca_core/taxscales/amount_tax_scale_like.py rename to src/openfisca_core/taxscales/amount_tax_scale_like.py diff --git a/openfisca_core/taxscales/helpers.py b/src/openfisca_core/taxscales/helpers.py similarity index 100% rename from openfisca_core/taxscales/helpers.py rename to src/openfisca_core/taxscales/helpers.py diff --git a/openfisca_core/taxscales/linear_average_rate_tax_scale.py b/src/openfisca_core/taxscales/linear_average_rate_tax_scale.py similarity index 100% rename from openfisca_core/taxscales/linear_average_rate_tax_scale.py rename to src/openfisca_core/taxscales/linear_average_rate_tax_scale.py diff --git a/openfisca_core/taxscales/marginal_amount_tax_scale.py b/src/openfisca_core/taxscales/marginal_amount_tax_scale.py similarity index 100% rename from openfisca_core/taxscales/marginal_amount_tax_scale.py rename to src/openfisca_core/taxscales/marginal_amount_tax_scale.py diff --git a/openfisca_core/taxscales/marginal_rate_tax_scale.py b/src/openfisca_core/taxscales/marginal_rate_tax_scale.py similarity index 100% rename from openfisca_core/taxscales/marginal_rate_tax_scale.py rename to src/openfisca_core/taxscales/marginal_rate_tax_scale.py diff --git a/openfisca_core/taxscales/rate_tax_scale_like.py b/src/openfisca_core/taxscales/rate_tax_scale_like.py similarity index 100% rename from openfisca_core/taxscales/rate_tax_scale_like.py rename to src/openfisca_core/taxscales/rate_tax_scale_like.py diff --git a/openfisca_core/taxscales/single_amount_tax_scale.py b/src/openfisca_core/taxscales/single_amount_tax_scale.py similarity index 100% rename from openfisca_core/taxscales/single_amount_tax_scale.py rename to src/openfisca_core/taxscales/single_amount_tax_scale.py diff --git a/openfisca_core/taxscales/tax_scale_like.py b/src/openfisca_core/taxscales/tax_scale_like.py similarity index 100% rename from openfisca_core/taxscales/tax_scale_like.py rename to src/openfisca_core/taxscales/tax_scale_like.py diff --git a/openfisca_core/tools/__init__.py b/src/openfisca_core/tools/__init__.py similarity index 100% rename from openfisca_core/tools/__init__.py rename to src/openfisca_core/tools/__init__.py diff --git a/openfisca_core/tools/simulation_dumper.py b/src/openfisca_core/tools/simulation_dumper.py similarity index 100% rename from openfisca_core/tools/simulation_dumper.py rename to src/openfisca_core/tools/simulation_dumper.py diff --git a/openfisca_core/tools/test_runner.py b/src/openfisca_core/tools/test_runner.py similarity index 100% rename from openfisca_core/tools/test_runner.py rename to src/openfisca_core/tools/test_runner.py diff --git a/openfisca_core/tracers/__init__.py b/src/openfisca_core/tracers/__init__.py similarity index 100% rename from openfisca_core/tracers/__init__.py rename to src/openfisca_core/tracers/__init__.py diff --git a/openfisca_core/tracers/computation_log.py b/src/openfisca_core/tracers/computation_log.py similarity index 100% rename from openfisca_core/tracers/computation_log.py rename to src/openfisca_core/tracers/computation_log.py diff --git a/openfisca_core/tracers/flat_trace.py b/src/openfisca_core/tracers/flat_trace.py similarity index 100% rename from openfisca_core/tracers/flat_trace.py rename to src/openfisca_core/tracers/flat_trace.py diff --git a/openfisca_core/tracers/full_tracer.py b/src/openfisca_core/tracers/full_tracer.py similarity index 100% rename from openfisca_core/tracers/full_tracer.py rename to src/openfisca_core/tracers/full_tracer.py diff --git a/openfisca_core/tracers/performance_log.py b/src/openfisca_core/tracers/performance_log.py similarity index 100% rename from openfisca_core/tracers/performance_log.py rename to src/openfisca_core/tracers/performance_log.py diff --git a/openfisca_core/tracers/simple_tracer.py b/src/openfisca_core/tracers/simple_tracer.py similarity index 100% rename from openfisca_core/tracers/simple_tracer.py rename to src/openfisca_core/tracers/simple_tracer.py diff --git a/openfisca_core/tracers/trace_node.py b/src/openfisca_core/tracers/trace_node.py similarity index 100% rename from openfisca_core/tracers/trace_node.py rename to src/openfisca_core/tracers/trace_node.py diff --git a/openfisca_core/tracers/tracing_parameter_node_at_instant.py b/src/openfisca_core/tracers/tracing_parameter_node_at_instant.py similarity index 100% rename from openfisca_core/tracers/tracing_parameter_node_at_instant.py rename to src/openfisca_core/tracers/tracing_parameter_node_at_instant.py diff --git a/openfisca_core/variables/__init__.py b/src/openfisca_core/variables/__init__.py similarity index 100% rename from openfisca_core/variables/__init__.py rename to src/openfisca_core/variables/__init__.py diff --git a/openfisca_core/variables/config.py b/src/openfisca_core/variables/config.py similarity index 100% rename from openfisca_core/variables/config.py rename to src/openfisca_core/variables/config.py diff --git a/openfisca_core/variables/helpers.py b/src/openfisca_core/variables/helpers.py similarity index 100% rename from openfisca_core/variables/helpers.py rename to src/openfisca_core/variables/helpers.py diff --git a/openfisca_core/variables/typing.py b/src/openfisca_core/variables/typing.py similarity index 100% rename from openfisca_core/variables/typing.py rename to src/openfisca_core/variables/typing.py diff --git a/openfisca_core/variables/variable.py b/src/openfisca_core/variables/variable.py similarity index 100% rename from openfisca_core/variables/variable.py rename to src/openfisca_core/variables/variable.py diff --git a/openfisca_core/warnings/__init__.py b/src/openfisca_core/warnings/__init__.py similarity index 100% rename from openfisca_core/warnings/__init__.py rename to src/openfisca_core/warnings/__init__.py diff --git a/openfisca_core/warnings/libyaml_warning.py b/src/openfisca_core/warnings/libyaml_warning.py similarity index 100% rename from openfisca_core/warnings/libyaml_warning.py rename to src/openfisca_core/warnings/libyaml_warning.py diff --git a/openfisca_core/warnings/memory_warning.py b/src/openfisca_core/warnings/memory_warning.py similarity index 100% rename from openfisca_core/warnings/memory_warning.py rename to src/openfisca_core/warnings/memory_warning.py diff --git a/openfisca_core/warnings/tempfile_warning.py b/src/openfisca_core/warnings/tempfile_warning.py similarity index 100% rename from openfisca_core/warnings/tempfile_warning.py rename to src/openfisca_core/warnings/tempfile_warning.py diff --git a/openfisca_web_api/__init__.py b/src/openfisca_web_api/__init__.py similarity index 100% rename from openfisca_web_api/__init__.py rename to src/openfisca_web_api/__init__.py diff --git a/openfisca_web_api/app.py b/src/openfisca_web_api/app.py similarity index 100% rename from openfisca_web_api/app.py rename to src/openfisca_web_api/app.py diff --git a/openfisca_web_api/errors.py b/src/openfisca_web_api/errors.py similarity index 100% rename from openfisca_web_api/errors.py rename to src/openfisca_web_api/errors.py diff --git a/openfisca_web_api/handlers.py b/src/openfisca_web_api/handlers.py similarity index 100% rename from openfisca_web_api/handlers.py rename to src/openfisca_web_api/handlers.py diff --git a/openfisca_web_api/loader/__init__.py b/src/openfisca_web_api/loader/__init__.py similarity index 100% rename from openfisca_web_api/loader/__init__.py rename to src/openfisca_web_api/loader/__init__.py diff --git a/openfisca_web_api/loader/entities.py b/src/openfisca_web_api/loader/entities.py similarity index 100% rename from openfisca_web_api/loader/entities.py rename to src/openfisca_web_api/loader/entities.py diff --git a/openfisca_web_api/loader/parameters.py b/src/openfisca_web_api/loader/parameters.py similarity index 100% rename from openfisca_web_api/loader/parameters.py rename to src/openfisca_web_api/loader/parameters.py diff --git a/openfisca_web_api/loader/spec.py b/src/openfisca_web_api/loader/spec.py similarity index 100% rename from openfisca_web_api/loader/spec.py rename to src/openfisca_web_api/loader/spec.py diff --git a/openfisca_web_api/loader/tax_benefit_system.py b/src/openfisca_web_api/loader/tax_benefit_system.py similarity index 100% rename from openfisca_web_api/loader/tax_benefit_system.py rename to src/openfisca_web_api/loader/tax_benefit_system.py diff --git a/openfisca_web_api/loader/variables.py b/src/openfisca_web_api/loader/variables.py similarity index 100% rename from openfisca_web_api/loader/variables.py rename to src/openfisca_web_api/loader/variables.py diff --git a/openfisca_web_api/openAPI.yml b/src/openfisca_web_api/openAPI.yml similarity index 100% rename from openfisca_web_api/openAPI.yml rename to src/openfisca_web_api/openAPI.yml diff --git a/openfisca_web_api/scripts/__init__.py b/src/openfisca_web_api/scripts/__init__.py similarity index 100% rename from openfisca_web_api/scripts/__init__.py rename to src/openfisca_web_api/scripts/__init__.py diff --git a/openfisca_web_api/scripts/serve.py b/src/openfisca_web_api/scripts/serve.py similarity index 100% rename from openfisca_web_api/scripts/serve.py rename to src/openfisca_web_api/scripts/serve.py diff --git a/tasks/dev.mk b/tasks/dev.mk index f3b59d00cb..9bc1bc10b4 100644 --- a/tasks/dev.mk +++ b/tasks/dev.mk @@ -12,6 +12,7 @@ uninstall: ## Delete builds and compiled python files. clean: \ $(shell ls -d * | grep "build\|dist") \ + $(shell find . -name "*.egg-info") $(shell find . -name "*.pyc") @$(call print_help,$@:) @rm -rf $? diff --git a/tasks/lint.mk b/tasks/lint.mk index 8be8dd71ce..890ffeae8d 100644 --- a/tasks/lint.mk +++ b/tasks/lint.mk @@ -9,19 +9,19 @@ check-syntax-errors: . @$(call print_pass,$@:) ## Run linters to check for syntax and style errors. -check-style: $(shell git ls-files "*.py") +check-style: @$(call print_help,$@:) - @flake8 $? + @flake8 $(shell git ls-files "*.py") @$(call print_pass,$@:) ## Run static type checkers for type errors. -check-types: openfisca_core openfisca_web_api +check-types: @$(call print_help,$@:) - @mypy $? + @mypy src @$(call print_pass,$@:) ## Run code formatters to correct style errors. -format-style: $(shell git ls-files "*.py") +format-style: @$(call print_help,$@:) - @autopep8 $? + @autopep8 $(shell find . -name "*.py") @$(call print_pass,$@:) diff --git a/tasks/publish.mk b/tasks/publish.mk index cf56853aea..55c48200a9 100644 --- a/tasks/publish.mk +++ b/tasks/publish.mk @@ -12,7 +12,7 @@ install-publisher: install-deps: @$(call print_help,$@:) @python setup.py egg_info - @pip install $$(grep -v "^\[" *.egg-info/requires.txt) + @pip install $$(grep -v "^\[" src/*.egg-info/requires.txt) @$(call print_pass,$@:) ## Build & install openfisca-core for deployment and publishing. diff --git a/tasks/test_code.mk b/tasks/test_code.mk index 878983049d..13d88df4d6 100644 --- a/tasks/test_code.mk +++ b/tasks/test_code.mk @@ -15,7 +15,7 @@ test-code: test-core ## Run openfisca-core tests. test-core: $(shell git ls-files "tests/*.py") @$(call print_help,$@:) - @PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=openfisca_core ${pytest_args}" \ + @PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=src ${pytest_args}" \ openfisca test $? \ ${openfisca_args} @$(call print_pass,$@:)