Commit 59f98a39 authored by Daniel Brown's avatar Daniel Brown

updating build procedures

parent 3d3760d4
......@@ -20,4 +20,8 @@
build
dist
bin
MANIFEST
\ No newline at end of file
MANIFEST
_version.py
conda_pkg/packages
conda_pkg/.index.json
......@@ -3,7 +3,11 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
__version__ = "1.1.0"
try:
from ._version import __version__
except ModuleNotFoundError as ex:
__version__ = "develop"
__min_req_finesse__ = 2.2
# This flag is used to switch on the gui features in pkat at import time
......
......@@ -8,16 +8,28 @@ Created on Sun Jan 27 09:43:16 2013
from distutils.core import setup
import os
import subprocess as sub
import subprocess
out, err = sub.Popen(['git','describe','--long'], stdout=sub.PIPE).communicate()
version = ".".join(out.decode('utf8').split('-')[:2])
# Fetch version from git tags, and write to version.py.
# Also, when git is not available (PyPi package), use stored version.py.
version_py = os.path.join(os.path.dirname(__file__), 'pykat', '_version.py')
try:
version_git = subprocess.check_output(["git", "describe","--long"]).decode('utf8').rstrip()
version_git = ".".join(version_git.split('-')[:2])
except:
with open(version_py, 'r') as fh:
version_git = open(version_py).read().strip().split('=')[-1].replace('"','')
version_msg = "# Do not edit this file, pipeline versioning is governed by git tags"
with open(version_py, 'w') as fh:
fh.write(version_msg + os.linesep + ("__version__=\"%s\"" % version_git))
REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
setup(
name='PyKat',
version=version,
version=version_git,
author='Daniel Brown',
author_email='ddb@star.sr.bham.ac.uk',
packages=[x[0].replace("/",".") for x in os.walk("pykat") if "__" not in x[0]],
......
  • Hi @daniel-brown,

    Not sure I understand this properly, but I suspect that you have forgotten to push the file _version.py. I get this error when importing pykat:

    Screen_Shot_2017-07-10_at_17.18.31

    Edited by Daniel Toyra
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