-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow create initial releases and pre-releases
BREAKING CHANGE: Previously `badabump` only allows to create next version if project already have a proper git tag. Now it allows to create an initial release (and pre-release) even project does not yet have any git tags available. Fixes: #15
- Loading branch information
1 parent
90ab997
commit 9bb49d1
Showing
13 changed files
with
249 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import datetime | ||
|
||
import pytest | ||
|
||
from badabump.versions.calver import CalVer, SHORT_YEAR_START | ||
|
||
UTCNOW = datetime.datetime.utcnow() | ||
|
||
YEAR = UTCNOW.year | ||
SHORT_YEAR = YEAR - SHORT_YEAR_START | ||
MONTH = UTCNOW.month | ||
DAY = UTCNOW.day | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"schema, expected", | ||
( | ||
("YY.MINOR.MICRO", f"{SHORT_YEAR}.1.0"), | ||
("YYYY.MM.DD", f"{YEAR}.{MONTH}.{DAY}"), | ||
("YYYY_MICRO", f"{YEAR}_0"), | ||
), | ||
) | ||
def test_calver_initial(schema, expected): | ||
assert CalVer.initial(schema=schema).format() == expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.