-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
9 changed files
with
1,781 additions
and
88 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
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,27 +1,117 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
on: push | ||
|
||
jobs: | ||
deploy: | ||
build: | ||
name: Build distribution 📦 | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish-to-pypi: | ||
name: >- | ||
Publish Python 🐍 distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/tastytrade | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
github-release: | ||
name: >- | ||
Sign the Python 🐍 distribution 📦 with Sigstore | ||
and upload them to GitHub Release | ||
needs: | ||
- publish-to-pypi | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write # IMPORTANT: mandatory for making GitHub Releases | ||
id-token: write # IMPORTANT: mandatory for sigstore | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Sign the dists with Sigstore | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release create | ||
'${{ github.ref_name }}' | ||
--repo '${{ github.repository }}' | ||
--notes "" | ||
- name: Upload artifact signatures to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
# Upload to GitHub Release using the `gh` CLI. | ||
# `dist/` contains the built packages, and the | ||
# sigstore-produced signatures and certificates. | ||
run: >- | ||
gh release upload | ||
'${{ github.ref_name }}' dist/** | ||
--repo '${{ github.repository }}' | ||
publish-to-testpypi: | ||
name: Publish Python 🐍 distribution 📦 to TestPyPI | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/tastytrade | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies and build | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel | ||
python setup.py sdist bdist_wheel | ||
- name: Publish to PyPI | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
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,19 +1,17 @@ | ||
.PHONY: venv lint test docs | ||
.PHONY: install lint test docs | ||
|
||
venv: | ||
python -m venv .venv | ||
.venv/bin/pip install -r requirements.txt | ||
.venv/bin/pip install -e . | ||
.venv/bin/pip install -r docs/requirements.txt | ||
install: | ||
uv sync | ||
uv pip install -e . | ||
|
||
lint: | ||
.venv/bin/isort --check --diff tastytrade/ tests/ | ||
.venv/bin/flake8 --count --show-source --statistics tastytrade/ tests/ | ||
.venv/bin/mypy -p tastytrade | ||
.venv/bin/mypy -p tests | ||
uv run ruff check tastytrade/ | ||
uv run ruff check tests/ | ||
uv run mypy -p tastytrade | ||
uv run mypy -p tests | ||
|
||
test: | ||
.venv/bin/pytest --cov=tastytrade --cov-report=term-missing tests/ --cov-fail-under=95 | ||
uv run pytest --cov=tastytrade --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
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,44 @@ | ||
[project] | ||
name = "tastytrade" | ||
version = "8.4" | ||
description = "An unofficial SDK for Tastytrade!" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
license = {file = "LICENSE"} | ||
authors = [ | ||
{name = "Graeme Holliday", email = "[email protected]"}, | ||
] | ||
|
||
dependencies = [ | ||
"fake-useragent>=1.5.1", | ||
"pandas-market-calendars>=4.4.1", | ||
"pydantic>=2.9.2", | ||
"requests>=2.32.3", | ||
"websockets>=13.1", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/tastyware/tastytrade" | ||
Documentation = "https://tastyworks-api.readthedocs.io/en/latest" | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
"mypy>=1.11.2", | ||
"pytest>=8.3.3", | ||
"pytest-asyncio>=0.24.0", | ||
"pytest-cov>=5.0.0", | ||
"ruff>=0.6.7", | ||
"types-pytz>=2024.2.0.20240913", | ||
"types-requests>=2.32.0.20240914", | ||
"sphinx<7", | ||
"sphinx-rtd-theme==1.2.2", | ||
"sphinx-toolbox==3.4.0", | ||
"enum-tools>=0.12.0", | ||
"autodoc-pydantic>=2.2.0", | ||
] | ||
|
||
[tool.setuptools.package-data] | ||
"tastytrade" = ["py.typed"] | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["tastytrade"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.