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

build: add pyproject.toml, poetry, and tox #1015

Closed
wants to merge 39 commits into from
Closed
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
927263a
Extract general requirements to file
May 1, 2021
027256a
Extract api requirements to file
May 1, 2021
0076c6f
Extract ci requirements to file
May 1, 2021
98fe43a
Extract dev requirements to file
May 1, 2021
cc2dccd
Pin dev requirements
May 1, 2021
9fbb223
Pin api requirements
May 1, 2021
65207fe
Relax sortedcontainers
May 1, 2021
024400c
Relax psutil
May 1, 2021
83a53be
Relax dpath
May 1, 2021
e167093
Drop support for numexpr < 2.7.1
May 1, 2021
caf1c85
Drop support for pytest < 5.4.2
May 1, 2021
b31aec2
Drop support for PyYAML < 5.1
May 1, 2021
7edbe62
Drop support for NumPy < 1.17
May 1, 2021
a38458b
Add integrity test for NumPy
May 1, 2021
62c0585
Improve phrasing in README.md
Sep 7, 2021
7b90b14
Remove debug requirements
Sep 7, 2021
8b1b84b
Do not pin deps/tracker
Sep 7, 2021
73eaac8
Clarify requirements/install
Sep 7, 2021
a2103a6
Delete duplicated numpy rule
Sep 7, 2021
d865888
Add link to issue in dpath
Sep 7, 2021
9bec4de
Improve message in tracker deps
Sep 7, 2021
65855e8
Improve wording in web-api deps
Sep 7, 2021
4fbf18a
Remove legacy resolver
Sep 8, 2021
d0bd511
Update README.md
Sep 8, 2021
0818f57
Apply suggestions from code review
Oct 25, 2021
e346c09
Rename constraints => compatibility
Oct 26, 2021
e5b803e
Update dependencies
Oct 26, 2021
c0a654e
Use make as task-manager
Oct 26, 2021
5801347
Update README.md
Oct 26, 2021
65c4621
Expire deprecations
Oct 26, 2021
6872ae7
Fix failing tests after expire
Oct 26, 2021
64007a2
Remove outdated instruction from circle
Oct 26, 2021
6d2c415
Update to major version 36.0.0
May 1, 2021
6f73e98
Fix circleci config
Oct 26, 2021
23f4aff
Remove deprecation leftovers
Oct 26, 2021
2b322a3
Update tracker installation instructions
Oct 26, 2021
2452241
Update to major version 36.0.0
May 1, 2021
d088e40
chore: backport changes
bonjourmauko Oct 25, 2024
bae180d
chore: merge branch 'master' into improve-deps
bonjourmauko Oct 25, 2024
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
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

# 44.0.0 [#1015](https://github.com/openfisca/openfisca-core/pull/1015)

#### Technical changes

- Add `pyproject.toml` to the repository.
- Add `poetry` to manage dependencies.
- Add `tox` to manage isolated tests.

#### Deprecations

- `openfisca_core.commons.Dummy` => `openfisca_core.commons.empty_clone`
- `openfisca_core.errors.ParameterNotFound` => `openfisca_core.errors.ParameterNotFoundError`
- `openfisca_core.errors.VariableNameConflict` => `openfisca_core.errors.VariableNameConflictError`
- `openfisca_core.errors.VariableNotFound` => `openfisca_core.errors.VariableNotFoundError`
- `openfisca_core.formula_helpers.py` => `openfisca_core.commons`
- `openfisca_core.memory_config.py` => `openfisca_core.experimental`
- `openfisca_core.parameters.Bracket` => `openfisca_core.errors.ParameterScaleBracket`
- `openfisca_core.parameters.ParameterNotFound` => `openfisca_core.errors.ParameterNotFoundError`
- `openfisca_core.parameters.ParameterParsingError` => `openfisca_core.errors.ParameterParsingError`
- `openfisca_core.parameters.Scale` => `openfisca_core.errors.ParameterScale`
- `openfisca_core.rates` => `openfisca_core.commons`
- `openfisca_core.simulation_builder` => `openfisca_core.simulations`
- `openfisca_core.simulations.CycleError` => `openfisca_core.errors.CycleError`
- `openfisca_core.simulations.NaNCreationError` => `openfisca_core.errors.NaNCreationError`
- `openfisca_core.simulations.SpiralError` => `openfisca_core.errors.SpiralError`
- `openfisca_core.taxbenefitsystems.VariableNameConflict` => `openfisca_core.errors.VariableNameConflictError`
- `openfisca_core.taxbenefitsystems.VariableNotFound` => `openfisca_core.errors.VariableNotFoundError`
- `openfisca_core.taxscales.EmptyArgumentError` => `openfisca_core.errors.EmptyArgumentError`

### 43.2.2 [#1280](https://github.com/openfisca/openfisca-core/pull/1280)

#### Documentation
Expand Down
2 changes: 0 additions & 2 deletions openfisca_core/commons/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
"""Common tools for contributors and users."""

from . import types
from .dummy import Dummy
from .formulas import apply_thresholds, concat, switch
from .misc import empty_clone, eval_expression, stringify_array
from .rates import average_rate, marginal_rate

__all__ = [
"Dummy",
"apply_thresholds",
"average_rate",
"concat",
Expand Down
25 changes: 0 additions & 25 deletions openfisca_core/commons/dummy.py

This file was deleted.

9 changes: 0 additions & 9 deletions openfisca_core/commons/tests/test_dummy.py

This file was deleted.

18 changes: 3 additions & 15 deletions openfisca_core/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,23 @@
from .cycle_error import CycleError
from .empty_argument_error import EmptyArgumentError
from .nan_creation_error import NaNCreationError
from .parameter_not_found_error import (
ParameterNotFoundError,
ParameterNotFoundError as ParameterNotFound,
)
from .parameter_not_found_error import ParameterNotFoundError
from .parameter_parsing_error import ParameterParsingError
from .period_mismatch_error import PeriodMismatchError
from .situation_parsing_error import SituationParsingError
from .spiral_error import SpiralError
from .variable_name_config_error import (
VariableNameConflictError,
VariableNameConflictError as VariableNameConflict,
)
from .variable_not_found_error import (
VariableNotFoundError,
VariableNotFoundError as VariableNotFound,
)
from .variable_name_config_error import VariableNameConflictError
from .variable_not_found_error import VariableNotFoundError

__all__ = [
"CycleError",
"EmptyArgumentError",
"NaNCreationError",
"ParameterNotFound", # Deprecated alias for "ParameterNotFoundError
"ParameterNotFoundError",
"ParameterParsingError",
"PeriodMismatchError",
"SituationParsingError",
"SpiralError",
"VariableNameConflict", # Deprecated alias for "VariableNameConflictError"
"VariableNameConflictError",
"VariableNotFound", # Deprecated alias for "VariableNotFoundError"
"VariableNotFoundError",
]
9 changes: 0 additions & 9 deletions openfisca_core/formula_helpers.py

This file was deleted.

9 changes: 0 additions & 9 deletions openfisca_core/memory_config.py

This file was deleted.

9 changes: 0 additions & 9 deletions openfisca_core/rates.py

This file was deleted.

16 changes: 0 additions & 16 deletions openfisca_core/simulation_builder.py

This file was deleted.

8 changes: 8 additions & 0 deletions requirements/common
bonjourmauko marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These are dependencies to build the library, so we always want the latest
# versions.

# For managing dependencies.
pip

# For packaging the package.
setuptools
6 changes: 6 additions & 0 deletions requirements/compatibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are constraint versions to ensure the compatibility of distributions.
#
# Normally, we want to add here the pinned lower-bound supported versions of
# dependencies critical to OpenFisca's usability.

numpy == 1.17
5 changes: 5 additions & 0 deletions requirements/coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These are dependencies to upload test coverage statistics, so we always want
# the latest versions.

# For sending test statistics to the Coveralls third-party service.
coveralls
38 changes: 38 additions & 0 deletions requirements/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Please make sure to pin all dependency versions, in order to avoid unwanted
# functional and integration breaks caused by external code updates.
#
# General Rule
# ============
#
# * Pin them.
#
# Exceptions
# ==========
#
# * openfisca-country-template should not be constrained (circular dep).
# * openfisca-extension-template should not be constrained (circular dep).
bonjourmauko marked this conversation as resolved.
Show resolved Hide resolved

# For automatic style formatting.
autopep8 == 1.6.0

# For style & code checking.
darglint == 1.8.0
flake8 == 4.0.1
flake8-bugbear == 21.9.2
flake8-docstrings == 1.6.0
flake8-print == 4.0.0
flake8-rst-docstrings == 0.2.3
pylint == 2.11.1

# For PyTest test coverage integration.
pytest-cov == 3.0.0

# For optional duck & static type checking.
mypy == 0.910

# For testing: parameters, variables, etc.
openfisca-country-template
openfisca-extension-template

# Include Web API dependencies for development
-r web-api
69 changes: 69 additions & 0 deletions requirements/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Please make sure to cap all dependency versions, in order to avoid unwanted
# functional and integration breaks caused by external code updates.
#
# These dependencies are always installed, so:
#
# * the ranges should be broad, and
# * the number of them kept low.
#
# If a dependency seems redundant, please propose a pull request to remove it.
#
# General Rule
# ============
#
# * Cap to latest major.
#
# Exceptions
# ==========
#
# * Avoiding a version (document why).
# * Pinning a version (document why).

# For globbing over dictionaries as if they were filesystems.
#
# We support from 1.3.2 on because it is the first version published
# following the semantic versioning specification.
#
# We do not support 2 yet because of a bug introduced to period parsing in
# OpenFisca's Web API: https://github.com/openfisca/openfisca-core/pull/948
dpath >= 1.3.2, < 2

# For Numpy type-hints.
nptyping >= 1, < 2

# For evaluating numerical expressions
#
# We support numexpr >= 2.7.1 because it is the first version compatible with
# Python 3.7.
numexpr >= 2.7.1, < 3

# For vectorial support
#
# We support the latest four minors because NumPy is generally a transitive
# dependency that users rely on within the projects where OpenFisca is
# depended on by.
numpy >= 1.17, < 1.21

# Memory monitoring for caching.
#
# We support psutil >= 5.4.7 because it is the first version compatible with
# Python 3.7.
psutil >= 5.4.7, < 6

# For openfisca test
#
# We support pytest >= 5.4.2 because `openfisca test` relies on the signature of
# `pytest.Item.from_module()` introduced since 5.4.2.
#
# We do not support 6 yet because it requires fixing some tests before.
# See: https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent
pytest >= 5.4.2, < 6

# For parameters and tests parsing.
PyYAML >= 5.1, < 6

# For sorting formulas by period.
sortedcontainers >= 2, < 3

# For typing backports.
typing-extensions >= 3, < 4
8 changes: 8 additions & 0 deletions requirements/publication
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These are dependencies to publish the library, so we always want the latest
# versions.

# For publishing on PyPI.
twine

# For building the package.
build
7 changes: 7 additions & 0 deletions requirements/tracker
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Dependencies for tracking are optional, so we always want the latest
# versions.

# For sending usage statistics to the Matomo third-party service.
#
# We start from the currently supported version forward.
openfisca-tracker >= 0.4.0
14 changes: 14 additions & 0 deletions requirements/web-api
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are dependencies to serve the Web-API, so we always want to support
# the latest versions.

# For OpenFisca's Web API.
#
# We start from the currently supported versions forward.
flask >= 1.1.2
gunicorn >= 20.1.0

# For OpenFisca's Web API users requiring CORS.
#
# We start from the currently supported versions forward.
flask-cors >= 3.0.10
werkzeug >= 1.0.1
Loading