Repository: bancaditalia/black-it (language: python)

Issue:
Support Python 3.11
## Proposed changes

This PR adds Python 3.11 in the list of supported Python versions. It also sets up the CI to also run tests over Python 3.11.

To be merged after #45 .

## Fixes

Related to #36 .

## Types of changes

What types of changes does your code introduce?
_Put an `x` in the boxes that apply_

- [X] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Checklist

_Put an `x` in the boxes that apply._

- [ ] I have read the [CONTRIBUTING](../blob/master/CONTRIBUTING.md) doc
- [ ] I am making a pull request against the `main` branch (left side). Also you should start your branch off our `main`.
- [ ] Lint and unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works

## Further comments

n/a
Update `poetry.lock` and `pyproject.toml`, add CI check on `poetry.lock`
This PR simply refreshes the dependencies by running `poetry update`. Then, the dependency sections of `tox.ini` are synchronized with the new content of `poetry.lock`.

Also `pyproject.toml` is synchronized with the new `poetry.lock`, although the update required a couple of cyclic iteration with `poetry lock` until convergence.

The new version of `numpy` had some breaking changes which affected the correct behaviour of the library. The errors have been fixed [3eb5350](https://github.com/bancaditalia/black-it/pull/72/commits/3eb535076a61de53e074c4c5eac52c7bd95794e3).

Moreover, we added a CI step that checks whether `poetry.lock` is up-to-date.


Discussion / hints:
## [Codecov](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) Report
> Merging [#50](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (8614923) into [main](https://codecov.io/gh/bancaditalia/black-it/commit/3fd8000a4732b25d35d16fa353d7c1c3c6ba9ef5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (3fd8000) will **decrease** coverage by `0.56%`.
> The diff coverage is `80.70%`.

:mega: This organization is not using Codecov’s [GitHub App Integration](https://github.com/apps/codecov). We recommend you install it so Codecov can continue to function properly for your repositories. [Learn more](https://about.codecov.io/blog/codecov-is-updating-its-github-integration/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://codecov.io/gh/bancaditalia/black-it/pull/50/graphs/tree.svg?width=650&height=150&src=pr&token=FwbdPgBFTD&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

```diff
@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
- Coverage   96.82%   96.27%   -0.56%     
==========================================
  Files          30       31       +1     
  Lines        1512     1557      +45     
==========================================
+ Hits         1464     1499      +35     
- Misses         48       58      +10     
```


| [Impacted Files](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | |
|---|---|---|
| [black\_it/\_\_init\_\_.py](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxhY2tfaXQvX19pbml0X18ucHk=) | `100.00% <ø> (ø)` | |
| [black\_it/calibrator.py](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxhY2tfaXQvY2FsaWJyYXRvci5weQ==) | `97.48% <0.00%> (ø)` | |
| [black\_it/loss\_functions/\_\_init\_\_.py](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxhY2tfaXQvbG9zc19mdW5jdGlvbnMvX19pbml0X18ucHk=) | `100.00% <ø> (ø)` | |
| [black\_it/loss\_functions/base.py](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxhY2tfaXQvbG9zc19mdW5jdGlvbnMvYmFzZS5weQ==) | `100.00% <ø> (ø)` | |
| [black\_it/loss\_functions/fourier.py](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxhY2tfaXQvbG9zc19mdW5jdGlvbnMvZm91cmllci5weQ==) | `100.00% <ø> (ø)` | |
| [black\_it/loss\_functions/gsl\_div.py](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxhY2tfaXQvbG9zc19mdW5jdGlvbnMvZ3NsX2Rpdi5weQ==) | `100.00% <ø> (ø)` | |
| [black\_it/loss\_functions/likelihood.py](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxhY2tfaXQvbG9zc19mdW5jdGlvbnMvbGlrZWxpaG9vZC5weQ==) | `85.41% <0.00%> (ø)` | |
| [black\_it/loss\_functions/minkowski.py](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxhY2tfaXQvbG9zc19mdW5jdGlvbnMvbWlua293c2tpLnB5) | `100.00% <ø> (ø)` | |
| [black\_it/loss\_functions/msm.py](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxhY2tfaXQvbG9zc19mdW5jdGlvbnMvbXNtLnB5) | `86.88% <ø> (ø)` | |
| [black\_it/plot/\_\_init\_\_.py](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-YmxhY2tfaXQvcGxvdC9fX2luaXRfXy5weQ==) | `100.00% <ø> (ø)` | |
| ... and [21 more](https://codecov.io/gh/bancaditalia/black-it/pull/50?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | |

</details>


Fix patch:
diff --git a/poetry.lock b/poetry.lock
index 96da7899..fc523a98 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -3118,7 +3118,8 @@ files = [
 [package.dependencies]
 numpy = [
     {version = ">=1.20.3", markers = "python_version < \"3.10\""},
-    {version = ">=1.21.0", markers = "python_version >= \"3.10\""},
+    {version = ">=1.23.2", markers = "python_version >= \"3.11\""},
+    {version = ">=1.21.0", markers = "python_version >= \"3.10\" and python_version < \"3.11\""},
 ]
 python-dateutil = ">=2.8.1"
 pytz = ">=2020.1"
@@ -5420,5 +5421,5 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p
 
 [metadata]
 lock-version = "2.0"
-python-versions = ">=3.8,<3.11"
-content-hash = "5a874a692c0547b1c3a7ba4c8b7cad3c4e988dae41ad1c2fe079b3c182ca5e4f"
+python-versions = ">=3.8,<3.12"
+content-hash = "03a70d745320e4faba66b91c9361482722db48051d5170e9fd8e6ff2ddf1589e"
diff --git a/pyproject.toml b/pyproject.toml
index c827f4e9..b1ba9220 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -30,6 +30,7 @@ classifiers = [
     'Programming Language :: Python :: 3.8',
     'Programming Language :: Python :: 3.9',
     'Programming Language :: Python :: 3.10',
+    'Programming Language :: Python :: 3.11',
     'Topic :: Scientific/Engineering'
 ]
 
@@ -38,7 +39,7 @@ classifiers = [
 "Pull Requests" = "https://github.com/bancaditalia/black-it/pulls"
 
 [tool.poetry.dependencies]
-python = ">=3.8,<3.11"
+python = ">=3.8,<3.12"
 ipywidgets = ">=8.0.0,<8.0.5"
 matplotlib = "^3.7.3"
 numpy = ">=1.24.4,<1.25.0"
diff --git a/tox.ini b/tox.ini
index a841ce85..7af7965f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
 [tox]
 isolated_build = True
-envlist = bandit, safety, check-copyright, black-check, vulture, mypy, py3{8,9,10}, docs
+envlist = bandit, safety, check-copyright, black-check, vulture, mypy, py3{8,9,10,11}, docs
 
 [tox:.package]
 # note tox will use the same python version as under what tox is installed to package


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 6092daf3..988fdd43 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,7 +14,7 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-latest, macos-latest, windows-latest]
-        python-version: [3.8, 3.9, "3.10"]
+        python-version: [3.8, 3.9, "3.10", "3.11"]
 
     timeout-minutes: 30