commodutil 4.7.0__tar.gz → 5.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. commodutil-5.5.0/.github/workflows/1_tests.yml +40 -0
  2. commodutil-5.5.0/.github/workflows/2_coverage.yml +51 -0
  3. commodutil-5.5.0/.github/workflows/3_linting.yml +49 -0
  4. commodutil-5.5.0/.github/workflows/4_release.yml +58 -0
  5. commodutil-5.5.0/CHANGELOG.md +55 -0
  6. {commodutil-4.7.0 → commodutil-5.5.0}/PKG-INFO +3 -2
  7. commodutil-5.5.0/README.md +21 -0
  8. {commodutil-4.7.0 → commodutil-5.5.0}/azure-build-pipelines.yml +9 -1
  9. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/__init__.py +3 -2
  10. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/convfactors.py +31 -449
  11. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/dates.py +1 -1
  12. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/forward/calendar.py +1 -1
  13. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/forward/continuous.py +5 -3
  14. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/forward/quarterly.py +1 -1
  15. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/forward/spreads.py +1 -2
  16. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/forward/util.py +1 -1
  17. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/forwards.py +3 -3
  18. commodutil-5.5.0/commodutil/priceconv.py +410 -0
  19. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/standards/__init__.py +44 -16
  20. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/standards/commodities.py +115 -0
  21. commodutil-5.5.0/commodutil/standards/geography.py +352 -0
  22. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/standards/price_unit.py +110 -4
  23. commodutil-4.7.0/commodutil/standards/regions.py → commodutil-5.5.0/commodutil/standards/trading_hubs.py +28 -36
  24. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/standards/unit_registry.py +31 -1
  25. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/standards/units.py +46 -25
  26. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/stats.py +3 -1
  27. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil.egg-info/PKG-INFO +3 -2
  28. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil.egg-info/SOURCES.txt +11 -9
  29. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil.egg-info/requires.txt +1 -0
  30. {commodutil-4.7.0 → commodutil-5.5.0}/pyproject.toml +27 -1
  31. {commodutil-4.7.0 → commodutil-5.5.0}/tests/conftest.py +1 -1
  32. {commodutil-4.7.0 → commodutil-5.5.0}/tests/forward/conftest.py +2 -2
  33. {commodutil-4.7.0 → commodutil-5.5.0}/tests/forward/test_calendar.py +6 -4
  34. {commodutil-4.7.0 → commodutil-5.5.0}/tests/forward/test_quarterly.py +5 -3
  35. {commodutil-4.7.0 → commodutil-5.5.0}/tests/forward/test_spreads.py +5 -2
  36. commodutil-5.5.0/tests/test_aliases.py +93 -0
  37. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_arb.py +1 -1
  38. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_pandasutils.py +3 -3
  39. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_price_unit.py +129 -3
  40. commodutil-5.5.0/tests/test_priceconv_reexports.py +16 -0
  41. commodutil-5.5.0/tests/test_regex_literals.py +21 -0
  42. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_standards_commodities.py +146 -0
  43. commodutil-5.5.0/tests/test_standards_geography.py +172 -0
  44. commodutil-5.5.0/tests/test_standards_trading_hubs.py +267 -0
  45. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_standards_units.py +96 -26
  46. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_stats.py +7 -3
  47. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_transforms.py +4 -5
  48. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_unit_registry.py +78 -2
  49. commodutil-5.5.0/uv.lock +1682 -0
  50. commodutil-4.7.0/.github/workflows/1_tests.yml +0 -40
  51. commodutil-4.7.0/.github/workflows/2_coverage.yml +0 -52
  52. commodutil-4.7.0/.github/workflows/3_linting.yml +0 -47
  53. commodutil-4.7.0/.github/workflows/4_release.yml +0 -64
  54. commodutil-4.7.0/commodutil/standards/price_units.py +0 -99
  55. commodutil-4.7.0/commodutil.egg-info/scm_file_list.json +0 -76
  56. commodutil-4.7.0/commodutil.egg-info/scm_version.json +0 -8
  57. commodutil-4.7.0/requirements-test.txt +0 -10
  58. commodutil-4.7.0/requirements.txt +0 -3
  59. commodutil-4.7.0/requirements_dev.txt +0 -8
  60. commodutil-4.7.0/tests/test_standards_price_units.py +0 -122
  61. commodutil-4.7.0/tests/test_standards_regions.py +0 -355
  62. {commodutil-4.7.0 → commodutil-5.5.0}/.coveragerc +0 -0
  63. {commodutil-4.7.0 → commodutil-5.5.0}/.gitignore +0 -0
  64. {commodutil-4.7.0 → commodutil-5.5.0}/.pypirc +0 -0
  65. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/arb.py +0 -0
  66. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/forward/__init__.py +0 -0
  67. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/forward/fly.py +0 -0
  68. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/forward/structure.py +0 -0
  69. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/pandasutil.py +0 -0
  70. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/standards/analysis_types.py +0 -0
  71. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/standards/commodity_groups.py +0 -0
  72. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/standards/currency.py +0 -0
  73. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil/transforms.py +0 -0
  74. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil.egg-info/dependency_links.txt +0 -0
  75. {commodutil-4.7.0 → commodutil-5.5.0}/commodutil.egg-info/top_level.txt +0 -0
  76. {commodutil-4.7.0 → commodutil-5.5.0}/setup.cfg +0 -0
  77. {commodutil-4.7.0 → commodutil-5.5.0}/tests/__init__.py +0 -0
  78. {commodutil-4.7.0 → commodutil-5.5.0}/tests/forward/__init__.py +0 -0
  79. {commodutil-4.7.0 → commodutil-5.5.0}/tests/forward/test_continuous.py +0 -0
  80. {commodutil-4.7.0 → commodutil-5.5.0}/tests/forward/test_fly.py +0 -0
  81. {commodutil-4.7.0 → commodutil-5.5.0}/tests/forward/test_structure.py +0 -0
  82. {commodutil-4.7.0 → commodutil-5.5.0}/tests/forward/test_util.py +0 -0
  83. {commodutil-4.7.0 → commodutil-5.5.0}/tests/golden/golden_factors.json +0 -0
  84. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_align_fx_result.py +0 -0
  85. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_cl.csv +0 -0
  86. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_conv.py +0 -0
  87. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_dates.py +0 -0
  88. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_forwards.py +0 -0
  89. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_golden_factors.py +0 -0
  90. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_price_conv.py +0 -0
  91. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_rate_pint.py +0 -0
  92. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_standards_analysis_types.py +0 -0
  93. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_standards_commodity_groups.py +0 -0
  94. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_standards_currency.py +0 -0
  95. {commodutil-4.7.0 → commodutil-5.5.0}/tests/test_weekly.csv +0 -0
@@ -0,0 +1,40 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu-latest, windows-latest]
17
+ python-version: ['3.11', '3.12']
18
+ timeout-minutes: 15
19
+
20
+ steps:
21
+ - name: Check out code repository
22
+ uses: actions/checkout@v7.0.0
23
+
24
+ - name: Set up uv and Python ${{ matrix.python-version }}
25
+ uses: astral-sh/setup-uv@v8.3.2
26
+ with:
27
+ version: '0.11.28'
28
+ python-version: ${{ matrix.python-version }}
29
+ enable-cache: true
30
+ cache-dependency-glob: pyproject.toml
31
+
32
+ # Oil_Feed is private and GitHub has no OIL_FEED_PAT secret yet. Resolve
33
+ # from public PyPI without changing the committed Azure lock.
34
+ - name: Resolve project test dependencies from public PyPI
35
+ run: |
36
+ python -c "from pathlib import Path; Path('uv.lock').unlink()"
37
+ uv --no-config sync --default-index https://pypi.org/simple --no-default-groups --group test
38
+
39
+ - name: Run unit tests
40
+ run: uv run --no-sync pytest
@@ -0,0 +1,51 @@
1
+ name: Code coverage
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ run:
12
+ runs-on: ubuntu-latest
13
+ env:
14
+ OS: ubuntu-latest
15
+ PYTHON: '3.12'
16
+ timeout-minutes: 15
17
+
18
+ steps:
19
+ - name: Check out code repository
20
+ uses: actions/checkout@v7.0.0
21
+
22
+ - name: Set up uv and Python 3.12
23
+ uses: astral-sh/setup-uv@v8.3.2
24
+ with:
25
+ version: '0.11.28'
26
+ python-version: '3.12'
27
+ enable-cache: true
28
+ cache-dependency-glob: pyproject.toml
29
+
30
+ # Oil_Feed is private and GitHub has no OIL_FEED_PAT secret yet. Resolve
31
+ # from public PyPI without changing the committed Azure lock.
32
+ - name: Resolve project test dependencies from public PyPI
33
+ run: |
34
+ python -c "from pathlib import Path; Path('uv.lock').unlink()"
35
+ uv --no-config sync --default-index https://pypi.org/simple --no-default-groups --group test
36
+
37
+ - name: Generate coverage report
38
+ run: |
39
+ uv run --no-sync coverage run -m pytest
40
+ uv run --no-sync coverage xml
41
+
42
+ - name: Upload coverage to Codecov
43
+ uses: codecov/codecov-action@v7.0.0
44
+ with:
45
+ token: ${{ secrets.CODECOV_TOKEN }}
46
+ env_vars: OS,PYTHON
47
+ fail_ci_if_error: true
48
+ files: coverage.xml
49
+ flags: unittests
50
+ name: codecov-umbrella
51
+ verbose: true
@@ -0,0 +1,49 @@
1
+ name: Lint and format code
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ lint:
12
+ runs-on: ubuntu-latest
13
+ env:
14
+ OS: ubuntu-latest
15
+ PYTHON: '3.12'
16
+ timeout-minutes: 15
17
+
18
+ steps:
19
+ - name: Check out code repository
20
+ uses: actions/checkout@v7.0.0
21
+
22
+ - name: Set up uv and Python 3.12
23
+ uses: astral-sh/setup-uv@v8.3.2
24
+ with:
25
+ version: '0.11.28'
26
+ python-version: '3.12'
27
+ enable-cache: true
28
+ cache-dependency-glob: pyproject.toml
29
+
30
+ # Oil_Feed is private and GitHub has no OIL_FEED_PAT secret yet. Resolve
31
+ # from public PyPI without changing the committed Azure lock.
32
+ - name: Resolve project development dependencies from public PyPI
33
+ run: |
34
+ python -c "from pathlib import Path; Path('uv.lock').unlink()"
35
+ uv --no-config sync --default-index https://pypi.org/simple --no-default-groups --group dev
36
+
37
+ - name: Lint with pylint
38
+ continue-on-error: true
39
+ run: uv run --no-sync pylint commodutil
40
+
41
+ - name: Run Black check
42
+ continue-on-error: true
43
+ run: uv run --no-sync black --check .
44
+
45
+ - name: Check type hints with mypy
46
+ continue-on-error: true
47
+ run: |
48
+ uv run --no-sync mypy commodutil
49
+ uv run --no-sync mypy tests
@@ -0,0 +1,58 @@
1
+ name: Upload release to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '*'
7
+ release:
8
+ types: [ created ]
9
+
10
+ jobs:
11
+ deploy:
12
+ runs-on: ubuntu-latest
13
+ env:
14
+ OS: ubuntu-latest
15
+ PYTHON: '3.12'
16
+ timeout-minutes: 15
17
+
18
+ steps:
19
+ - name: Check out code repository
20
+ uses: actions/checkout@v7.0.0
21
+ with:
22
+ fetch-depth: 0
23
+
24
+ - name: Set up uv and Python 3.12
25
+ uses: astral-sh/setup-uv@v8.3.2
26
+ with:
27
+ version: '0.11.28'
28
+ python-version: '3.12'
29
+ enable-cache: true
30
+ cache-dependency-glob: pyproject.toml
31
+
32
+ - name: Get version from tag
33
+ run: |
34
+ VERSION="${GITHUB_REF_NAME#v}"
35
+ echo "SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION" >> "$GITHUB_ENV"
36
+ echo "Building version: $VERSION"
37
+
38
+ # Oil_Feed is private and GitHub has no OIL_FEED_PAT secret yet. Resolve
39
+ # from public PyPI without changing the committed Azure lock.
40
+ - name: Resolve release tooling from public PyPI
41
+ run: |
42
+ python -c "from pathlib import Path; Path('uv.lock').unlink()"
43
+ uv --no-config sync --default-index https://pypi.org/simple --no-default-groups --group release
44
+
45
+ - name: Build source and wheel distributions
46
+ run: uv --no-config build --no-sources
47
+
48
+ - name: Publish to TestPyPI
49
+ env:
50
+ TWINE_USERNAME: __token__
51
+ TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }}
52
+ run: uv run --no-sync twine upload --repository-url https://test.pypi.org/legacy/ dist/*
53
+
54
+ - name: Publish to PyPI
55
+ env:
56
+ TWINE_USERNAME: __token__
57
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
58
+ run: uv run --no-sync twine upload dist/*
@@ -0,0 +1,55 @@
1
+ # Changelog
2
+
3
+ ## 5.5.0 - 2026-07-27
4
+
5
+ - Added `commodutil.standards.geography` with pycountry-backed countries, desk aliases, and membership-defined country groups; added `pycountry` as a production dependency.
6
+ - Breaking: `standards.regions` renamed to `standards.trading_hubs`; region-named symbols renamed (`REGION_PATTERNS` -> `TRADING_HUB_PATTERNS`, `VALID_REGIONS` -> `VALID_TRADING_HUBS`, `normalize_region` -> `normalize_trading_hub`, `is_valid_region` -> `is_valid_trading_hub`); no compatibility shim. Migrate imports to `commodutil.standards.trading_hubs`. `CRUDE_GRADE_REGIONS` family unchanged (relocated).
7
+
8
+ ## 5.4.1 - 2026-07-16
9
+
10
+ - Added pandas 3 compatibility and removed project-owned deprecation and invalid-escape warnings.
11
+ - Migrated Azure Pipelines and GitHub Actions to reproducible, locked uv project-mode installs.
12
+
13
+ ## 5.4.0 - 2026-07-12
14
+
15
+ - Added `normalize_price_unit_strict` and `is_canonical_price_unit` to `commodutil.standards.units` (and the `commodutil` / `commodutil.standards` facades): the STRICT counterpart to the lenient `canonical_price_unit_token`. Where the lenient token preserves unrecognised currency/unit fragments so it can label any quote string, the strict variant returns a canonical `CCY/unit` token only when both legs resolve (recognised currency over a `canonical_quantity_unit` denominator) and `None` otherwise — for validating a curated price-unit qualifier that must round-trip through conversion (e.g. `usd_ton`/`USD/ton` refused, `USD/MT` -> `USD/mt`).
16
+
17
+ ## 5.0.1 - 2026-07-03
18
+
19
+ - Breaking: removed `default_unit_for_commodity` and `_DEFAULT_UNIT` from `commodutil.standards.units`; these fabricated per-commodity quote units, and the gold instrument registry answers this per-instrument.
20
+ - Breaking: removed the `commodutil.standards.price_units` module. Price-unit resolution (`resolve_price_unit`, `resolve_price_unit_from_attrs`) moved into `commodutil.standards.price_unit` alongside the `PriceUnit` value type. Migrate imports to `commodutil.standards.price_unit`.
21
+ - First release of the 5.x line; the 5.0.0 version number is unusable on the feed.
22
+
23
+ ## 4.10.0 - 2026-07-03
24
+
25
+ - Added exchange unit spellings for `MTONS`, `CBM`, `THM`, and `KL` to the unit registry, with `KL`/kilolitre spellings resolving to the canonical `m^3` unit.
26
+ - Moved commodity alias ownership to `commodutil.standards.commodities.COMMODITY_ALIASES`; `CommodityConverter` now consumes a defensive copy from that source.
27
+ - Breaking: removed the `commodutil.convfactors.ALIASES` re-export. Migrate callers to `from commodutil.standards.commodities import COMMODITY_ALIASES`.
28
+
29
+ ## 4.8.0 - 2026-07-03
30
+
31
+ - Split price, currency, and FX conversion helpers into `commodutil.priceconv`, while keeping lazy compatibility exports from `commodutil.convfactors` for the price-conversion API.
32
+ - Consolidated petrochemical taxonomy keywords into `commodutil.standards.commodities`.
33
+ - Added `infer_ngl_species` for discrete NGL species inference from free text.
34
+
35
+ ## 4.7.0 - 2026-07-03
36
+
37
+ - Fixed ethanol density to `0.7937 kg/L`, preserving the EIA gross per-volume energy content while correcting mass-based conversion factors.
38
+ - Promoted `kg` and bare cubic-metre spellings (`m3`, `m^3`, `m**3`) into the `UNIT_MAP` tier so vendor-spec parsers can resolve them directly.
39
+
40
+ ## 4.6.0 - 2026-07-02
41
+
42
+ - Replaced hand-rolled scalar rate-period conversion with `PriceUnit` parsing and Pint-derived period ratios, while preserving calendar-aware month/day handling for series.
43
+ - Added `align_fx`, `ConversionResult`, and `convert_price_result` for explicit price-conversion results, currency-leg fallback, and keep-raw error handling.
44
+
45
+ ## 4.5.0 - 2026-07-02
46
+
47
+ - Added the `PriceUnit` value type for structured price-unit parsing across currency, quantity-unit, and rate-period legs.
48
+ - Added `commodutil.standards.unit_registry` as the single source of truth for unit vocabulary, public unit maps, and Pint definitions.
49
+ - Added ICE unit spellings for `MMBtu`, `GJ`, `MWh`, `m^3`, `MW`, `RIN`, `FEU`, and `day`, covering the registry gap identified in ICE contract metadata.
50
+
51
+ ## 4.4.0 - 2026-07-02
52
+
53
+ - Standardized covered liquid and biofuel energy-content factors on the EIA gross/HHV basis, documenting explicit exceptions and basis assumptions.
54
+ - Added API2/coal support with mass-basis energy content for density-less solid-fuel conversions and Coal taxonomy inference.
55
+ - Added the golden-factor regression fixture and validation tests for quantity, rate, and price conversions.
@@ -1,17 +1,18 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commodutil
3
- Version: 4.7.0
3
+ Version: 5.5.0
4
4
  Summary: common commodity/oil analytics utils
5
5
  Author-email: aeorxc <author@example.com>
6
+ License-Expression: MIT
6
7
  Project-URL: Homepage, https://dev.azure.com/RWEST-MFI-TE/Oil/_git/commodutil
7
8
  Project-URL: Source, https://dev.azure.com/RWEST-MFI-TE/Oil/_git/commodutil
8
9
  Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.9
12
12
  Requires-Dist: pandas>=2.1
13
13
  Requires-Dist: dask[delayed]
14
14
  Requires-Dist: pint
15
+ Requires-Dist: pycountry
15
16
  Requires-Dist: python-dateutil
16
17
  Provides-Extra: test
17
18
  Requires-Dist: pytest; extra == "test"
@@ -0,0 +1,21 @@
1
+ # commodutil
2
+ Common commodity and oil analytics utilities.
3
+
4
+ ## Dependency modes
5
+ `pyproject.toml` is commodutil's only dependency declaration. Runtime dependencies live in
6
+ `project.dependencies`; PEP 735 groups provide `test`, `dev`, and `release` tooling.
7
+
8
+ Azure Pipelines uses locked project mode. `uv.lock` fixes the exact Oil_Feed solution, and
9
+ the pipeline installs the `test` group on Python 3.11 and 3.12 before testing the exact wheel
10
+ built once upstream. After changing dependencies, regenerate the lock with uv 0.11.28 against
11
+ Oil_Feed and run `uv lock --check`. The lock may contain the credential-free feed URL, but it
12
+ must never contain usernames, tokens, or other registries.
13
+
14
+ The shared pipeline template also supports a requirements mode for other legacy repositories.
15
+ commodutil does not use that mode and intentionally has no `requirements*.txt` manifests.
16
+
17
+ Oil_Feed is private and this GitHub repository currently has no feed credential. GitHub Actions
18
+ therefore removes the feed-specific lock only in its ephemeral checkout and resolves the same
19
+ pyproject groups from public PyPI. To make GitHub use the committed frozen solution, add an
20
+ `OIL_FEED_PAT` repository secret with Azure Artifacts Packaging Read permission, then replace
21
+ the public-resolution step with runtime-authenticated `uv sync --frozen`. Never commit the PAT.
@@ -9,14 +9,22 @@ extends:
9
9
  template: templates/python-packages-pipeline.yml@pipeline-templates
10
10
  parameters:
11
11
  packageName: 'commodutil'
12
+ pythonVersion: '3.12'
13
+ additionalPythonVersions:
14
+ - '3.11'
15
+ dependencyMode: project
16
+ dependencyGroups:
17
+ - test
18
+ installOdbc: false
12
19
  createRefinitivConfig: false
13
20
 
14
21
  pool: Self-Hosted-AWS
15
22
 
16
23
  trigger:
24
+ batch: true
17
25
  branches:
18
26
  include:
19
27
  - main
20
28
  tags:
21
29
  include:
22
- - "*"
30
+ - "*"
@@ -7,7 +7,7 @@ facade eagerly imported convfactors and its pint registry).
7
7
 
8
8
  Cheap paths:
9
9
  import commodutil # near-instant
10
- from commodutil.standards.regions import ... # stdlib only
10
+ from commodutil.standards.trading_hubs import ... # stdlib only
11
11
  from commodutil.standards.currency import ... # stdlib only
12
12
 
13
13
  Heavier paths (lazy-load their sub-module on first attribute access):
@@ -22,7 +22,6 @@ from __future__ import annotations
22
22
  # resolve via __getattr__ below.
23
23
  _LAZY_EXPORTS = {
24
24
  # convfactors (heaviest -- pint registry + Commodity dataclass init)
25
- "ALIASES": "commodutil.convfactors",
26
25
  "COMMODITIES": "commodutil.convfactors",
27
26
  "Commodity": "commodutil.convfactors",
28
27
  "convert": "commodutil.convfactors",
@@ -41,6 +40,8 @@ _LAZY_EXPORTS = {
41
40
  "canonical_price_unit_token": "commodutil.standards.units",
42
41
  "canonical_quantity_unit": "commodutil.standards.units",
43
42
  "canonical_unit_token": "commodutil.standards.units",
43
+ "is_canonical_price_unit": "commodutil.standards.units",
44
+ "normalize_price_unit_strict": "commodutil.standards.units",
44
45
  "quantity_unit_from_price_unit": "commodutil.standards.units",
45
46
  # dates
46
47
  "curmon": "commodutil.dates",