Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cicd #56

Merged
merged 4 commits into from
Nov 18, 2023
Merged

Cicd #56

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
push:
branches:
- '*'
- '!master'

jobs:
build:
runs-on: ubuntu-latest
steps:
- 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: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
41 changes: 41 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish to pypi

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
steps:
- 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/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
4 changes: 2 additions & 2 deletions jugaad_trader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

from importlib.metadata import version
from jugaad_trader import *
from jugaad_trader.zerodha import Zerodha, Console
from jugaad_trader.upstox import Upstox

__version__ = "0.19"
__version__ = version(__package__)
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "jugaad-trader"
version = "0.19"
requires-python = ">= 3.6"
authors = [{"name"= "jugaad-coder", "email"="[email protected]"}]
description = "Free Zerodha API python library"
readme = "README.rst"
license = {file = "LICENSE.YOLO.md"}
keywords = ["Zerodha", "kiteconnect", "pykiteconnect"]
dynamic = ["dependencies"]


[project.scripts]
jtrader = "jugaad_trader.cli:cli"

[project.urls]
Homepage = "https://marketsetup.in/documentation/jugaad-trader/"
Documentation = "https://marketsetup.in/documentation/jugaad-trader/"
Repository = "https://github.com/jugaad-py/jugaad-trader"
Issues = "https://github.com/jugaad-py/jugaad-trader/issues"

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
3 changes: 2 additions & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pytest
pytest
twine
3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

33 changes: 0 additions & 33 deletions setup.py

This file was deleted.