post only if > 0
This commit is contained in:
parent
2231bd43c8
commit
fb7185d57b
4 changed files with 20 additions and 8 deletions
18
Makefile
18
Makefile
|
|
@ -1,7 +1,17 @@
|
|||
|
||||
# Get version related variables
|
||||
export DATE=$(shell date +'%Y.%m.%d')
|
||||
export REV=$(shell git rev-parse --short HEAD)
|
||||
export VERSION="$(DATE)+$(REV)"
|
||||
export DATE_COMMIT_COUNT=$(shell git rev-list --count HEAD --since=1.day)
|
||||
export COMMIT_HASH=$(shell git rev-parse --short HEAD)
|
||||
|
||||
# Set Local version to YYYY.MM.DD-<hash>
|
||||
export LOCAL_VERSION="$(DATE)+$(COMMIT_HASH)"
|
||||
|
||||
# Set PyPi version to YYYY.MM.DD or YYYY.MM.DD.postN if N > 0
|
||||
ifeq ("$(DATE_COMMIT_COUNT)", "0")
|
||||
export PYPI_VERSION="$(DATE)"
|
||||
else
|
||||
export PYPI_VERSION="$(DATE).post$(DATE_COMMIT_COUNT)"
|
||||
endif
|
||||
|
||||
lint:
|
||||
@-isort .
|
||||
|
|
@ -14,7 +24,7 @@ check_lint:
|
|||
&& pylint src/ \
|
||||
&& pydocstyle src/*
|
||||
wheel: clean
|
||||
$(shell echo "__version__ = \"$(VERSION)\"" > src/ytdl_sub/__init__.py)
|
||||
$(shell echo "__pypi_version__ = \"$(PYPI_VERSION)\"\n__local_version__ = \"$(LOCAL_VERSION)\"" > src/ytdl_sub/__init__.py)
|
||||
pip3 install build
|
||||
python3 -m build
|
||||
docker_stage: wheel
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[metadata]
|
||||
name = ytdl-sub
|
||||
version = attr:ytdl_sub.__version__
|
||||
version = attr:ytdl_sub.__pypi_version__
|
||||
author = Jesse Bannon
|
||||
description = ytdl automated with metadata creation
|
||||
author_email = use_github_issues@nope.com
|
||||
|
|
@ -50,4 +50,5 @@ docs =
|
|||
sphinx-rtd-theme==1.0.0
|
||||
build =
|
||||
build
|
||||
twine
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
__version__ = "2023.02.20+30051b1"
|
||||
__pypi_version__ = "2023.02.20"
|
||||
__local_version__ = "2023.02.20+2231bd4"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import sys
|
||||
|
||||
from ytdl_sub import __version__
|
||||
from ytdl_sub import __local_version__
|
||||
from ytdl_sub.cli.main_args_parser import parser
|
||||
from ytdl_sub.utils.exceptions import ValidationException
|
||||
from ytdl_sub.utils.logger import Logger
|
||||
|
|
@ -36,7 +36,7 @@ def main():
|
|||
"Version %s\nPlease upload the error log file '%s' and make a Github "
|
||||
"issue at https://github.com/jmbannon/ytdl-sub/issues with your config and "
|
||||
"command/subscription yaml file to reproduce. Thanks for trying ytdl-sub!",
|
||||
__version__,
|
||||
__local_version__,
|
||||
Logger.debug_log_filename(),
|
||||
)
|
||||
sys.exit(1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue