Skip to content

Commit a7ae0a0

Browse files
committed
update pypi-publish workflow
1 parent ebc0002 commit a7ae0a0

File tree

6 files changed

+48
-43
lines changed

6 files changed

+48
-43
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,17 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
14+
- name: Install poetry
15+
run: pipx install poetry
1416
- name: Set up Python
15-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1618
with:
1719
python-version: '3.8'
18-
- name: Install and configure poetry
19-
uses: snok/install-poetry@v1
20-
with:
21-
virtualenvs-create: false
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install -U setuptools wheel twine
2620
- name: Build and publish
2721
env:
28-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
29-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
22+
PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }}
3023
run: |
31-
poetry build
32-
twine upload dist/*
24+
poetry self add poetry-version-plugin
25+
poetry config pypi-token.pypi $PYPI_TOKEN
26+
poetry publish --build

casparser/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from .__version__ import __version__
21
from .analysis import CapitalGainsReport
32
from .parsers import read_cas_pdf
43
from .types import CASData
@@ -9,3 +8,5 @@
98
"CASData",
109
"CapitalGainsReport",
1110
]
11+
12+
__version__ = "0.7.1"

casparser/__version__.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

casparser/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
from rich.prompt import Prompt
1414
from rich.table import Table
1515

16-
from . import read_cas_pdf
17-
from .__version__ import __version__
16+
from . import read_cas_pdf, __version__
1817
from .analysis.gains import CapitalGainsReport
1918
from .enums import CASFileType
2019
from .exceptions import GainsError, IncompleteCASError, ParserException

poetry.lock

Lines changed: 25 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "casparser"
3-
version = "0.7.1"
3+
version = "0" # Fetched from casparser.__init__
44
description = "(Karvy/Kfintech/CAMS) Consolidated Account Statement (CAS) PDF parser"
55
authors = ["Sandeep Somasekharan <codereverser@gmail.com>"]
66
homepage = "https://github.com/codereverser/casparser"
@@ -48,21 +48,13 @@ black = "^23.3.0"
4848
requires = ["poetry-core>=1.0.0"]
4949
build-backend = "poetry.core.masonry.api"
5050

51-
[tool.black]
52-
line-length = 100
53-
target-version = ['py38']
54-
5551
[tool.pytest.ini_options]
5652
minversion = "7.0"
5753
addopts = "--cov=casparser --cov-report=xml --cov-report=html"
5854
testpaths = [
5955
"tests",
6056
]
6157

62-
[tool.ruff]
63-
line-length = 100
64-
target-version = "py38"
65-
6658
[tool.coverage.report]
6759
omit = [
6860
"casparser/cli.py"
@@ -73,3 +65,14 @@ precision = 3
7365
omit = [
7466
"casparser/cli.py"
7567
]
68+
69+
[tool.poetry-version-plugin]
70+
source = "init"
71+
72+
[tool.black]
73+
line-length = 100
74+
target-version = ['py38']
75+
76+
[tool.ruff]
77+
line-length = 100
78+
target-version = "py38"

0 commit comments

Comments
 (0)