Skip to content

Commit 642e254

Browse files
committed
Add BaseVersion arg in build func
1 parent a28f492 commit 642e254

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

eggdriver/pypi.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
py -m twine check dist/*
1111
py -m twine upload dist/*
1212
"""
13-
def build(autoVersion = True):
13+
def build(autoVersion = True, baseVersion = '0.0.1a'):
1414
"""Build and upload a pypi package release"""
1515
installFromRequests(["setuptools", "twine", "build"], False)
1616
if autoVersion:
1717
setup = py.getLines("setup")
1818
firstLine = setup[0].split()
1919
v = firstLine[2]
20-
value = int(v[7:-1]) + 1
21-
v = '0.0.1a' + str(value)
20+
index = len(baseVersion) + 1
21+
value = int(v[index:-1]) + 1
22+
v = baseVersion + str(value)
2223
firstLine = [f"v = \"{v}\""]
2324
py.writeLines(firstLine + setup[1:], "setup")
2425
sysCommand("-m build --sdist")

test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
from eggdriver import Matrix, Vector, build
1010

11-
build()
12-
1311
c = Matrix("""
1412
| 1 1 2 3 4 |
1513
| 0 1 2 3 4 |

0 commit comments

Comments
 (0)