Commit 70d20371 authored by Marco Govoni's avatar Marco Govoni
Browse files

Added VERSION.json

parent 0598cde6
......@@ -10,6 +10,5 @@
*.out
doc/_build/
Modules/west_version.f90
Pytools/setup.py
west_make.inc
*/__pycache__
# Makefile for the WEST software
include ./VERSION
include ../make.inc
default: all
default :
@echo "Welcome to WEST!"
@echo ' '
@echo 'to install WEST, type at the shell prompt:'
@echo ' make conf PYT=python-3'
@echo ' make [-j] target'
@echo ' '
@echo 'where target identifies one or multiple packages'
@echo ' wstat calculation of static dielectric response using PDEP'
@echo ' wfreq calculation of dynamical dielectric response and GW self-energy'
@echo ' westpp postprocessing programs'
@echo ' all same as "make wstat wfreq westpp"'
@echo ' '
@echo 'where target is one of the following operations:'
@echo ' doc build WEST documentation'
@echo ' '
@echo ' clean remove executables and objects'
@echo ' veryclean remove files produced by "configure" as well'
conf:
@[ "${PYT}" ] || ( echo ">> PYT is not set. Ex: make conf PYT=python3"; exit 1 )
@echo "# WEST_VERSION_NUMBER : ${WEST_VERSION_NUMBER}"
@echo "Welcome to WEST!"
@echo ' '
@echo "version : `${PYT} ./Pytools/read_json.py VERSION.json version`"
@echo "url : `${PYT} ./Pytools/read_json.py VERSION.json url`"
@echo "license : `${PYT} ./Pytools/read_json.py VERSION.json license`"
@echo " " > west_make.inc
@echo WESTDIR=`pwd` >> west_make.inc
@echo PYT=${PYT} >> west_make.inc
......@@ -29,7 +49,7 @@ report_build_vars :
@echo " "
@[ "${MPIF90}" ] || ( echo ">> MPIF90 is not set."; exit 1 )
@[ "${CC}" ] || ( echo ">> CC is not set."; exit 1 )
@echo "# WEST_VERSION_NUMBER : ${WEST_VERSION_NUMBER}"
@echo "# WEST_VERSION_NUMBER : `${PYT} ./Pytools/read_json.py VERSION.json version`"
@echo "# WESTDIR : ${WESTDIR}"
@echo "# FDFLAGS : ${FDFLAGS}"
@echo "# IFLAGS : ${IFLAGS}"
......@@ -100,6 +120,12 @@ wstat \
wfreq \
westpp
doc: check_conf
if test -d doc ; then \
( cd doc ; if test "$(MAKE)" = "" ; then make $(MFLAGS) html; \
else $(MAKE) $(MFLAGS) html ; fi ) ; fi
@echo 'Open the file: ${WESTDIR}/doc/_build/html/index.html'
pytools_do:
if test -d Pytools ; then \
( cd Pytools ; if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
......@@ -112,7 +138,7 @@ libraries_do:
modules_do:
if test -d Modules ; then \
( cd Modules ; sh ./update_west_version ${WESTDIR} ${WEST_VERSION_NUMBER}; \
( cd Modules ; sh ./update_west_version ${WESTDIR} `${PYT} ../Pytools/read_json.py ../VERSION.json version`; \
if test "$(MAKE)" = "" ; then make $(MFLAGS) all; \
else $(MAKE) $(MFLAGS) all ; fi ) ; fi
......
# Makefile for Modules
include ../VERSION
include ../west_make.inc
include ../../make.inc
......@@ -27,7 +26,7 @@ tldeps:
test -n "$(TLDEPS)" && ( cd ../.. ; $(MAKE) $(MFLAGS) $(TLDEPS) || exit 1) || :
update:
./update_west_version ${WESTDIR} ${WEST_VERSION_NUMBER}
./update_west_version ${WESTDIR} `${PYT} ../Pytools/read_json.py ../VERSION.json version`
libmodules.a : $(MODULES_OBJS)
$(AR) $(ARFLAGS) $@ $?
......
#PYT=python3
include ../west_make.inc
include ../VERSION
all: \
title \
install
install:
cat setup.py.in | sed "s,checkit,${WEST_VERSION_NUMBER}," > setup.py
- ${PYT} setup.py install --user --prefix= --record files.txt
clean:
......
from setuptools import setup
from setuptools import find_packages
setup(name="west",
version="checkit",
packages=find_packages(),
description='installation script for WEST',
url='https://west-code.org',
author='Marco Govoni',
author_email='mgovoni@anl.gov',
license='GPLv3',
install_requires=[
'numpy',
'scipy',
'matplotlib',
'pyyaml',
'datetime',
'setuptools'
],
python_requires='>=3.6, <4',
zip_safe=True)
WEST_VERSION_NUMBER=4.2.0p
{
"name" : "WEST",
"version" : "4.2.0p",
"url" : "http://west-code.org",
"license" : "GPLv3"
}
import sys
import os
import shlex
#import shlex
import json
import sphinx_rtd_theme
from unittest.mock import MagicMock
#from unittest.mock import MagicMock
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
if name == '_mock_methods':
return []
if name == 'version_tuple':
return (3,0)
return Mock()
#class Mock(MagicMock):
# @classmethod
# def __getattr__(cls, name):
# if name == '_mock_methods':
# return []
# if name == 'version_tuple':
# return (3,0)
# return Mock()
MOCK_MODULES = ['pymongo', 'gridfs', 'mpi4py']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
#MOCK_MODULES = ['pymongo', 'gridfs', 'mpi4py']
#sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
with open('../VERSION.json',"r") as file:
data = json.load(file)
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
......@@ -55,8 +59,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'west'
copyright = u'2019, Marco Govoni'
project = data["name"]
copyright = u'2020, Marco Govoni'
author = u'Marco Govoni'
# The version info for the project you're documenting, acts as replacement for
......@@ -64,7 +68,7 @@ author = u'Marco Govoni'
# built documents.
#
# The short X.Y version.
version = '4.1.0'
version = data["version"]
# The full version, including alpha/beta/rc tags.
release = version
......
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