diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1a03a7b..29a3ba5 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -4,28 +4,41 @@ name: Upload Python Package on: - release: - types: [created] - + push: + branches: + - master jobs: deploy: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + # Issue ref: https://github.com/actions/setup-python/issues/436 + # cache: "pip" + cache-dependency-path: pyproject.toml + - uses: actions/cache@v3 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish + - name: Install build dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: pip install build + - name: Build distribution + run: python -m build + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.8.10 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" \ No newline at end of file diff --git a/tests/test_nse_live.py b/tests/test_nse_live.py index eddacc3..1b63d5b 100644 --- a/tests/test_nse_live.py +++ b/tests/test_nse_live.py @@ -22,13 +22,9 @@ def test_market_status(): def test_tick_data(): d = n.tick_data("HDFC") - assert "closePrice" in d - assert "identifier" in d assert "grapthData" in d d = n.tick_data("NIFTY 50", True) - assert "closePrice" in d assert "grapthData" in d - assert "identifier" in d def test_market_turnover(): d = n.market_turnover()