Skip to content

Commit

Permalink
update pypi-publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
codereverser committed Sep 11, 2023
1 parent ebc0002 commit a7ae0a0
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 43 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install and configure poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }}
run: |
poetry build
twine upload dist/*
poetry self add poetry-version-plugin
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
3 changes: 2 additions & 1 deletion casparser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .__version__ import __version__
from .analysis import CapitalGainsReport
from .parsers import read_cas_pdf
from .types import CASData
Expand All @@ -9,3 +8,5 @@
"CASData",
"CapitalGainsReport",
]

__version__ = "0.7.1"
13 changes: 0 additions & 13 deletions casparser/__version__.py

This file was deleted.

3 changes: 1 addition & 2 deletions casparser/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
from rich.prompt import Prompt
from rich.table import Table

from . import read_cas_pdf
from .__version__ import __version__
from . import read_cas_pdf, __version__
from .analysis.gains import CapitalGainsReport
from .enums import CASFileType
from .exceptions import GainsError, IncompleteCASError, ParserException
Expand Down
29 changes: 25 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "casparser"
version = "0.7.1"
version = "0" # Fetched from casparser.__init__
description = "(Karvy/Kfintech/CAMS) Consolidated Account Statement (CAS) PDF parser"
authors = ["Sandeep Somasekharan <codereverser@gmail.com>"]
homepage = "https://github.com/codereverser/casparser"
Expand Down Expand Up @@ -48,21 +48,13 @@ black = "^23.3.0"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 100
target-version = ['py38']

[tool.pytest.ini_options]
minversion = "7.0"
addopts = "--cov=casparser --cov-report=xml --cov-report=html"
testpaths = [
"tests",
]

[tool.ruff]
line-length = 100
target-version = "py38"

[tool.coverage.report]
omit = [
"casparser/cli.py"
Expand All @@ -73,3 +65,14 @@ precision = 3
omit = [
"casparser/cli.py"
]

[tool.poetry-version-plugin]
source = "init"

[tool.black]
line-length = 100
target-version = ['py38']

[tool.ruff]
line-length = 100
target-version = "py38"

0 comments on commit a7ae0a0

Please sign in to comment.