-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
286 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: tastyware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is, with screenshots or logs of problematic behavior. | ||
|
||
**How to reproduce** | ||
Post your code so the source of the problem can be identified. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Description | ||
|
||
## Related issue(s) | ||
Fixes ... | ||
|
||
## Pre-merge checklist | ||
- [ ] Code formatted correctly (check with `make lint`) | ||
- [ ] Code implemented for both sync and async | ||
- [ ] Passing tests locally (check with `make test`) | ||
- [ ] New tests added (if applicable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.12 | ||
3.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
.PHONY: install lint test docs | ||
.PHONY: install lint test | ||
|
||
install: | ||
uv sync | ||
uv pip install -e . | ||
|
||
lint: | ||
uv run ruff check tradestation/ | ||
uv run ruff check tests/ | ||
uv run mypy -p tradestation | ||
uv run mypy -p tests | ||
uv run ruff format tradestation/ tests/ | ||
uv run ruff check tradestation/ tests/ | ||
uv run pyright tradestation/ tests/ | ||
|
||
test: | ||
uv run pytest --cov=tradestation --cov-report=term-missing tests/ --cov-fail-under=95 | ||
|
||
docs: | ||
cd docs; make html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,18 +5,34 @@ build-backend = "hatchling.build" | |
[project] | ||
name = "tradestation" | ||
version = "0.2" | ||
description = "An unofficial Python SDK for Tradestation!" | ||
description = "An unofficial, sync/async SDK for Tradestation!" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
license = {file = "LICENSE"} | ||
authors = [ | ||
{name = "Graeme Holliday", email = "[email protected]"}, | ||
{name = "Ethan Corgatelli", email = "[email protected]"}, | ||
] | ||
dependencies = [ | ||
"httpx>=0.27.2", | ||
"pydantic>=2.9.2", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/tastyware/tradestation" | ||
Documentation = "https://tradestation.readthedocs.io/en/latest" | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
"mypy>=1.11.2", | ||
"pytest>=8.3.3", | ||
"pytest-cov>=5.0.0", | ||
"ruff>=0.6.7", | ||
"sphinx>=8.0.2", | ||
"pyright>=1.1.391", | ||
"pytest-aio>=1.9.0", | ||
] | ||
|
||
[tool.setuptools.package-data] | ||
"tradestation" = ["py.typed"] | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["tradestation"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
|
||
from pytest import fixture | ||
|
||
from tradestation import Session | ||
|
||
|
||
# Run all tests with asyncio only | ||
@fixture(scope="session") | ||
def aiolib(): | ||
return "asyncio" | ||
|
||
|
||
@fixture(scope="session") | ||
def credentials(): | ||
username = os.getenv("TS_USERNAME") | ||
password = os.getenv("TS_PASSWORD") | ||
assert username is not None | ||
assert password is not None | ||
return username, password | ||
|
||
|
||
@fixture(scope="session") | ||
async def session(credentials, aiolib): | ||
session = Session(*credentials) | ||
yield session | ||
# session.destroy() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import logging | ||
|
||
from .session import Session | ||
|
||
API_URL_V3 = 'https://api.tradestation.com/v3' | ||
API_URL_V2 = 'https://api.tradestation.com/v2' | ||
API_URL_SIM = 'https://sim-api.tradestation.com/v3' | ||
VERSION = '0.2' | ||
API_URL_V3 = "https://api.tradestation.com/v3" | ||
API_URL_V2 = "https://api.tradestation.com/v2" | ||
API_URL_SIM = "https://sim-api.tradestation.com/v3" | ||
VERSION = "0.2" | ||
|
||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.DEBUG) | ||
|
||
__all__ = ['Session'] | ||
# ruff: noqa: E402 | ||
|
||
from .session import Session | ||
|
||
__all__ = ["Session"] |