diff --git a/python/setup.py b/python/setup.py index aff0b14671..2f2b67b6f1 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,7 +1,8 @@ # this only installs the LAMMPS python package # it assumes the LAMMPS shared library is already installed from distutils.core import setup -import os +from sys import version_info +import os,time LAMMPS_PYTHON_DIR = os.path.dirname(os.path.realpath(__file__)) LAMMPS_DIR = os.path.dirname(LAMMPS_PYTHON_DIR) @@ -12,7 +13,13 @@ def get_lammps_version(): line = f.readline() start_pos = line.find('"')+1 end_pos = line.find('"', start_pos) - return "".join(line[start_pos:end_pos].split()) + t = time.strptime("".join(line[start_pos:end_pos].split()), "%d%b%Y") + return "{}.{}.{}".format(t.tm_year,t.tm_mon,t.tm_mday) + +if version_info.major >= 3: + pkgs = ['lammps', 'lammps.mliap'] +else: + pkgs = ['lammps'] setup( name = "lammps", @@ -22,5 +29,5 @@ setup( url = "https://lammps.sandia.gov", description = "LAMMPS Molecular Dynamics Python package", license = "GPL", - packages=["lammps","lammps.mliap"], + packages=pkgs, )