# Path: setuptools_odoo/manifest.py
# MANIFEST_NAMES = ("__manifest__.py", "__openerp__.py", "__terp__.py")
# 
# class NoManifestFound(Exception):
#     pass
# 
# def parse_manifest(s):
#     return ast.literal_eval(s)
# 
# def read_manifest(addon_dir):
#     manifest_path = get_manifest_path(addon_dir)
#     if not manifest_path:
#         raise NoManifestFound("no Odoo manifest found in %s" % addon_dir)
#     with open(manifest_path) as mf:
#         return parse_manifest(mf.read())


import os
import subprocess
from pkg_resources import parse_version
from .manifest import MANIFEST_NAMES, NoManifestFound, parse_manifest, read_manifest
    * STRATEGY_99_DEVN: [8|9].0.x.y.z.99.devN
    * STRATEGY_P1_DEVN: [series].0.x.y.(z+1).devN
    * STRATEGY_DOT_N: [series].0.x.y.z.N

    Notes:

    * pip ignores .postN  by design (https://github.com/pypa/pip/issues/2872)
    * x.y.z.devN is anterior to x.y.z

    Note: we don't put the sha1 of the commit in the version number because
    this is not PEP 440 compliant and is therefore misinterpreted by pip.
    """
    addon_dir = os.path.realpath(addon_dir)
    last_version = read_manifest(addon_dir).get("version", "0.0.0")
    if strategy == STRATEGY_NONE:
        return last_version
    last_version_parsed = parse_version(last_version)
    if not is_git_controlled(addon_dir):
        return last_version
    if get_git_uncommitted(addon_dir):
        uncommitted = True
        count = 1
    else:
        uncommitted = False
        count = 0
    last_sha = None
    git_root = get_git_root(addon_dir)
    for sha in git_log_iterator(addon_dir):
        try:
            manifest = read_manifest_from_sha(sha, addon_dir, git_root)

# Path: setuptools_odoo/manifest.py
# MANIFEST_NAMES = ("__manifest__.py", "__openerp__.py", "__terp__.py")
# 
# class NoManifestFound(Exception):
#     pass
# 
# def parse_manifest(s):
#     return ast.literal_eval(s)
# 
# def read_manifest(addon_dir):
#     manifest_path = get_manifest_path(addon_dir)
#     if not manifest_path:
#         raise NoManifestFound("no Odoo manifest found in %s" % addon_dir)
#     with open(manifest_path) as mf:
#         return parse_manifest(mf.read())


# Path: setuptools_odoo/git_postversion.py
import os
import subprocess
from pkg_resources import parse_version
from .manifest import MANIFEST_NAMES, NoManifestFound, parse_manifest, read_manifest

    * STRATEGY_99_DEVN: [8|9].0.x.y.z.99.devN
    * STRATEGY_P1_DEVN: [series].0.x.y.(z+1).devN
    * STRATEGY_DOT_N: [series].0.x.y.z.N

    Notes:

    * pip ignores .postN  by design (https://github.com/pypa/pip/issues/2872)
    * x.y.z.devN is anterior to x.y.z

    Note: we don't put the sha1 of the commit in the version number because
    this is not PEP 440 compliant and is therefore misinterpreted by pip.
    """
    addon_dir = os.path.realpath(addon_dir)
    last_version = read_manifest(addon_dir).get("version", "0.0.0")
    if strategy == STRATEGY_NONE:
        return last_version
    last_version_parsed = parse_version(last_version)
    if not is_git_controlled(addon_dir):
        return last_version
    if get_git_uncommitted(addon_dir):
        uncommitted = True
        count = 1
    else:
        uncommitted = False
        count = 0
    last_sha = None
    git_root = get_git_root(addon_dir)
    for sha in git_log_iterator(addon_dir):
        try:
            manifest = read_manifest_from_sha(sha, addon_dir, git_root)

        except NoManifestFound: