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
20 changes: 10 additions & 10 deletions .claude/commands/finish.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Complete current Git Flow branch: **$ARGUMENTS**
- Git status: !`git status --porcelain`
- Unpushed commits: !`git log @{u}.. --oneline 2>/dev/null | wc -l | tr -d ' '`
- Latest tag: !`git describe --tags --abbrev=0 2>/dev/null || echo "No tags"`
- Test status: !`npm test 2>/dev/null | tail -20 || echo "No test command available"`
- Test status: !`python -m pytest --co -q 2>/dev/null | tail -5 || echo "No test command available"`

## Task

Expand Down Expand Up @@ -321,8 +321,8 @@ To finish this branch manually:
❌ Cannot finish: Uncommitted changes detected

Modified files:
M src/file1.js
M src/file2.js
M etoropy/client.py
M etoropy/models.py

Please commit or stash your changes first:
1. Commit: git add . && git commit
Expand All @@ -349,13 +349,13 @@ Would you like to push now? [Y/n]
❌ Cannot finish: Tests are failing

Failed tests:
UserService.test.js
- should authenticate user (expected 200, got 401)
PaymentController.test.js
- should process payment (timeout)
tests/test_client.py::test_authenticate
- AssertionError: expected 200, got 401
tests/test_api.py::test_request_timeout
- TimeoutError

Fix the failing tests before finishing:
1. Run tests: npm test
1. Run tests: pytest
2. Fix failures
3. Commit fixes
4. Try /finish again
Expand All @@ -368,8 +368,8 @@ Skip tests? (NOT RECOMMENDED) [y/N]
❌ Merge conflict detected with develop

Conflicting files:
src/config.js
package.json
etoropy/config.py
pyproject.toml

Resolution steps:
1. Fetch latest develop: git fetch origin develop
Expand Down
8 changes: 4 additions & 4 deletions .claude/commands/flow-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Status:

Next steps:
1. Commit your changes
2. Run tests: npm test
2. Run tests: pytest
3. Push to remote: git push
4. When ready: /finish
```
Expand Down Expand Up @@ -168,12 +168,12 @@ Version analysis:

Checklist:
✓ CHANGELOG.md updated
✓ Version in package.json
✓ Version in pyproject.toml
⚠️ Tests not run
✗ No tag created yet

Next steps:
1. Run final tests: npm test
1. Run final tests: pytest
2. Review CHANGELOG.md
3. Create PR: gh pr create
4. Get approvals
Expand Down Expand Up @@ -323,7 +323,7 @@ Next Steps:
1. Commit changes: git add . && git commit
2. Pull updates: git pull
3. Push commits: git push
4. Run tests: npm test
4. Run tests: pytest
5. Finish when ready: /finish
```

Expand Down
39 changes: 14 additions & 25 deletions .claude/commands/hotfix.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Create emergency hotfix branch: **$ARGUMENTS**
- Git status: !`git status --porcelain`
- Latest production tag: !`git describe --tags --abbrev=0 origin/main 2>/dev/null || echo "No tags on main"`
- Main branch status: !`git log main..origin/main --oneline 2>/dev/null | head -3 || echo "No remote tracking for main"`
- Commits on main since last tag: !`git log $(git describe --tags --abbrev=0 origin/main 2>/dev/null)..origin/main --oneline 2>/dev/null | wc -l | tr -d ' '`
- Recent commits on main: !`git log origin/main --oneline -5 2>/dev/null || echo "No commits found"`

## Task

Expand Down Expand Up @@ -118,7 +118,7 @@ This is an EMERGENCY production fix. Follow these steps:
- Verify no side effects

4. 📝 Document the Fix
- Update version in package.json
- Update version in pyproject.toml
- Add entry to CHANGELOG.md
- Document the bug and fix
- Include reproduction steps
Expand All @@ -132,7 +132,7 @@ This is an EMERGENCY production fix. Follow these steps:

🎯 Next Steps:
1. Fix the critical issue (MINIMAL changes only)
2. Test thoroughly: npm test
2. Test thoroughly: pytest
3. Update version: v1.2.1
4. Create emergency PR: gh pr create --label "hotfix,critical"
5. Get fast-track approval
Expand Down Expand Up @@ -187,8 +187,8 @@ Examples:
**Uncommitted Changes:**
```
⚠️ Uncommitted changes detected in working directory:
M src/file.js
A test.js
M etoropy/client.py
A tests/test_fix.py

Hotfixes require a clean working directory.

Expand Down Expand Up @@ -279,28 +279,17 @@ Post-Deployment:

### 7. Version Update Process

After implementing the fix, update the version:
After implementing the fix, update the version in `pyproject.toml`:

```bash
# Update package.json version (PATCH bump)
npm version patch --no-git-tag-version

# Update CHANGELOG.md
cat >> CHANGELOG.md << EOF

## [v1.2.1] - $(date +%Y-%m-%d) - HOTFIX

### 🔥 Critical Fixes
- Fix $ARGUMENTS: [brief description]
- Root cause: [explanation]
- Impact: [who/what was affected]
- Resolution: [what was fixed]
- Read the current `version` field in `pyproject.toml`
- Increment the PATCH segment (e.g. `0.1.1` → `0.1.2`)
- Use the Edit tool to update the `version` line in `pyproject.toml`
- Update `CHANGELOG.md` with the hotfix entry
- Commit the version bump:

EOF

# Commit version bump
git add package.json CHANGELOG.md
git commit -m "chore(hotfix): bump version to v1.2.1
```bash
git add pyproject.toml CHANGELOG.md
git commit -m "chore(hotfix): bump version to vX.Y.Z

Critical fix for $ARGUMENTS

Expand Down
24 changes: 12 additions & 12 deletions .claude/commands/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Create new release branch: **$ARGUMENTS**
- Current branch: !`git branch --show-current`
- Git status: !`git status --porcelain`
- Latest tag: !`git describe --tags --abbrev=0 2>/dev/null || echo "No tags found"`
- Commits since last tag: !`git log $(git describe --tags --abbrev=0 2>/dev/null)..HEAD --oneline 2>/dev/null | wc -l | tr -d ' '`
- Package.json version: !`cat package.json 2>/dev/null | grep '"version"' | head -1 || echo "No package.json found"`
- Recent commits: !`git log --oneline -10 2>/dev/null || echo "No commits found"`
- pyproject.toml version: !`grep '^version' pyproject.toml 2>/dev/null || echo "No pyproject.toml found"`
- Recent commits: !`git log --oneline -10`

## Task
Expand Down Expand Up @@ -70,17 +70,17 @@ git pull origin develop
# Create release branch
git checkout -b release/$ARGUMENTS

# Update package.json version (if Node.js project)
npm version ${ARGUMENTS#v} --no-git-tag-version
# Update version in pyproject.toml
# Use Edit tool to update the `version` field in pyproject.toml

# Generate CHANGELOG.md from commits
# (analyze git log since last tag)

# Commit version bump
git add package.json CHANGELOG.md
git add pyproject.toml CHANGELOG.md
git commit -m "chore(release): bump version to ${ARGUMENTS#v}

- Updated package.json version
- Updated pyproject.toml version
- Generated CHANGELOG.md from commits

🤖 Generated with Claude Code
Expand Down Expand Up @@ -135,18 +135,18 @@ Display this checklist after creation:
🚀 Release Checklist for $ARGUMENTS

Pre-Release Tasks:
- [ ] All tests passing (run: npm test)
- [ ] All tests passing (run: pytest)
- [ ] Documentation updated
- [ ] CHANGELOG.md reviewed and accurate
- [ ] Version numbers consistent across files
- [ ] No breaking changes (or properly documented)
- [ ] Dependencies updated (run: npm audit)
- [ ] Dependencies reviewed

Testing Tasks:
- [ ] Manual testing completed
- [ ] Regression tests passed
- [ ] Performance benchmarks acceptable
- [ ] Security scan clean (run: npm audit)
- [ ] Security scan clean
- [ ] Cross-browser testing (if applicable)

Deployment Preparation:
Expand All @@ -163,7 +163,7 @@ Final Steps:

🎯 Next Commands:
- Review CHANGELOG: cat CHANGELOG.md
- Run tests: npm test
- Run tests: pytest
- Create PR: gh pr create --base main --head release/$ARGUMENTS
- When ready: /finish
```
Expand All @@ -174,7 +174,7 @@ Final Steps:
✓ Switched to develop branch
✓ Pulled latest changes from origin/develop
✓ Created branch: release/$ARGUMENTS
✓ Updated package.json version to ${ARGUMENTS#v}
✓ Updated pyproject.toml version to ${ARGUMENTS#v}
✓ Generated CHANGELOG.md (15 commits analyzed)
✓ Committed version bump changes
✓ Set up remote tracking: origin/release/$ARGUMENTS
Expand All @@ -201,7 +201,7 @@ Target: main (after review)

🎯 Next Steps:
1. Review CHANGELOG.md for accuracy
2. Run final tests: npm test
2. Run final tests: pytest
3. Test on staging environment
4. Create PR to main: gh pr create
5. Get team approvals
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

# Project-specific
trash/
# Ignore notebook that start with an underscore, which are used for testing and development purposes
notebooks/_*.ipynb

# JetBrains IDE
.idea/**
Expand Down
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions etoropy.iml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Python 3.11 (etoropy)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
6 changes: 4 additions & 2 deletions etoropy/ws/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ async def connect(self) -> None:
logger.info("WebSocket connected")
self._emit("open")

await self._authenticate()
self._receive_task = asyncio.create_task(self._receive_loop())
await self._authenticate()

async def _authenticate(self) -> None:
auth_msg = {
Expand Down Expand Up @@ -241,7 +241,9 @@ async def _receive_loop(self) -> None:
assert self._ws is not None
try:
async for raw in self._ws:
self._handle_message(str(raw))
if isinstance(raw, bytes):
continue
self._handle_message(raw)
except websockets.ConnectionClosed as exc:
logger.info("WebSocket closed: %d %s", exc.code, exc.reason)
self._authenticated = False
Expand Down
15 changes: 15 additions & 0 deletions notebooks/gitkeep.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"cells": [
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "",
"id": "7523e10f1a3cd53a"
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
Loading
Loading