Repository: IAMconsortium/units (language: python)

Issue:
Add function to explicitly configure currency conversion
See the changes to the README: https://github.com/IAMconsortium/units/tree/enh/currency#currency

This partly addresses #25. To fully close out that issue, we probably would like to increase (to what, specifically?) the set of available currencies, methods (probably at least "PPPGDP"), and conversion years, but that is left for follow-up PRs.

The current PR:
- Makes explicit what is currently supported,
- Establishes a simple interface for doing explicit configuration,
- Introduces a warning for future changes; see e.g. [here](https://github.com/IAMconsortium/units/actions/runs/5643617333/job/15285812482?pr=44#step:5:147).

Also some housekeeping:
- Update copyright year.
- Convert packaging from setup.{cfg,py} to pyproject.toml.
- Update 3 Github Actions workflows to latest versions/reusable workflows.


Discussion / hints:
## [Codecov](https://app.codecov.io/gh/IAMconsortium/units/pull/44?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=IAMconsortium) Report
> Merging [#44](https://app.codecov.io/gh/IAMconsortium/units/pull/44?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=IAMconsortium) (edce71c) into [main](https://app.codecov.io/gh/IAMconsortium/units/commit/f78a280361695900b556b7ce963d3df221bb7c4c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=IAMconsortium) (f78a280) will **increase** coverage by `2.63%`.
> The diff coverage is `92.00%`.

```diff
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
+ Coverage   73.10%   75.73%   +2.63%     
==========================================
  Files           4        5       +1     
  Lines         145      169      +24     
==========================================
+ Hits          106      128      +22     
- Misses         39       41       +2     
```


| [Impacted Files](https://app.codecov.io/gh/IAMconsortium/units/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=IAMconsortium) | Coverage Δ | |
|---|---|---|
| [iam\_units/update.py](https://app.codecov.io/gh/IAMconsortium/units/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=IAMconsortium#diff-aWFtX3VuaXRzL3VwZGF0ZS5weQ==) | `0.00% <0.00%> (ø)` | |
| [iam\_units/\_\_init\_\_.py](https://app.codecov.io/gh/IAMconsortium/units/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=IAMconsortium#diff-aWFtX3VuaXRzL19faW5pdF9fLnB5) | `88.88% <100.00%> (+1.08%)` | :arrow_up: |
| [iam\_units/currency.py](https://app.codecov.io/gh/IAMconsortium/units/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=IAMconsortium#diff-aWFtX3VuaXRzL2N1cnJlbmN5LnB5) | `100.00% <100.00%> (ø)` | |
| [iam\_units/test\_all.py](https://app.codecov.io/gh/IAMconsortium/units/pull/44?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=IAMconsortium#diff-aWFtX3VuaXRzL3Rlc3RfYWxsLnB5) | `100.00% <100.00%> (ø)` | |



Fix patch:
diff --git a/iam_units/currency.py b/iam_units/currency.py
index 2f83952..b3e3cb3 100644
--- a/iam_units/currency.py
+++ b/iam_units/currency.py
@@ -3,7 +3,13 @@
 See the inline comments (NB) for possible extensions of this code; also
 iam_units.update.currency.
 """
-from typing import Literal, Union
+from typing import Union
+
+try:
+    from typing import Literal
+except ImportError:
+    from typing_extensions import Literal  # type: ignore [assignment]
+
 
 #: Exchange rate data for method=EXC, period=2005, from
 #: https://data.oecd.org/conversion/exchange-rates.htm
diff --git a/pyproject.toml b/pyproject.toml
index 62445e6..d7704af 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -25,7 +25,7 @@ classifiers = [
   "Topic :: Scientific/Engineering",
   "Topic :: Scientific/Engineering :: Information Analysis",
 ]
-dependencies = ["pint >= 0.11"]
+dependencies = ["pint >= 0.11", "typing_extensions; python_version < '3.8'"]
 
 [project.urls]
 homepage = "https://github.com/IAMconsortium/units"


Test patch:
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 90bd5cf..cf7c626 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -29,6 +29,7 @@ jobs:
 
     - uses: actions/setup-python@v4
       with:
+        python-version: "3.x"
         cache: pip
         cache-dependency-path: "**/pyproject.toml"