Skip to content

Commit

Permalink
Merge pull request #2 from rcholic/modeling2
Browse files Browse the repository at this point in the history
github actions
  • Loading branch information
rcholic authored Jun 5, 2024
2 parents ddd3ded + 4646766 commit 9253280
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 3 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Publish to PyPI
on:
push:
pull_request:
branches:
- main
jobs:
build:
name: Build Distribution
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
python -m pip install -r requirements.txt
- name: Build distribution in binary and source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

pypi-publish:
name: Publish release 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/CSchwabPy
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
# retrieve your distributions here
- name: Download distribution packages
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

# - 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 }}'
1 change: 0 additions & 1 deletion cschwabpy/SchwabAsyncClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import time
import httpx
import re
import os
import base64


Expand Down
2 changes: 1 addition & 1 deletion cschwabpy/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class OptionChainQueryFilter(QueryFilterBase):
symbol: str
contractType: OptionContractType = OptionContractType.ALL
strikeCount: int = (
25 # the number of strikes to return above or below the at-the-money price
40 # the number of strikes to return above or below the at-the-money price
)
includeUnderlyingQuote: bool = True
strategy: OptionContractStrategy = OptionContractStrategy.ANALYTICAL
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
description = ""
authors = ["Tony Wang <[email protected]>"]
readme = "README.md"
packages = [{include = "cschwab"}]
packages = [{include = "cschwabpy"}]

[tool.poetry.dependencies]
python = "^3.10.13"
Expand Down
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
minversion = 7.0
pythonpath = schwabpy
testpaths =
tests
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from setuptools import setup

with open("README.md") as file:
long_description = file.read()

setup(
name="CSchwabPy",
version="0.1.0",
description="Charles Schwab Stock & Option Trade API Client for Python.",
long_description=long_description,
long_description_content_type="text/markdown",
author="Tony W",
author_email="[email protected]",
url="https://pypi.org/project/CSchwabPy/",
keywords=["python", "CSchwabPy", "Charles Schwab", "Stock", "Option", "Trade"],
)

0 comments on commit 9253280

Please sign in to comment.