pdmt5 0.1.7__tar.gz → 0.1.8__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 (32) hide show
  1. pdmt5-0.1.8/.github/workflows/claude.yml +59 -0
  2. {pdmt5-0.1.7 → pdmt5-0.1.8}/CLAUDE.md +2 -2
  3. {pdmt5-0.1.7 → pdmt5-0.1.8}/PKG-INFO +2 -2
  4. {pdmt5-0.1.7 → pdmt5-0.1.8}/README.md +1 -1
  5. {pdmt5-0.1.7 → pdmt5-0.1.8}/pdmt5/trading.py +1 -0
  6. {pdmt5-0.1.7 → pdmt5-0.1.8}/pyproject.toml +7 -5
  7. {pdmt5-0.1.7/test → pdmt5-0.1.8/tests}/test_trading.py +28 -0
  8. {pdmt5-0.1.7 → pdmt5-0.1.8}/uv.lock +1 -1
  9. {pdmt5-0.1.7 → pdmt5-0.1.8}/.claude/settings.json +0 -0
  10. {pdmt5-0.1.7 → pdmt5-0.1.8}/.github/FUNDING.yml +0 -0
  11. {pdmt5-0.1.7 → pdmt5-0.1.8}/.github/copilot-instructions.md +0 -0
  12. {pdmt5-0.1.7 → pdmt5-0.1.8}/.github/dependabot.yml +0 -0
  13. {pdmt5-0.1.7 → pdmt5-0.1.8}/.github/workflows/ci.yml +0 -0
  14. {pdmt5-0.1.7 → pdmt5-0.1.8}/.gitignore +0 -0
  15. {pdmt5-0.1.7 → pdmt5-0.1.8}/LICENSE +0 -0
  16. {pdmt5-0.1.7 → pdmt5-0.1.8}/docs/api/dataframe.md +0 -0
  17. {pdmt5-0.1.7 → pdmt5-0.1.8}/docs/api/index.md +0 -0
  18. {pdmt5-0.1.7 → pdmt5-0.1.8}/docs/api/mt5.md +0 -0
  19. {pdmt5-0.1.7 → pdmt5-0.1.8}/docs/api/trading.md +0 -0
  20. {pdmt5-0.1.7 → pdmt5-0.1.8}/docs/api/utils.md +0 -0
  21. {pdmt5-0.1.7 → pdmt5-0.1.8}/docs/index.md +0 -0
  22. {pdmt5-0.1.7 → pdmt5-0.1.8}/mkdocs.yml +0 -0
  23. {pdmt5-0.1.7 → pdmt5-0.1.8}/pdmt5/__init__.py +0 -0
  24. {pdmt5-0.1.7 → pdmt5-0.1.8}/pdmt5/dataframe.py +0 -0
  25. {pdmt5-0.1.7 → pdmt5-0.1.8}/pdmt5/mt5.py +0 -0
  26. {pdmt5-0.1.7 → pdmt5-0.1.8}/pdmt5/utils.py +0 -0
  27. {pdmt5-0.1.7 → pdmt5-0.1.8}/renovate.json +0 -0
  28. {pdmt5-0.1.7/test → pdmt5-0.1.8/tests}/__init__.py +0 -0
  29. {pdmt5-0.1.7/test → pdmt5-0.1.8/tests}/test_dataframe.py +0 -0
  30. {pdmt5-0.1.7/test → pdmt5-0.1.8/tests}/test_init.py +0 -0
  31. {pdmt5-0.1.7/test → pdmt5-0.1.8/tests}/test_mt5.py +0 -0
  32. {pdmt5-0.1.7/test → pdmt5-0.1.8/tests}/test_utils.py +0 -0
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: Claude Code
3
+ on:
4
+ issue_comment:
5
+ types:
6
+ - created
7
+ pull_request_review_comment:
8
+ types:
9
+ - created
10
+ issues:
11
+ types:
12
+ - opened
13
+ - assigned
14
+ pull_request_review:
15
+ types:
16
+ - submitted
17
+ jobs:
18
+ claude:
19
+ if: >
20
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude'))
21
+ || (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude'))
22
+ || (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))
23
+ || (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
24
+ permissions:
25
+ contents: read
26
+ pull-requests: read
27
+ issues: read
28
+ id-token: write
29
+ actions: read # Required for Claude to read CI results on PRs
30
+ uses: dceoy/gh-actions-for-devops/.github/workflows/claude-code-action.yml@main
31
+ with:
32
+ # This is an optional setting that allows Claude to read CI results on PRs
33
+ additional-permissions: |
34
+ actions: read
35
+
36
+ # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
37
+ # model: "claude-opus-4-20250514"
38
+
39
+ # Optional: Customize the trigger phrase (default: @claude)
40
+ # trigger-phrase: "/claude"
41
+
42
+ # Optional: Trigger when specific user is assigned to an issue
43
+ # assignee-trigger: "claude-bot"
44
+
45
+ # Optional: Allow Claude to run specific commands
46
+ # allowed-tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
47
+
48
+ # Optional: Add custom instructions for Claude to customize its behavior for your project
49
+ # custom-instructions: |
50
+ # Follow our coding standards
51
+ # Ensure all new code has tests
52
+ # Use TypeScript for new files
53
+
54
+ # Optional: Custom environment variables for Claude
55
+ # claude-env: |
56
+ # NODE_ENV: test
57
+ secrets:
58
+ CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
59
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -26,7 +26,7 @@ uv run pyright .
26
26
 
27
27
  ```bash
28
28
  # Run unit tests with pytest
29
- uv run pytest test/ -v
29
+ uv run pytest tests/ -v
30
30
 
31
31
  # Type checking with pyright
32
32
  uv run pyright .
@@ -68,7 +68,7 @@ uv run mkdocs gh-deploy
68
68
  - `dataframe.py`: MT5 data client with pandas DataFrame conversion (`Mt5Config`, `Mt5DataClient`)
69
69
  - `trading.py`: Trading operations client (`Mt5TradingClient`, `Mt5TradingError`)
70
70
  - `utils.py`: Utility decorators and functions for time conversion and DataFrame indexing
71
- - `test/`: Comprehensive test suite (pytest-based)
71
+ - `tests/`: Comprehensive test suite (pytest-based)
72
72
  - `test_init.py`, `test_mt5.py`, `test_dataframe.py`, `test_trading.py`, `test_utils.py`
73
73
  - `docs/`: MkDocs documentation with API reference
74
74
  - `docs/api/`: Auto-generated API documentation for all modules
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdmt5
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: Pandas-based data handler for MetaTrader 5
5
5
  Project-URL: Repository, https://github.com/dceoy/pdmt5.git
6
6
  Author-email: dceoy <dceoy@users.noreply.github.com>
@@ -392,7 +392,7 @@ cd pdmt5
392
392
  uv sync
393
393
 
394
394
  # Run tests
395
- uv run pytest test/ -v
395
+ uv run pytest tests/ -v
396
396
 
397
397
  # Run type checking
398
398
  uv run pyright .
@@ -369,7 +369,7 @@ cd pdmt5
369
369
  uv sync
370
370
 
371
371
  # Run tests
372
- uv run pytest test/ -v
372
+ uv run pytest tests/ -v
373
373
 
374
374
  # Run type checking
375
375
  uv run pyright .
@@ -146,6 +146,7 @@ class Mt5TradingClient(Mt5DataClient):
146
146
  elif retcode in {
147
147
  self.mt5.TRADE_RETCODE_TRADE_DISABLED,
148
148
  self.mt5.TRADE_RETCODE_MARKET_CLOSED,
149
+ self.mt5.TRADE_RETCODE_NO_CHANGES,
149
150
  }:
150
151
  self.logger.info("response: %s", response)
151
152
  comment = response.get("comment", "Unknown error")
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pdmt5"
3
- version = "0.1.7"
3
+ version = "0.1.8"
4
4
  description = "Pandas-based data handler for MetaTrader 5"
5
5
  authors = [{name = "dceoy", email = "dceoy@users.noreply.github.com"}]
6
6
  maintainers = [{name = "dceoy", email = "dceoy@users.noreply.github.com"}]
@@ -46,7 +46,7 @@ required-environments = ["platform_system == 'Windows'"]
46
46
 
47
47
  [tool.uv.build-backend]
48
48
  source-include = ["pdmt5/**", "LICENSE"]
49
- source-exclude = ["test/**"]
49
+ source-exclude = ["tests/**"]
50
50
 
51
51
  [tool.ruff]
52
52
  line-length = 88
@@ -126,7 +126,7 @@ ignore = [
126
126
  ]
127
127
 
128
128
  [tool.ruff.lint.per-file-ignores]
129
- "test/**/*.py" = [
129
+ "tests/**/*.py" = [
130
130
  "DOC201", # Missing return documentation
131
131
  "DOC501", # Raised exception missing from docstring
132
132
  "PLC2701", # Private name import
@@ -147,6 +147,8 @@ max-public-methods = 40
147
147
 
148
148
  [tool.pyright]
149
149
  exclude = ["build", ".venv"]
150
+ venvPath = "."
151
+ venv = ".venv"
150
152
  typeCheckingMode = "strict"
151
153
  reportUnknownArgumentType = "none"
152
154
  reportUnknownMemberType = "none"
@@ -162,7 +164,7 @@ addopts = [
162
164
  "--capture=no",
163
165
  ]
164
166
  pythonpaths = ["."]
165
- testpaths = ["test"]
167
+ testpaths = ["tests"]
166
168
  python_files = ["test_*.py", "*_test.py"]
167
169
  python_classes = ["Test*"]
168
170
  python_functions = ["test_*"]
@@ -172,7 +174,7 @@ minversion = "6.0"
172
174
  source = ["pdmt5"]
173
175
  omit = [
174
176
  "**/__init__.py",
175
- "test/**",
177
+ "tests/**",
176
178
  ]
177
179
 
178
180
  [tool.coverage.report]
@@ -72,6 +72,7 @@ def mock_mt5_import(
72
72
  mock_mt5.TRADE_RETCODE_DONE = 10009
73
73
  mock_mt5.TRADE_RETCODE_TRADE_DISABLED = 10017
74
74
  mock_mt5.TRADE_RETCODE_MARKET_CLOSED = 10018
75
+ mock_mt5.TRADE_RETCODE_NO_CHANGES = 10025
75
76
  mock_mt5.RES_S_OK = 1
76
77
  mock_mt5.DEAL_TYPE_BUY = 0
77
78
  mock_mt5.DEAL_TYPE_SELL = 1
@@ -568,6 +569,33 @@ class TestMt5TradingClient:
568
569
 
569
570
  assert result["retcode"] == 10018
570
571
 
572
+ def test_send_or_check_order_no_changes(
573
+ self,
574
+ mock_mt5_import: ModuleType,
575
+ ) -> None:
576
+ """Test _send_or_check_order with no changes return code."""
577
+ client = Mt5TradingClient(mt5=mock_mt5_import)
578
+ mock_mt5_import.initialize.return_value = True
579
+ client.initialize()
580
+
581
+ request = {
582
+ "action": 1,
583
+ "symbol": "EURUSD",
584
+ "volume": 0.1,
585
+ "type": 1,
586
+ }
587
+
588
+ # Mock no changes response
589
+ mock_mt5_import.order_send.return_value.retcode = 10025
590
+ mock_mt5_import.order_send.return_value._asdict.return_value = {
591
+ "retcode": 10025,
592
+ "comment": "No changes",
593
+ }
594
+
595
+ result = client._send_or_check_order(request)
596
+
597
+ assert result["retcode"] == 10025
598
+
571
599
  def test_send_or_check_order_failure(
572
600
  self,
573
601
  mock_mt5_import: ModuleType,
@@ -613,7 +613,7 @@ wheels = [
613
613
 
614
614
  [[package]]
615
615
  name = "pdmt5"
616
- version = "0.1.7"
616
+ version = "0.1.8"
617
617
  source = { editable = "." }
618
618
  dependencies = [
619
619
  { name = "metatrader5", marker = "sys_platform == 'win32'" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes