From 3df930c30e0b0c8f097d75a3be7ff7d37f88e88f Mon Sep 17 00:00:00 2001 From: Graeme Holliday Date: Wed, 25 Sep 2024 11:11:47 -0500 Subject: [PATCH] separate test and real pypi --- .github/workflows/python-publish-test.yml | 53 +++++++++++++++++++++++ .github/workflows/python-publish.yml | 34 +++------------ pyproject.toml | 4 +- tradestation/__init__.py | 2 +- 4 files changed, 61 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/python-publish-test.yml diff --git a/.github/workflows/python-publish-test.yml b/.github/workflows/python-publish-test.yml new file mode 100644 index 0000000..5baa5a4 --- /dev/null +++ b/.github/workflows/python-publish-test.yml @@ -0,0 +1,53 @@ +name: Publish Python distribution to TestPyPI + +on: + workflow_dispatch: + +jobs: + build: + name: Build distribution + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + 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-testpypi: + name: Publish Python distribution to TestPyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/tradestation + + 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 TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 345578f..2558b15 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,4 +1,4 @@ -name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI +name: Publish Python distribution to PyPI on: release: @@ -6,7 +6,7 @@ on: jobs: build: - name: Build distribution 📦 + name: Build distribution runs-on: ubuntu-latest steps: @@ -29,35 +29,11 @@ jobs: name: python-package-distributions path: dist/ - publish-to-testpypi: - name: Publish Python 🐍 distribution 📦 to TestPyPI - needs: - - build - runs-on: ubuntu-latest - - environment: - name: testpypi - url: https://test.pypi.org/p/tradestation - - 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 TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - publish-to-pypi: name: >- - Publish Python 🐍 distribution 📦 to PyPI + Publish Python distribution to PyPI needs: - - publish-to-testpypi + - build runs-on: ubuntu-latest environment: name: pypi @@ -71,5 +47,5 @@ jobs: with: name: python-package-distributions path: dist/ - - name: Publish distribution 📦 to PyPI + - name: Publish distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index 75f778c..92e01de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ [project] name = "tradestation" -version = "0.1" +version = "0.2" description = "An unofficial Python SDK for Tradestation!" readme = "README.md" -requires-python = ">=3.12" +requires-python = ">=3.10" dependencies = [ "httpx>=0.27.2", ] diff --git a/tradestation/__init__.py b/tradestation/__init__.py index 25e8216..8d3e55a 100644 --- a/tradestation/__init__.py +++ b/tradestation/__init__.py @@ -5,7 +5,7 @@ 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.1' +VERSION = '0.2' logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG)