use setuptools_scm to handle version

This commit is contained in:
Davide Romanini 2019-09-28 14:59:36 +02:00
parent 1f7ef44556
commit 06ff25550e
7 changed files with 18 additions and 10 deletions

8
.gitignore vendored
View File

@ -3,4 +3,10 @@
/dist
*.pyc
/.vscode
venv
venv
*.o
*.a
*.so
build/
ctversion.py
.eggs

View File

@ -1,4 +1,4 @@
VERSION_STR := $(shell python -c 'import comictaggerlib.ctversion; print( comictaggerlib.ctversion.version)')
VERSION_STR := $(shell python setup.py --version)
ifeq ($(OS),Windows_NT)
OS_VERSION=win-$(PROCESSOR_ARCHITECTURE)
@ -30,6 +30,7 @@ clean:
rm -f unrar/libunrar.so unrar/libunrar.a unrar/unrar
rm -f comictaggerlib/libunrar.so
rm -rf comictaggerlib/ui/__pycache__
rm comitaggerlib/ctversion.py
pydist:
make clean
@ -53,5 +54,6 @@ else
endif
dist: unrar
pip install .
pyinstaller -y comictagger.spec
cd dist && zip -r $(FINAL_NAME).zip $(APP_NAME)

View File

@ -1,3 +0,0 @@
# This file should contain only these comments, and the line below.
# Used by packaging makefiles and app
version = "1.2.0+2"

View File

@ -1 +0,0 @@
1.2.0+2

View File

@ -5,7 +5,7 @@ TAGGER_BASE ?= ../
TAGGER_SRC := $(TAGGER_BASE)/comictaggerlib
APP_NAME := ComicTagger
VERSION_STR := $(shell grep version $(TAGGER_SRC)/ctversion.py| cut -d= -f2 | sed 's/\"//g')
VERSION_STR := $(shell python setup.py --version)
MAC_BASE := $(TAGGER_BASE)/mac
DIST_DIR := $(MAC_BASE)/dist

View File

@ -5,4 +5,4 @@ natsort==3.5.2
PyPDF2==1.24
pillow>=4.3.0
PyQt5>=5.10.1
git+https://github.com/pyinstaller/pyinstaller@develop
pyinstaller>=3.5

View File

@ -23,7 +23,6 @@ import sys
import shutil
import platform
import tempfile
import comictaggerlib.ctversion
python_requires='>=3',
@ -193,7 +192,6 @@ setup(name="comictagger",
'build_py': BuildPyCommand,
'install': customInstall,
},
version=comictaggerlib.ctversion.version,
description="A cross-platform GUI/CLI app for writing metadata to comic archives",
author="ComicTagger team",
author_email="comictagger@gmail.com",
@ -204,6 +202,12 @@ setup(name="comictagger",
},
entry_points=dict(console_scripts=['comictagger=comictaggerlib.main:ctmain']),
data_files=platform_data_files,
setup_requires=[
"setuptools_scm"
],
use_scm_version={
'write_to': 'comictaggerlib/ctversion.py'
},
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",