From 65700f013dfc25b8d5d2936232c116f93280df14 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 29 May 2025 23:04:40 +0400 Subject: [PATCH 1/6] fmt --- .pre-commit-config.yaml | 14 +++++++------- pyproject.toml | 2 +- src/cvx/simulator/__init__.py | 3 +++ src/tests/test_version.py | 4 ++++ 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 src/tests/test_version.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fef15ba5..90931338 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,17 +3,17 @@ repos: rev: v5.0.0 hooks: - id: check-toml - - id: end-of-file-fixer + #- id: end-of-file-fixer - id: trailing-whitespace - id: check-yaml - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.11.11' - hooks: - - id: ruff - args: [ --fix, --exit-non-zero-on-fix ] + #- repo: https://github.com/astral-sh/ruff-pre-commit + # rev: 'v0.11.11' + # hooks: + #- id: ruff + # args: [ --fix, --exit-non-zero-on-fix ] # Run the formatter - - id: ruff-format + #- id: ruff-format - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.45.0 diff --git a/pyproject.toml b/pyproject.toml index b12e5bd0..426a9add 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dev = [ line-length = 120 target-version = "py310" exclude = [ - "*__init__.py" + "**/__init__.py" ] [tool.ruff.lint] diff --git a/src/cvx/simulator/__init__.py b/src/cvx/simulator/__init__.py index a846f4b3..c5e0881e 100644 --- a/src/cvx/simulator/__init__.py +++ b/src/cvx/simulator/__init__.py @@ -24,8 +24,11 @@ - State: Represents the current state of a portfolio during simulation - interpolate: Utility function for interpolating missing values in time series """ +import importlib.metadata from .builder import Builder from .portfolio import Portfolio from .state import State from .utils.interpolation import interpolate + +__version__ = importlib.metadata.version("cvxsimulator") \ No newline at end of file diff --git a/src/tests/test_version.py b/src/tests/test_version.py new file mode 100644 index 00000000..55678369 --- /dev/null +++ b/src/tests/test_version.py @@ -0,0 +1,4 @@ +import cvx.simulator + +def test_version(): + assert cvx.simulator.__version__ is not None From 081cc178e5f35387b0496ebf51ad527cae7451ff Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 29 May 2025 23:04:58 +0400 Subject: [PATCH 2/6] fmt --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 90931338..ad28b34d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: rev: v5.0.0 hooks: - id: check-toml - #- id: end-of-file-fixer + - id: end-of-file-fixer - id: trailing-whitespace - id: check-yaml From 6744f665f8dd56f9803f7af6b78595347c663218 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 29 May 2025 23:05:47 +0400 Subject: [PATCH 3/6] fmt --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ad28b34d..b679ec32 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,13 +7,13 @@ repos: - id: trailing-whitespace - id: check-yaml - #- repo: https://github.com/astral-sh/ruff-pre-commit - # rev: 'v0.11.11' - # hooks: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: 'v0.11.11' + hooks: #- id: ruff # args: [ --fix, --exit-non-zero-on-fix ] # Run the formatter - #- id: ruff-format + - id: ruff-format - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.45.0 From 1ea38f52e381c5a11261ba44f502bee3018a28f0 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 29 May 2025 23:06:11 +0400 Subject: [PATCH 4/6] fmt --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b679ec32..fef15ba5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,8 +10,8 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: 'v0.11.11' hooks: - #- id: ruff - # args: [ --fix, --exit-non-zero-on-fix ] + - id: ruff + args: [ --fix, --exit-non-zero-on-fix ] # Run the formatter - id: ruff-format From 131005652e580256bf6f107c0c179123640ca4de Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 29 May 2025 23:06:53 +0400 Subject: [PATCH 5/6] fmt --- .gitignore | 1 + pyproject.toml | 2 +- src/cvx/simulator/__init__.py | 10 ++++++++-- src/tests/test_version.py | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 54f0d2e4..c13a16f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea .task +docs # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/pyproject.toml b/pyproject.toml index 426a9add..981c0b76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dev = [ line-length = 120 target-version = "py310" exclude = [ - "**/__init__.py" + "src/cvx/simulator/__init__.py" ] [tool.ruff.lint] diff --git a/src/cvx/simulator/__init__.py b/src/cvx/simulator/__init__.py index c5e0881e..7170b654 100644 --- a/src/cvx/simulator/__init__.py +++ b/src/cvx/simulator/__init__.py @@ -24,11 +24,17 @@ - State: Represents the current state of a portfolio during simulation - interpolate: Utility function for interpolating missing values in time series """ -import importlib.metadata +from importlib.metadata import version +__version__ = version("cvxsimulator") from .builder import Builder from .portfolio import Portfolio from .state import State from .utils.interpolation import interpolate -__version__ = importlib.metadata.version("cvxsimulator") \ No newline at end of file +__all__ = [ + "Builder", + "Portfolio", + "State", + "interpolate" +] diff --git a/src/tests/test_version.py b/src/tests/test_version.py index 55678369..faff9f47 100644 --- a/src/tests/test_version.py +++ b/src/tests/test_version.py @@ -1,4 +1,5 @@ import cvx.simulator + def test_version(): assert cvx.simulator.__version__ is not None From d043e93b43e374ac4503db0b17c19f94efa35745 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Thu, 29 May 2025 23:23:42 +0400 Subject: [PATCH 6/6] dependencies relax --- pyproject.toml | 8 ++++---- uv.lock | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 981c0b76..8ffe7511 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,11 +6,11 @@ authors = [{name = "Thomas Schmelzer", email = "thomas.schmelzer@gmail.com"}] readme = "README.md" requires-python = ">=3.10" dependencies = [ - "cvxpy-base>=1.6.0", - "jquantstats>=0.0.14", - "numpy>=2.1.3", + "cvxpy-base>=1.5.1", + "jquantstats>=0.0.15", + "numpy>=2.0", "pandas>=2.2.3", - "polars>=1.29.0", + "polars>=1.18.0", ] [project.urls] diff --git a/uv.lock b/uv.lock index 64885770..c0aa424c 100644 --- a/uv.lock +++ b/uv.lock @@ -226,12 +226,12 @@ dev = [ [package.metadata] requires-dist = [ { name = "clarabel", marker = "extra == 'dev'", specifier = ">=0.9.0" }, - { name = "cvxpy-base", specifier = ">=1.6.0" }, - { name = "jquantstats", specifier = ">=0.0.14" }, + { name = "cvxpy-base", specifier = ">=1.5.1" }, + { name = "jquantstats", specifier = ">=0.0.15" }, { name = "loguru", marker = "extra == 'dev'" }, - { name = "numpy", specifier = ">=2.1.3" }, + { name = "numpy", specifier = ">=2.0" }, { name = "pandas", specifier = ">=2.2.3" }, - { name = "polars", specifier = ">=1.29.0" }, + { name = "polars", specifier = ">=1.18.0" }, { name = "pre-commit", marker = "extra == 'dev'", specifier = ">=4.0.1" }, { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.3.3" }, { name = "pytest-cov", marker = "extra == 'dev'", specifier = ">=6.0.0" }, @@ -289,7 +289,7 @@ wheels = [ [[package]] name = "jquantstats" -version = "0.0.14" +version = "0.0.15" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "kaleido" }, @@ -300,9 +300,9 @@ dependencies = [ { name = "pyarrow" }, { name = "scipy" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ea/58/5281ba43db44bb57eec5c9c67973c41957935ff4ffc6bc40c55ee83a6f79/jquantstats-0.0.14.tar.gz", hash = "sha256:e4aec81f833867145d008f127df3d0de4d2660f963811d231c817386e57c526f", size = 17330, upload-time = "2025-05-23T12:08:24.809Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b3/9b/2c87de5e99489dc9ec6649c9ae1255229bcba06d44a9581066458550ba03/jquantstats-0.0.15.tar.gz", hash = "sha256:a31b1de6fc515932f3860c34281b9c430d28fff43d4fc39e29037613377a023e", size = 17335, upload-time = "2025-05-29T19:11:58.401Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/10/29/20a2e8e7ba2b941c6865502f224a4b7653a1b95b091747f521eb9b9a87e9/jquantstats-0.0.14-py3-none-any.whl", hash = "sha256:0b6a953a44686a9e7830400fb9e81afb5031848b8b36498c12fcf387f80ea095", size = 20538, upload-time = "2025-05-23T12:08:23.074Z" }, + { url = "https://files.pythonhosted.org/packages/ce/97/cf3084719265865d234b8f9b8e1fe7d0a406a02507e0d17c12c74e38c284/jquantstats-0.0.15-py3-none-any.whl", hash = "sha256:18ebfa84e25f8074f2ed8ebe614471b4d4c5664c3ac11f16dabc8d04d31c16ee", size = 20535, upload-time = "2025-05-29T19:11:57.103Z" }, ] [[package]]