Commit 416b8c82 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Add proper (git-based) versioning.

parent 29bcb8c8
......@@ -15,3 +15,9 @@ tests-sqlalchemy/verifier/LotsOfDataTypes.asn
tests-sqlalchemy/verifier/asn2dataModel/
.mypy_cache
env
aclocal.m4
autom4te.cache/
config.log
config.status
setup.py
dmt/commonPy/__init__.py
......@@ -8,7 +8,16 @@ PY_SRC:=$(filter-out dmt/B_mappers/antlr.main.py dmt/A_mappers/Stubs.py, ${PY_SR
TYPING_FOLDER:=$(shell pip3 show typing 2>/dev/null | grep ^Location | sed 's,^.*: ,,')
export PYTHONPATH=${TYPING_FOLDER}
all: flake8 pylint mypy coverage testDB
all: tests
tests: flake8 pylint mypy coverage testDB
configure:
./configure
install: configure
pip3 uninstall -y dmt || exit 0 # Uninstall if there, but don't abort if not installed
pip3 install --user .
flake8:
@echo Performing syntax checks via flake8...
......@@ -32,4 +41,4 @@ testDB:
@echo Performing database tests...
@$(MAKE) -C tests-sqlalchemy || exit 1
.PHONY: flake8 pylint mypy coverage
.PHONY: flake8 pylint mypy coverage install configure
# Automake macro to set the revision utils
# Usage: AM_REVISION_UTILS([directory_name]).
# Directory name must be a litteral string and not the result of a
# command.
AC_DEFUN([AM_REVISION_UTILS],
[
# Take the current SVN revision
AC_MSG_CHECKING(whether this is a SCM working copy)
temp_scm_output=`(cd $srcdir; git rev-parse --short HEAD)`
if test x"${temp_scm_output}" = x""; then
# This means we are NOT working on a repository copy, the value of
# SCM_REVISION will not be taken into account.
SCM_REVISION=""
AC_MSG_RESULT(no.)
else
SCM_REVISION="r${temp_scm_output}"
AC_MSG_RESULT(yes: ${SCM_REVISION}.)
fi
AC_SUBST(SCM_REVISION)
# Take the configure full date
AC_MSG_CHECKING(the configuration full date)
temp_config_date=`LANG=C date +"%A %d %B %Y, %H:%M:%S"`
if test x"${temp_config_date}" = x""; then
LAST_CONFIG_DATE=""
AC_MSG_RESULT(empty date.)
else
LAST_CONFIG_DATE="${temp_config_date}"
AC_MSG_RESULT(${LAST_CONFIG_DATE}.)
fi
AC_SUBST(LAST_CONFIG_DATE)
# Take the configure year
AC_MSG_CHECKING(the configuration year)
temp_config_year=`LANG=C date +"%Y"`
if test x"${temp_config_year}" = x""; then
LAST_CONFIG_YEAR="2007"
AC_MSG_RESULT(no year found, fall into default: ${LAST_CONFIG_YEAR}.)
else
LAST_CONFIG_YEAR="${temp_config_year}"
AC_MSG_RESULT(${LAST_CONFIG_YEAR})
fi
AC_SUBST(LAST_CONFIG_YEAR)
])
m4_include([ac-macros/revision_utils.m4])
This diff is collapsed.
AC_INIT([DMT], [2.2], [Thanassis.Tsiodras@esa.int])
AC_CONFIG_MACRO_DIR([ac-macros])
AM_REVISION_UTILS
# Finally create all the generated files
AC_CONFIG_FILES([setup.py dmt/commonPy/__init__.py])
AC_OUTPUT
......@@ -19,7 +19,7 @@ import pkg_resources # pragma: no cover
try:
__version__ = pkg_resources.require("dmt")[0].version # pragma: no cover
except:
__version__ = "2.1.3"
__version__ = "2.2-@SCM_REVISION@"
def print_version() -> None:
......
......@@ -11,7 +11,7 @@ from setuptools import setup, find_packages
setup(
name='dmt',
version="2.1.48",
version="2.2-@SCM_REVISION@",
packages=find_packages(),
author='Thanassis Tsiodras',
author_email='Thanassis.Tsiodras@esa.int',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment