Skip to content
Snippets Groups Projects
Commit c5bc520ae788 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:pencil: include the result of pip freeze in the generated versions.rst file

And stop trying to find version of odoo, it will either not work (like in most cases),
or it will be listed in the pip freeze listing
parent 59716ef5231a
No related branches found
No related tags found
No related merge requests found
2.20
2.21
......@@ -4,6 +4,5 @@
"""
import argparse
import ConfigParser
import csv
import logging
import os
......@@ -8,8 +7,9 @@
import logging
import os
import subprocess
import sys
import yaml
_logger = logging.getLogger(__name__)
......@@ -10,8 +10,8 @@
import sys
import yaml
_logger = logging.getLogger(__name__)
__version__ = '0.1.0'
__version__ = '0.2.0'
__date__ = '2016-07-15'
......@@ -17,5 +17,5 @@
__date__ = '2016-07-15'
__updated__ = '2016-07-15'
__updated__ = '2019-06-05'
def main(argv=None): # IGNORE:C0111
......@@ -34,7 +34,7 @@
program_license = '''%s
Created by Vincent Hatakeyama on %s.
Copyright 2016 XCG Consulting. All rights reserved.
Copyright 2016, 2019 XCG Consulting. All rights reserved.
Licensed under the MIT License
......@@ -83,6 +83,7 @@
def conf2rst(basedir, directory, output=None):
"""
:param basedir: directory with the odoo_versions.csv file
:param directory: destination directory
:param output: file to write to, else prints in stdout
"""
......@@ -90,8 +91,7 @@
parser = ConfigParser.ConfigParser()
setup_path = os.path.join(directory, 'setup.cfg')
parser.read(setup_path)
odoo_type = parser.get('odoo_scripts', 'odoo_type', 'odoo8')
addon_dirs = set(
os.path.dirname(path)
for path in parser.get('odoo_scripts', 'modules').split())
......@@ -94,25 +94,11 @@
addon_dirs = set(
os.path.dirname(path)
for path in parser.get('odoo_scripts', 'modules').split())
# analyse Dockerfile if any
if 'odoo_type' != 'bzr':
dockerfile_path = os.path.join(directory, 'Dockerfile')
with open(dockerfile_path) as dockerfile_file:
for line in dockerfile_file:
if line.startswith('FROM '):
dockerbase = line[5:].strip()
_logger.info("Docker base: %s", dockerbase)
# load odoo_version.csv
versions = {}
# add path to script
with open(os.path.join(basedir, 'odoo_versions.csv')) as versions_file:
reader = csv.reader(versions_file, delimiter=',')
for line in reader:
versions[line[0]] = line[1]
if odoo_type != 'bzr':
odoo_version = versions.get(dockerbase, "Unknown")
else:
odoo_version = 'bzr'
_logger.info("Odoo version %s", odoo_version)
# pip freeze
reqs = dict()
for element in subprocess.check_output(['pip', 'freeze']).split():
library, version = element.split('==')
reqs[library] = {'version': version}
rst = {
......@@ -118,5 +104,5 @@
rst = {
'odoo': {"Odoo": {'version': odoo_version}},
'python': reqs,
'tools': {}, 'modules': {}, 'other': {}, 'group of modules': {}
}
# load the conf file
......@@ -185,7 +171,7 @@
out.write("Versions\n")
out.write("========\n\n")
for group in ('odoo', 'modules', 'group of modules', 'other', 'tools'):
for group in ('modules', 'group of modules', 'python', 'other', 'tools'):
if rst.get(group):
out.write(".. list-table:: %s\n" % group)
out.write(" :widths: 2 3\n")
......
......@@ -13,7 +13,7 @@
#
# - access to pg database
#
# Version 2.20
# Version 2.21
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
......
......@@ -4,7 +4,7 @@
isort:skip_file
"""
# Version 2.20
# Version 2.21
import argparse
import logging
import os
......
......@@ -4,7 +4,7 @@
isort:skip_file
"""
# Version 2.20
# Version 2.21
import argparse
import datetime
import json
......
......@@ -5,7 +5,7 @@
isort:skip_file
"""
# Version 2.20
# Version 2.21
import argparse
import atexit
import glob
......
odoo type,hash
bzr,7.0
xcgd/odoo:7.0,7.0 d246e36c824931613229a6467e21d65d392a2fa3
xcgd/odoo:7.0-test,7.0 a0484cbe45abb5dc393d3229ee1c6d24a4dfae23
xcgd/odoo:8.0,8.0 ba54a668d425c6b2de37428184e788552dc11a1c
xcgd/odoo:8.0-test,8.0 859fe655d295b83d86d5969e301b8f6bcc61c2d1
\ No newline at end of file
......@@ -5,7 +5,7 @@
#
# Either provide the name of the database (first argument) or it will default to <project>_test
# The DB user can be overriden by setting ODOO_SCRIPTS_DB_USER.
# Version 2.20
# Version 2.21
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
if ! type python3 > /dev/null; then
......
[bumpversion]
current_version = 2.20
current_version = 2.21
parse = (?P<major>\d+)\.(?P<minor>\d+)
serialize =
{major}.{minor}
......
......@@ -5,7 +5,7 @@
#
# You can set ODOO_DATA_DIR and ODOO_DB_HOST if you want to avoid using the default value ($HOME/var/tmp and localhost)
#
# Version 2.20
# Version 2.21
here=$(dirname $0)
project_home=$(cd $here && cd .. && echo $PWD)
if [ -x "$(command -v python3)" ];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment