Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Notable changes to this project.


## [2.23.1] - 2026-04-23
- fix package version lookup


## [2.22.0] - 2026-01-05
-- added `get_leaderboard` for crypto tournament

Expand Down
4 changes: 2 additions & 2 deletions numerapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version("package-name")
__version__ = version("numerapi")
except PackageNotFoundError:
__version__ = 'unknown'
__version__ = "unknown"


# pylint: disable=wrong-import-position
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def load(path):
return open(path, "r").read()


numerapi_version = "2.23.0"
numerapi_version = "2.23.1"


classifiers = [
Expand Down
19 changes: 19 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import importlib
import importlib.metadata
import os
import pytest
from click.testing import CliRunner
from unittest.mock import patch

import numerapi
from numerapi import cli


Expand Down Expand Up @@ -117,3 +120,19 @@ def test_version():
result = CliRunner().invoke(cli.version)
# just testing if calling works fine
assert result.exit_code == 0


def test_version_uses_numerapi_distribution_name(monkeypatch):
called_package_names = []

def mock_version(package_name):
called_package_names.append(package_name)
return "2.23.1"

with monkeypatch.context() as context:
context.setattr(importlib.metadata, "version", mock_version)
importlib.reload(numerapi)
assert called_package_names == ["numerapi"]
assert numerapi.__version__ == "2.23.1"

importlib.reload(numerapi)
Loading