diff --git a/.azure-pipelines/azure-pipelines-macos.yml b/.azure-pipelines/azure-pipelines-macos.yml index da4b3a3dd..ee288fa49 100644 --- a/.azure-pipelines/azure-pipelines-macos.yml +++ b/.azure-pipelines/azure-pipelines-macos.yml @@ -10,8 +10,8 @@ jobs: timeoutInMinutes: 360 strategy: matrix: - macos_python3.9: - python.version: '3.9' + macos_python3.11: + python.version: '3.11' steps: - task: UsePythonVersion@0 diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index d1f650562..ff8ac0b16 100644 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -10,8 +10,8 @@ jobs: timeoutInMinutes: 360 strategy: matrix: - win_python3.9: - python.version: '3.9' + win_python3.11: + python.version: '3.11' steps: - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 1caa1a840..8eb432b55 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -8,6 +8,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Required for setuptools-scm - uses: conda-incubator/setup-miniconda@v3 with: miniforge-variant: Miniforge3 @@ -20,9 +22,8 @@ jobs: - shell: bash -el {0} name: Install dependencies run: | - mamba install -y nbmake pytest-xdist line_profiler flake8 pytest - mamba install --file requirements.txt --file requirements-extra.txt - pip install -e . + mamba install -y nbmake pytest-xdist line_profiler flake8 pytest build + pip install -e .[dev] - shell: bash -el {0} name: Run pip check run: | @@ -41,7 +42,7 @@ jobs: name: Build and publish if tagged if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') run: | - python setup.py sdist + python -m build pip install twine twine upload dist/* env: diff --git a/.gitignore b/.gitignore index e3eed0d9c..114afe863 100644 --- a/.gitignore +++ b/.gitignore @@ -108,6 +108,9 @@ benchmarks/andes # generated pycode andes/pycode +# setuptools-scm generated version file +andes/_version.py + # testfile icebar diff --git a/.readthedocs.yml b/.readthedocs.yml index 87c5221ea..4c829ffa7 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -14,10 +14,7 @@ sphinx: python: install: - - requirements: requirements.txt - method: pip path: . extra_requirements: - doc - - method: setuptools - path: . diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index b8eb5c641..34eb4f328 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -97,7 +97,7 @@ Before you submit a pull request, check that it meets these guidelines: 2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst. -3. The pull request should work for Python 3.8 and up. Check +3. The pull request should work for Python 3.10 and up. Check https://github.com/curent/andes/actions and make sure that the tests pass for all supported Python versions. diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index dbb90582c..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,21 +0,0 @@ -include CONTRIBUTING.rst -include LICENSE -include README.md -include requirements.txt -include requirements-extra.txt - -recursive-exclude * __pycache__ -recursive-exclude * *.py[co] - -recursive-include andes/cases *.xlsx *.m *.raw *.dyr *.py *.json -recursive-include docs *.rst *.png conf.py Makefile make.bat -recursive-include tests *.pkl -recursive-include examples *.ipynb - -include versioneer.py -include andes/_version.py -include andes/io/psse-dyr.yaml -include andes/io/psse-modes.yaml - -# If including data files in the package, add them like: -# include path/to/data_file diff --git a/andes/__init__.py b/andes/__init__.py index b04f2d20b..2aaba36ce 100644 --- a/andes/__init__.py +++ b/andes/__init__.py @@ -1,5 +1,7 @@ -from . import _version -__version__ = _version.get_versions()['version'] +try: + from andes._version import version as __version__ +except ImportError: + __version__ = "0.0.0+unknown" from andes import io # NOQA from andes import core # NOQA diff --git a/andes/_version.py b/andes/_version.py deleted file mode 100644 index e0d8ba5aa..000000000 --- a/andes/_version.py +++ /dev/null @@ -1,658 +0,0 @@ - -# This file helps to compute a version number in source trees obtained from -# git-archive tarball (such as those provided by githubs download-from-tag -# feature). Distribution tarballs (built by setup.py sdist) and build -# directories (produced by setup.py build) will contain a much shorter file -# that just contains the computed version number. - -# This file is released into the public domain. Generated by -# versioneer-0.22 (https://github.com/python-versioneer/python-versioneer) - -"""Git implementation of _version.py.""" - -import errno -import os -import re -import subprocess -import sys -from typing import Callable, Dict -import functools - - -def get_keywords(): - """Get the keywords needed to look up the version information.""" - # these strings will be replaced by git during git-archive. - # setup.py/versioneer.py will grep for the variable names, so they must - # each be defined on a line of their own. _version.py will just call - # get_keywords(). - git_refnames = "$Format:%d$" - git_full = "$Format:%H$" - git_date = "$Format:%ci$" - keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} - return keywords - - -class VersioneerConfig: - """Container for Versioneer configuration parameters.""" - - -def get_config(): - """Create, populate and return the VersioneerConfig() object.""" - # these strings are filled in when 'setup.py versioneer' creates - # _version.py - cfg = VersioneerConfig() - cfg.VCS = "git" - cfg.style = "pep440-post" - cfg.tag_prefix = "v" - cfg.parentdir_prefix = "None" - cfg.versionfile_source = "andes/_version.py" - cfg.verbose = False - return cfg - - -class NotThisMethod(Exception): - """Exception raised if a method is not valid for the current scenario.""" - - -LONG_VERSION_PY: Dict[str, str] = {} -HANDLERS: Dict[str, Dict[str, Callable]] = {} - - -def register_vcs_handler(vcs, method): # decorator - """Create decorator to mark a method as the handler of a VCS.""" - def decorate(f): - """Store f in HANDLERS[vcs][method].""" - if vcs not in HANDLERS: - HANDLERS[vcs] = {} - HANDLERS[vcs][method] = f - return f - return decorate - - -def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, - env=None): - """Call the given command(s).""" - assert isinstance(commands, list) - process = None - - popen_kwargs = {} - if sys.platform == "win32": - # This hides the console window if pythonw.exe is used - startupinfo = subprocess.STARTUPINFO() - startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW - popen_kwargs["startupinfo"] = startupinfo - - for command in commands: - try: - dispcmd = str([command] + args) - # remember shell=False, so use git.cmd on windows, not just git - process = subprocess.Popen([command] + args, cwd=cwd, env=env, - stdout=subprocess.PIPE, - stderr=(subprocess.PIPE if hide_stderr - else None), **popen_kwargs) - break - except OSError: - e = sys.exc_info()[1] - if e.errno == errno.ENOENT: - continue - if verbose: - print("unable to run %s" % dispcmd) - print(e) - return None, None - else: - if verbose: - print("unable to find command, tried %s" % (commands,)) - return None, None - stdout = process.communicate()[0].strip().decode() - if process.returncode != 0: - if verbose: - print("unable to run %s (error)" % dispcmd) - print("stdout was %s" % stdout) - return None, process.returncode - return stdout, process.returncode - - -def versions_from_parentdir(parentdir_prefix, root, verbose): - """Try to determine the version from the parent directory name. - - Source tarballs conventionally unpack into a directory that includes both - the project name and a version string. We will also support searching up - two directory levels for an appropriately named parent directory - """ - rootdirs = [] - - for _ in range(3): - dirname = os.path.basename(root) - if dirname.startswith(parentdir_prefix): - return {"version": dirname[len(parentdir_prefix):], - "full-revisionid": None, - "dirty": False, "error": None, "date": None} - rootdirs.append(root) - root = os.path.dirname(root) # up a level - - if verbose: - print("Tried directories %s but none started with prefix %s" % - (str(rootdirs), parentdir_prefix)) - raise NotThisMethod("rootdir doesn't start with parentdir_prefix") - - -@register_vcs_handler("git", "get_keywords") -def git_get_keywords(versionfile_abs): - """Extract version information from the given file.""" - # the code embedded in _version.py can just fetch the value of these - # keywords. When used from setup.py, we don't want to import _version.py, - # so we do it with a regexp instead. This function is not used from - # _version.py. - keywords = {} - try: - with open(versionfile_abs, "r") as fobj: - for line in fobj: - if line.strip().startswith("git_refnames ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["refnames"] = mo.group(1) - if line.strip().startswith("git_full ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["full"] = mo.group(1) - if line.strip().startswith("git_date ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["date"] = mo.group(1) - except OSError: - pass - return keywords - - -@register_vcs_handler("git", "keywords") -def git_versions_from_keywords(keywords, tag_prefix, verbose): - """Get version information from git keywords.""" - if "refnames" not in keywords: - raise NotThisMethod("Short version file found") - date = keywords.get("date") - if date is not None: - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - - # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant - # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 - # -like" string, which we must then edit to make compliant), because - # it's been around since git-1.5.3, and it's too difficult to - # discover which version we're using, or to work around using an - # older one. - date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - refnames = keywords["refnames"].strip() - if refnames.startswith("$Format"): - if verbose: - print("keywords are unexpanded, not using") - raise NotThisMethod("unexpanded keywords, not a git-archive tarball") - refs = {r.strip() for r in refnames.strip("()").split(",")} - # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of - # just "foo-1.0". If we see a "tag: " prefix, prefer those. - TAG = "tag: " - tags = {r[len(TAG):] for r in refs if r.startswith(TAG)} - if not tags: - # Either we're using git < 1.8.3, or there really are no tags. We use - # a heuristic: assume all version tags have a digit. The old git %d - # expansion behaves like git log --decorate=short and strips out the - # refs/heads/ and refs/tags/ prefixes that would let us distinguish - # between branches and tags. By ignoring refnames without digits, we - # filter out many common branch names like "release" and - # "stabilization", as well as "HEAD" and "master". - tags = {r for r in refs if re.search(r'\d', r)} - if verbose: - print("discarding '%s', no digits" % ",".join(refs - tags)) - if verbose: - print("likely tags: %s" % ",".join(sorted(tags))) - for ref in sorted(tags): - # sorting will prefer e.g. "2.0" over "2.0rc1" - if ref.startswith(tag_prefix): - r = ref[len(tag_prefix):] - # Filter out refs that exactly match prefix or that don't start - # with a number once the prefix is stripped (mostly a concern - # when prefix is '') - if not re.match(r'\d', r): - continue - if verbose: - print("picking %s" % r) - return {"version": r, - "full-revisionid": keywords["full"].strip(), - "dirty": False, "error": None, - "date": date} - # no suitable tags, so version is "0+unknown", but full hex is still there - if verbose: - print("no suitable tags, using unknown + full revision id") - return {"version": "0+unknown", - "full-revisionid": keywords["full"].strip(), - "dirty": False, "error": "no suitable tags", "date": None} - - -@register_vcs_handler("git", "pieces_from_vcs") -def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): - """Get version from 'git describe' in the root of the source tree. - - This only gets called if the git-archive 'subst' keywords were *not* - expanded, and _version.py hasn't already been rewritten with a short - version string, meaning we're inside a checked out source tree. - """ - GITS = ["git"] - if sys.platform == "win32": - GITS = ["git.cmd", "git.exe"] - - # GIT_DIR can interfere with correct operation of Versioneer. - # It may be intended to be passed to the Versioneer-versioned project, - # but that should not change where we get our version from. - env = os.environ.copy() - env.pop("GIT_DIR", None) - runner = functools.partial(runner, env=env) - - _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, - hide_stderr=True) - if rc != 0: - if verbose: - print("Directory %s not under git control" % root) - raise NotThisMethod("'git rev-parse --git-dir' returned error") - - MATCH_ARGS = ["--match", "%s*" % tag_prefix] if tag_prefix else [] - - # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] - # if there isn't one, this yields HEX[-dirty] (no NUM) - describe_out, rc = runner(GITS, ["describe", "--tags", "--dirty", - "--always", "--long", *MATCH_ARGS], - cwd=root) - # --long was added in git-1.5.5 - if describe_out is None: - raise NotThisMethod("'git describe' failed") - describe_out = describe_out.strip() - full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root) - if full_out is None: - raise NotThisMethod("'git rev-parse' failed") - full_out = full_out.strip() - - pieces = {} - pieces["long"] = full_out - pieces["short"] = full_out[:7] # maybe improved later - pieces["error"] = None - - branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], - cwd=root) - # --abbrev-ref was added in git-1.6.3 - if rc != 0 or branch_name is None: - raise NotThisMethod("'git rev-parse --abbrev-ref' returned error") - branch_name = branch_name.strip() - - if branch_name == "HEAD": - # If we aren't exactly on a branch, pick a branch which represents - # the current commit. If all else fails, we are on a branchless - # commit. - branches, rc = runner(GITS, ["branch", "--contains"], cwd=root) - # --contains was added in git-1.5.4 - if rc != 0 or branches is None: - raise NotThisMethod("'git branch --contains' returned error") - branches = branches.split("\n") - - # Remove the first line if we're running detached - if "(" in branches[0]: - branches.pop(0) - - # Strip off the leading "* " from the list of branches. - branches = [branch[2:] for branch in branches] - if "master" in branches: - branch_name = "master" - elif not branches: - branch_name = None - else: - # Pick the first branch that is returned. Good or bad. - branch_name = branches[0] - - pieces["branch"] = branch_name - - # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] - # TAG might have hyphens. - git_describe = describe_out - - # look for -dirty suffix - dirty = git_describe.endswith("-dirty") - pieces["dirty"] = dirty - if dirty: - git_describe = git_describe[:git_describe.rindex("-dirty")] - - # now we have TAG-NUM-gHEX or HEX - - if "-" in git_describe: - # TAG-NUM-gHEX - mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) - if not mo: - # unparsable. Maybe git-describe is misbehaving? - pieces["error"] = ("unable to parse git-describe output: '%s'" - % describe_out) - return pieces - - # tag - full_tag = mo.group(1) - if not full_tag.startswith(tag_prefix): - if verbose: - fmt = "tag '%s' doesn't start with prefix '%s'" - print(fmt % (full_tag, tag_prefix)) - pieces["error"] = ("tag '%s' doesn't start with prefix '%s'" - % (full_tag, tag_prefix)) - return pieces - pieces["closest-tag"] = full_tag[len(tag_prefix):] - - # distance: number of commits since tag - pieces["distance"] = int(mo.group(2)) - - # commit: short hex revision ID - pieces["short"] = mo.group(3) - - else: - # HEX: no tags - pieces["closest-tag"] = None - count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root) - pieces["distance"] = int(count_out) # total number of commits - - # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = runner(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - - return pieces - - -def plus_or_dot(pieces): - """Return a + if we don't already have one, else return a .""" - if "+" in pieces.get("closest-tag", ""): - return "." - return "+" - - -def render_pep440(pieces): - """Build up version string, with post-release "local version identifier". - - Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you - get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty - - Exceptions: - 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += plus_or_dot(pieces) - rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0+untagged.%d.g%s" % (pieces["distance"], - pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_branch(pieces): - """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] . - - The ".dev0" means not master branch. Note that .dev0 sorts backwards - (a feature branch will appear "older" than the master branch). - - Exceptions: - 1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0" - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+untagged.%d.g%s" % (pieces["distance"], - pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def pep440_split_post(ver): - """Split pep440 version string at the post-release segment. - - Returns the release segments before the post-release and the - post-release version number (or -1 if no post-release segment is present). - """ - vc = str.split(ver, ".post") - return vc[0], int(vc[1] or 0) if len(vc) == 2 else None - - -def render_pep440_pre(pieces): - """TAG[.postN.devDISTANCE] -- No -dirty. - - Exceptions: - 1: no tags. 0.post0.devDISTANCE - """ - if pieces["closest-tag"]: - if pieces["distance"]: - # update the post release segment - tag_version, post_version = pep440_split_post(pieces["closest-tag"]) - rendered = tag_version - if post_version is not None: - rendered += ".post%d.dev%d" % (post_version+1, pieces["distance"]) - else: - rendered += ".post0.dev%d" % (pieces["distance"]) - else: - # no commits, use the tag as the version - rendered = pieces["closest-tag"] - else: - # exception #1 - rendered = "0.post0.dev%d" % pieces["distance"] - return rendered - - -def render_pep440_post(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX] . - - The ".dev0" means dirty. Note that .dev0 sorts backwards - (a dirty tree will appear "older" than the corresponding clean one), - but you shouldn't be releasing software with -dirty anyways. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%s" % pieces["short"] - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += "+g%s" % pieces["short"] - return rendered - - -def render_pep440_post_branch(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . - - The ".dev0" means not master branch. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%s" % pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+g%s" % pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_old(pieces): - """TAG[.postDISTANCE[.dev0]] . - - The ".dev0" means dirty. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - return rendered - - -def render_git_describe(pieces): - """TAG[-DISTANCE-gHEX][-dirty]. - - Like 'git describe --tags --dirty --always'. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"]: - rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render_git_describe_long(pieces): - """TAG-DISTANCE-gHEX[-dirty]. - - Like 'git describe --tags --dirty --always -long'. - The distance/hash is unconditional. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render(pieces, style): - """Render the given version pieces into the requested style.""" - if pieces["error"]: - return {"version": "unknown", - "full-revisionid": pieces.get("long"), - "dirty": None, - "error": pieces["error"], - "date": None} - - if not style or style == "default": - style = "pep440" # the default - - if style == "pep440": - rendered = render_pep440(pieces) - elif style == "pep440-branch": - rendered = render_pep440_branch(pieces) - elif style == "pep440-pre": - rendered = render_pep440_pre(pieces) - elif style == "pep440-post": - rendered = render_pep440_post(pieces) - elif style == "pep440-post-branch": - rendered = render_pep440_post_branch(pieces) - elif style == "pep440-old": - rendered = render_pep440_old(pieces) - elif style == "git-describe": - rendered = render_git_describe(pieces) - elif style == "git-describe-long": - rendered = render_git_describe_long(pieces) - else: - raise ValueError("unknown style '%s'" % style) - - return {"version": rendered, "full-revisionid": pieces["long"], - "dirty": pieces["dirty"], "error": None, - "date": pieces.get("date")} - - -def get_versions(): - """Get version information or return default if unable to do so.""" - # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have - # __file__, we can work backwards from there to the root. Some - # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which - # case we can only use expanded keywords. - - cfg = get_config() - verbose = cfg.verbose - - try: - return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, - verbose) - except NotThisMethod: - pass - - try: - root = os.path.realpath(__file__) - # versionfile_source is the relative path from the top of the source - # tree (where the .git directory might live) to this file. Invert - # this to find the root from __file__. - for _ in cfg.versionfile_source.split('/'): - root = os.path.dirname(root) - except NameError: - return {"version": "0+unknown", "full-revisionid": None, - "dirty": None, - "error": "unable to find root of source tree", - "date": None} - - try: - pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) - return render(pieces, cfg.style) - except NotThisMethod: - pass - - try: - if cfg.parentdir_prefix: - return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) - except NotThisMethod: - pass - - return {"version": "0+unknown", "full-revisionid": None, - "dirty": None, - "error": "unable to compute version", "date": None} diff --git a/andes/io/psse.py b/andes/io/psse.py index 30a055628..530a15586 100644 --- a/andes/io/psse.py +++ b/andes/io/psse.py @@ -64,6 +64,100 @@ def get_block_lines(b, mdata): return line_counts[b] +def _parse_csv_with_quotes(line): + """ + Parse a line of PSS/E data that may contain single-quoted strings with commas or slashes. + + Parameters + ---------- + line : str + A line from a PSS/E file that needs parsing + + Returns + ------- + list + List of values with quoted strings preserved as single elements + """ + # Initialize result list and variables + result = [] + current = "" + in_quotes = False + + # Handle empty input + if not line: + return [""] + + # Process each character + for char in line: + if char == "'" and not in_quotes: + # Starting quotes + in_quotes = True + current += char + elif char == "'" and in_quotes: + # Ending quotes + in_quotes = False + current += char + elif char == ',' and not in_quotes: + # Field separator outside quotes + result.append(current) + current = "" + else: + # Add character to current field + current += char + + # Add the last field + result.append(current) + + # Process each field to remove quotes and strip whitespace + for i in range(len(result)): + field = result[i] + # Remove quotes and strip + if field and len(field) >= 2 and field[0] == "'" and field[-1] == "'": + field = field[1:-1] + result[i] = field.strip() + + return result + + +def _split_line_with_quoted_parts(line, separator='/'): + """ + Split a line by a separator character, but preserve the separator inside quoted strings. + + Parameters + ---------- + line : str + Line to split + separator : str + Character to split by, defaults to '/' + + Returns + ------- + list + List of parts + """ + result = [] + current = "" + in_quotes = False + + for char in line: + if char == "'" and not in_quotes: + in_quotes = True + current += char + elif char == "'" and in_quotes: + in_quotes = False + current += char + elif char == separator and not in_quotes: + result.append(current) + current = "" + else: + current += char + + if current: + result.append(current) + + return result + + def read(system, file): """ Read PSS/E RAW file v32/v33 formats. @@ -96,8 +190,8 @@ def read(system, file): line = line.strip() # get basemva and nominal frequency if num == 0: - data = line.split('/')[0] - data = data.split(',') + parts = _split_line_with_quoted_parts(line) + data = _parse_csv_with_quotes(parts[0]) mva = float(data[1]) system.config.mva = mva @@ -128,7 +222,8 @@ def read(system, file): continue elif line[0] == 'Q': # end of file break - data = line.split(',') + parts = _split_line_with_quoted_parts(line) + data = _parse_csv_with_quotes(parts[0]) data = [to_number(item) for item in data] mdata.append(data) @@ -188,6 +283,7 @@ def _read_dyr_dict(file): dyr_dict = dict() # input data from dyr file for psse_model, all_rows in input_concat_dict.items(): + # DYR files are space-separated, not comma-separated dev_params_num = [([to_number(cell) for cell in row.split()]) for row in all_rows] dyr_dict[psse_model] = pd.DataFrame(dev_params_num) @@ -336,7 +432,6 @@ def _parse_bus_v33(raw, system): sw = dict() for data in raw['bus']: - idx = data[0] bus_idx_list.append(idx) ty = data[3] @@ -425,7 +520,7 @@ def _parse_gen_v33(raw, system, sw): gen_mva = data[8] gen_idx += 1 status = data[14] - wmod = data[26] if len(data) >= 26 else 0 + wmod = data[26] if len(data) > 26 else 0 param = {'Sn': gen_mva, 'Vn': vn, 'u': status, 'bus': bus, 'subidx': subidx, @@ -490,7 +585,6 @@ def _parse_transf_v33(raw, system, max_bus): # # """ - Sn = system.config.mva bus_Vn1 = system.Bus.get(src='Vn', idx=data[0][0], attr='v') bus_Vn2 = system.Bus.get(src='Vn', idx=data[0][1], attr='v') @@ -514,12 +608,69 @@ def _parse_transf_v33(raw, system, max_bus): Sn = system.config.mva elif data[0][5] == 2: Sn = data[1][2] + elif data[0][5] == 3: + # CZ=3: Load loss & |Z| + # Convert power loss and impedance magnitude to R and X on winding base + Sn = data[1][2] # Use winding base MVA + + # Convert load loss (W) to R (pu on winding base) + # R = W / (SBASE_winding * 1e6) + r_pu_wb = data[1][0] / (Sn * 1e6) + + # Calculate X from |Z| and R: X = sqrt(|Z|^2 - R^2) + # Handle numeric issues - ensure we don't get imaginary numbers + if data[1][1]**2 > r_pu_wb**2: + x_pu_wb = (data[1][1]**2 - r_pu_wb**2)**0.5 + else: + # If |Z| is too small compared to R, assume X is very small + logger.warning(f"Branch {data[0][0]}-{data[0][1]}:") + logger.warning(" CZ=3 conversion issue: |Z|^2 < R^2. Setting X to small value.") + x_pu_wb = 1e-6 + + # Replace the data[1][0] and data[1][1] with calculated R and X + data[1][0] = r_pu_wb + data[1][1] = x_pu_wb + + # Now it's in CZ=2 format and will be processed accordingly else: - logger.warning('Impedance code 3 not implemented') + logger.warning('Unknown impedance code %s', data[0][5]) # CM - Y code, 1-system base, 2-No load loss and exc. loss if data[0][6] == 2: - logger.warning('Admittance code 2 not implemented') + # CM=2: No load loss & exc. loss + mag1 = data[0][7] # No-load loss in watts + mag2 = data[0][8] # Excitation current in pu + + # Vbase for winding 1 (kV) + Vn1 = data[2][1] if data[2][1] != 0.0 else bus_Vn1 + + # Step 1: Convert power loss to conductance (G) in Siemens + # G [S] = MAG1 / VNOM1_kV^2 / 1e6 + g_s = mag1 / (Vn1 **2) / 1e6 + + # Step 2: Calculate B in Siemens from excitation current + # First convert excitation current to |Y| in Siemens + y_mag_s = abs(mag2) * system.config.mva / (Vn1**2) + + # B [S] = sqrt(|Y|^2 - G^2) + # Handle numeric issues + if y_mag_s**2 > g_s**2: + b_s = (y_mag_s**2 - g_s**2)**0.5 + logger.info(f"CM=2 Conversion ok: G={g_s}, B={b_s}") + else: + # If |Y| is too small compared to G, assume B is very small + logger.warning("CM=2 conversion issue: |Y|^2 < G^2. Setting B to small value.") + b_s = 1e-6 + + # Convert back to per unit on system base + g_pu = g_s * (Vn1**2) / system.config.mva + b_pu = b_s * (Vn1**2) / system.config.mva + + # Replace MAG1 and MAG2 with calculated G and B in pu + data[0][7] = g_pu + data[0][8] = b_pu + elif data[0][6] != 1: + logger.warning('Unknown magnetizing admittance code %s', data[0][6]) param = {'bus1': data[0][0], 'bus2': data[0][1], @@ -548,12 +699,23 @@ def _parse_transf_v33(raw, system, max_bus): # WINDV2, NOMV2, ANG2, RATA2, BATB2, RATC2, COD2, CONT2, RMA2, RMI2, VMA2, VMI2, NTP2, TAB2, CR2, CX2 # WINDV3, NOMV3, ANG3, RATA3, BATB3, RATC3, COD3, CONT3, RMA3, RMI3, VMA3, VMI3, NTP3, TAB3, CR3, CX3 + # Process CZ=3 and CM=2 for 3-winding transformers + if data[0][5] == 3: # CZ=3 + data = _process_3wt_cz3(data, system) + # After processing, treat this as CZ=2 + data[0][5] = 2 + + if data[0][6] == 2: # CM=2 + data = _process_3wt_cm2(data, system) + # After processing, treat this as CM=1 + data[0][6] = 1 + new_bus = data[0][2] + 1 if new_bus in system.Bus.idx.v: new_bus = max_bus + xf_3_count - logger.warning('Added bus <%s> for 3-winding transformer <%s-%s-%s>', - new_bus, data[0][0], data[0][1], data[0][2]) + logger.debug('Added bus <%s> for 3-winding transformer <%s-%s-%s>', + new_bus, data[0][0], data[0][1], data[0][2]) # Assign `area`, `owner`, and `zone` using the high-voltage side bus values high_voltage_bus = data[0][0] @@ -573,27 +735,60 @@ def _parse_transf_v33(raw, system, max_bus): out['Bus'].append(param) + # Get the original impedance values + r_12 = data[1][0] + x_12 = data[1][1] + r_23 = data[1][3] + x_23 = data[1][4] + r_31 = data[1][6] + x_31 = data[1][7] + + # Convert to system base if CZ=2 + if data[0][5] == 2: + # Convert from winding base to system base + sbase = system.config.mva + r_12 = r_12 * sbase / data[1][2] # SBASE1-2 + x_12 = x_12 * sbase / data[1][2] + r_23 = r_23 * sbase / data[1][5] # SBASE2-3 + x_23 = x_23 * sbase / data[1][5] + r_31 = r_31 * sbase / data[1][8] # SBASE3-1 + x_31 = x_31 * sbase / data[1][8] + + # Calculate star-point resistances and reactances + # These values are on system base after the conversion above r = [] x = [] - r.append((data[1][0] + data[1][6] - data[1][3])/2) - r.append((data[1][3] + data[1][0] - data[1][6])/2) - r.append((data[1][6] + data[1][3] - data[1][0])/2) - x.append((data[1][1] + data[1][7] - data[1][4])/2) - x.append((data[1][4] + data[1][1] - data[1][7])/2) - x.append((data[1][7] + data[1][4] - data[1][1])/2) + r.append((r_12 + r_31 - r_23)/2) + r.append((r_23 + r_12 - r_31)/2) + r.append((r_31 + r_23 - r_12)/2) + x.append((x_12 + x_31 - x_23)/2) + x.append((x_23 + x_12 - x_31)/2) + x.append((x_31 + x_23 - x_12)/2) for i in range(0, 3): + # Always use system base after conversion + Sn = system.config.mva + + # Set magnetizing conductance and susceptance for winding 1 only (first branch) + if i == 0: + g1_value = data[0][7] # Magnetizing conductance (G) + b1_value = data[0][8] # Magnetizing susceptance (B) + else: + g1_value = 0.0 # No magnetization for other windings + b1_value = 0.0 # No magnetization for other windings + param = {'trans': True, 'bus1': data[0][i], 'bus2': new_bus, - 'u': data[0][11], - 'b': data[0][8], + 'g1': g1_value, + 'b1': b1_value, 'r': r[i], 'x': x[i], 'tap': data[2+i][0], 'phi': data[2+i][2] * deg2rad, 'Vn1': system.Bus.get(src='Vn', idx=data[0][i], attr='v'), 'Vn2': 1.0, + 'Sn': Sn, } out['Line'].append(param) @@ -715,3 +910,113 @@ def sort_psse_models(dyr_yaml, system): nodep_models.append(item) return nodep_models + sequence + + +def _process_3wt_cz3(data, system): + """ + Process 3-winding transformer data with CZ=3 (Load loss & |Z|). + + Converts power loss (W) and impedance magnitude to R and X on winding base (CZ=2). + + Parameters + ---------- + data : list + Multi-line transformer data + system : System + The ANDES system object + + Returns + ------- + list + Updated data with converted R and X values + """ + # For each winding pair, convert load loss and |Z| to R and X + # Winding pairs are 1-2, 2-3, and 3-1 + sbase = [data[1][2], data[1][5], data[1][8]] # SBASE1-2, SBASE2-3, SBASE3-1 + + # Data indices for each winding pair + indices = [ + (0, 1), # R1-2, X1-2 indices + (3, 4), # R2-3, X2-3 indices + (6, 7), # R3-1, X3-1 indices + ] + + for i, (loss_idx, z_idx) in enumerate(indices): + # Load loss in watts + loss = data[1][loss_idx] + # |Z| in pu on winding base + z_mag = data[1][z_idx] + + # Convert load loss to R in pu on winding base + r_pu = loss / (sbase[i] * 1e6) + + # Calculate X from |Z| and R: X = sqrt(|Z|^2 - R^2) + # Handle numeric issues - ensure we don't get imaginary numbers + if z_mag**2 > r_pu**2: + x_pu = (z_mag**2 - r_pu**2)**0.5 + else: + # If |Z| is too small compared to R, assume X is very small + logger.warning(f"CZ=3 conversion issue: |Z|^2 < R^2 for winding pair {i+1}. Setting X to small value.") + x_pu = 1e-6 + + # Replace the original values with calculated R and X + data[1][loss_idx] = r_pu + data[1][z_idx] = x_pu + + return data + + +def _process_3wt_cm2(data, system): + """ + Process 3-winding transformer data with CM=2 (No load loss & exc. loss). + + Converts no-load loss and excitation current to G and B on system base (CM=1). + + Parameters + ---------- + data : list + Multi-line transformer data + system : System + The ANDES system object + + Returns + ------- + list + Updated data with converted G and B values + """ + # Get no-load loss in watts and excitation current in pu + mag1 = data[0][7] # No-load loss in watts + mag2 = data[0][8] # Excitation current in pu + + # Get the rated voltage of winding 1 (kV) + Vn1 = data[2][1] if data[2][1] != 0.0 else system.Bus.get(src='Vn', idx=data[0][0], attr='v') + + # Convert power loss to conductance (G) in Siemens + # G [S] = MAG1 / VNOM1_V^2 / 1e6 + g_s = mag1 / (Vn1 **2) / 1e6 + + # Convert |Y| pu to actual in Siemens + # |Y| [S] = |MAG2| * SBASE_MVA / NOMV1_kV^2 + y_mag_s = abs(mag2) * system.config.mva / (Vn1**2) + + # Calculate B in Siemens + # B [S] = sqrt(|Y|^2 - G^2) + # Handle numeric issues + if y_mag_s**2 > g_s**2: + b_s = (y_mag_s**2 - g_s**2)**0.5 + logger.info(f"CM=2 Conversion ok: G={g_s}, B={b_s}") + else: + # If |Y| is too small compared to G, assume B is very small + logger.warning(f"Branch {data[0][0]}-{data[0][1]}-{data[0][2]}:") + logger.warning(" CM=2 conversion issue: |Y|^2 < G^2. Setting B to small value.") + b_s = 1e-6 + + # Convert G and B to per unit on system base + g_pu = g_s * (Vn1**2) / system.config.mva + b_pu = b_s * (Vn1**2) / system.config.mva + + # Replace MAG1 and MAG2 with calculated G and B in pu + data[0][7] = g_pu + data[0][8] = b_pu + + return data diff --git a/andes/main.py b/andes/main.py index 59dce962b..4e033215e 100644 --- a/andes/main.py +++ b/andes/main.py @@ -28,8 +28,6 @@ from time import sleep from typing import Optional, Union -from ._version import get_versions - import andes from andes.routines import routine_cli from andes.shared import Pool, Process, coloredlogs, unittest, NCPUS_PHYSICAL @@ -869,7 +867,7 @@ def versioninfo(): import kvxopt versions = {'Python': platform.python_version(), - 'andes': get_versions()['version'], + 'andes': andes.__version__, 'numpy': np.__version__, 'kvxopt': kvxopt.__version__, 'sympy': sympy.__version__, diff --git a/andes/system.py b/andes/system.py index 00682baac..11092a983 100644 --- a/andes/system.py +++ b/andes/system.py @@ -1348,7 +1348,8 @@ def connectivity(self, info=True): lg_island = item lg_bus_idx = [self.Bus.idx.v[ii] for ii in lg_island] - self.SynGen.store_idx_island(lg_bus_idx) + if self.SynGen.n > 0: # only do when there is at least one SynGen + self.SynGen.store_idx_island(lg_bus_idx) if info is True: self.summary() diff --git a/docs/source/getting_started/install.rst b/docs/source/getting_started/install.rst index 64cbcbb34..ee2d76196 100644 --- a/docs/source/getting_started/install.rst +++ b/docs/source/getting_started/install.rst @@ -43,7 +43,7 @@ Create an environment for ANDES (recommended) .. code:: bash - mamba create --name andes python=3.8 + mamba create --name andes python=3.11 Activate the new environment with @@ -92,8 +92,8 @@ To install all extra packages, do: pip install andes[all] -One can also inspect the ``requirements-extra.txt`` to identify the packages -for manual installation. +One can also inspect the ``[project.optional-dependencies]`` section in +``pyproject.toml`` to identify the packages for manual installation. .. _Develop Install: @@ -126,26 +126,12 @@ pushing back code edits will require significant manual efforts. .. _`Step 2`: -Step 2: Install dependencies +Step 2: Install ANDES in development mode In the Mambaforge environment, use ``cd`` to change directory to the ANDES root folder. -The folder should contain the ``setup.py`` file. +The folder should contain the ``pyproject.toml`` file. -Install dependencies with - -.. code:: bash - - mamba install --file requirements.txt - mamba install --file requirements-extra.txt - -Alternatively, you can install them with ``pip``: - -.. code:: bash - - pip install -r requirements.txt - pip install -r requirements-extra.txt - -Step 3: Install ANDES in the development mode using +Install ANDES in development mode with all dependencies using .. code:: bash @@ -155,21 +141,17 @@ Note the dot at the end. Pip will take care of the rest. .. note:: - The ANDES version number shown in ``pip list`` - will stuck at the version that was intalled, unless - ANDES is develop-installed again. - It will not update automatically with ``git pull``. + ANDES uses ``setuptools-scm`` for versioning based on git tags. + The version will update automatically when you ``git pull`` new changes. - To check the latest version number, check the preamble - by running the ``andes`` command or chek the output of + To check the version, run ``andes`` or ``python -c "import andes; print(andes.__version__)"`` .. note:: - ANDES updates may infrequently introduce new package - requirements. If you see an ``ImportError`` after updating - ANDES, you can manually install the missing dependencies - or redo `Step 2`_. + ANDES updates may infrequently introduce new package requirements. + If you see an ``ImportError`` after updating, reinstall with + ``pip install -e .`` to get the new dependencies. .. note:: diff --git a/docs/source/release-notes.rst b/docs/source/release-notes.rst index 5a10ff474..3acc307d1 100644 --- a/docs/source/release-notes.rst +++ b/docs/source/release-notes.rst @@ -15,6 +15,10 @@ v1.9.4 (2025-xx-xx) list. - Fix a bug in line model that causes incorrect admittance matrix. - Correct a typo in the PSSE DYR parser, changing "Tprod" to "Tpord". +- Fix a bug in PSSE RAW parser in incorrect handling of 3WT. Also fixes issue in + handling quoted strings with commas and slashes. +- Add a demo ``QSTS.ipynb`` to show how to run QSTS simulation in ANDES. + See folder ``andes/examples/demonstration``. v1.9.3 (2025-01-05) ------------------- diff --git a/examples/demonstration/QSTS.ipynb b/examples/demonstration/QSTS.ipynb new file mode 100644 index 000000000..c03ddc42e --- /dev/null +++ b/examples/demonstration/QSTS.ipynb @@ -0,0 +1,394 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "fb2cbd84", + "metadata": {}, + "source": [ + "# Quasi-Static Time Series (QSTS) Simulation" + ] + }, + { + "cell_type": "markdown", + "id": "7a4fd192", + "metadata": {}, + "source": [ + "In ANDES, QSTS can be done when there is no dynamic models in the system.\n", + "Then the time-domain simulation (TDS) is a series of steady-state AC power flow.\n", + "\n", + "Along with model `TimeSeries`, voltage profiles under generation and load fluctuations\n", + "can be assessed more efficiently compared to full-order electro-mechanical transient\n", + "simulation." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "64e9ef69", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "\n", + "import andes" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "a60617c8", + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib inline" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "c121d20b", + "metadata": {}, + "outputs": [], + "source": [ + "andes.config_logger(20)" + ] + }, + { + "cell_type": "markdown", + "id": "c7d9d28d", + "metadata": {}, + "source": [ + "We add a sample TimeSeries file to mimic the active load fluctuation." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "ab4a8441", + "metadata": {}, + "outputs": [], + "source": [ + "data = {\n", + " \"t\": list(range(1, 20)),\n", + " \"p\": list(0.076 + 0.005 * i for i in range(19)),\n", + " \"q\": [0.016] * 19,\n", + "}\n", + "\n", + "df = pd.DataFrame(data)\n", + "df.to_excel(\"./pqts0.xlsx\", sheet_name=\"PQTS\", index=False)" + ] + }, + { + "cell_type": "markdown", + "id": "b2d0a1f5", + "metadata": {}, + "source": [ + "`s0` is a case with only power flow models.\n", + "\n", + "For comparison, `s1` that has dynamic models is also simulated." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "d4566c00", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Working directory: \"/Users/jinningwang/work/andes/icebar/qsts\"\n", + "> Loaded generated Python code in \"/Users/jinningwang/.andes/pycode\".\n", + "Generated code for is stale.\n", + "Numerical code generation (rapid incremental mode) started...\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Generating code for 1 models on 12 processes.\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Saved generated pycode to \"/Users/jinningwang/.andes/pycode\"\n", + "> Reloaded generated Python code of module \"pycode\".\n", + "Generated numerical code for 1 models in 0.1099 seconds.\n", + "Parsing input file \"/Users/jinningwang/work/andes/andes/cases/ieee14/ieee14.raw\"...\n", + " IEEE 14 BUS TEST CASE\n", + " 03/06/14 CONTO 100.0 1962 W\n", + "Input file parsed in 0.0058 seconds.\n", + "Working directory: \"/Users/jinningwang/work/andes/icebar/qsts\"\n", + "> Reloaded generated Python code of module \"pycode\".\n", + "Generated code for is stale.\n", + "Numerical code generation (rapid incremental mode) started...\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Generating code for 1 models on 12 processes.\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Saved generated pycode to \"/Users/jinningwang/.andes/pycode\"\n", + "> Reloaded generated Python code of module \"pycode\".\n", + "Generated numerical code for 1 models in 0.1780 seconds.\n", + "Parsing input file \"/Users/jinningwang/work/andes/andes/cases/ieee14/ieee14.raw\"...\n", + " IEEE 14 BUS TEST CASE\n", + " 03/06/14 CONTO 100.0 1962 W\n", + "Input file parsed in 0.0053 seconds.\n", + "Parsing additional file \"/Users/jinningwang/work/andes/andes/cases/ieee14/ieee14.dyr\"...\n", + "Addfile parsed in 0.0456 seconds.\n", + "Read timeseries data from \"/Users/jinningwang/work/andes/icebar/qsts/pqts0.xlsx\"\n", + "System internal structure set up in 0.1000 seconds.\n", + "Read timeseries data from \"/Users/jinningwang/work/andes/icebar/qsts/pqts0.xlsx\"\n", + "IEEEST added BusFreq linked to bus <3.0>\n", + "ST2CUT added BusFreq linked to bus <1.0>\n", + "ST2CUT added BusFreq linked to bus <2.0>\n", + "System internal structure set up in 0.0216 seconds.\n" + ] + } + ], + "source": [ + "s0 = andes.load(andes.get_case('ieee14/ieee14.raw'),\n", + " default_config=True,\n", + " setup=False,\n", + " no_output=True,\n", + " )\n", + "s1 = andes.load(andes.get_case('ieee14/ieee14.raw'),\n", + " addfile = andes.get_case('ieee14/ieee14.dyr'),\n", + " default_config=True,\n", + " setup=False,\n", + " no_output=True,\n", + " )\n", + "\n", + "s1.Toggle.set(src='u', attr='v',\n", + " idx=['Toggle_1', 'Toggle_2'], value=[0, 0])\n", + "\n", + "for ss in [s0, s1]:\n", + " \n", + " ss.add('TimeSeries',\n", + " param_dict={\n", + " 'idx': 1,\n", + " 'name': 'TimeSeries_1',\n", + " 'path': os.getcwd() + '/pqts0.xlsx',\n", + " 'sheet': 'PQTS',\n", + " 'fields': 'p,q',\n", + " 'tkey': 't',\n", + " 'model': 'PQ',\n", + " 'dev': 'PQ_4',\n", + " 'dests': 'Ppf,Qpf',\n", + " })\n", + "\n", + " ss.setup()\n", + "\n", + " # use constant power model for PQ\n", + " ss.PQ.config.p2p = 1\n", + " ss.PQ.config.q2q = 1\n", + " ss.PQ.config.p2z = 0\n", + " ss.PQ.config.q2z = 0\n", + "\n", + " ss.TDS.config.no_tqdm = True" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "68b15c0b", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "-> System connectivity check results:\n", + " No islanded bus detected.\n", + " System is interconnected.\n", + " Each island has a slack bus correctly defined and enabled.\n", + "\n", + "-> Power flow calculation\n", + " Numba: Off\n", + " Sparse solver: KLU\n", + " Solution method: NR method\n", + "Power flow initialized in 0.0028 seconds.\n", + "0: |F(x)| = 0.5605182134\n", + "1: |F(x)| = 0.006202200332\n", + "2: |F(x)| = 5.819382827e-06\n", + "3: |F(x)| = 6.957087684e-12\n", + "Converged in 4 iterations in 0.0026 seconds.\n", + "-> System connectivity check results:\n", + " No islanded bus detected.\n", + " System is interconnected.\n", + " Each island has a slack bus correctly defined and enabled.\n", + "\n", + "-> Power flow calculation\n", + " Numba: Off\n", + " Sparse solver: KLU\n", + " Solution method: NR method\n", + "Power flow initialized in 0.0027 seconds.\n", + "0: |F(x)| = 0.5605182134\n", + "1: |F(x)| = 0.006202200332\n", + "2: |F(x)| = 5.819382827e-06\n", + "3: |F(x)| = 6.957087684e-12\n", + "Converged in 4 iterations in 0.0026 seconds.\n" + ] + } + ], + "source": [ + "for ss in [s0, s1]:\n", + " ss.PFlow.run()" + ] + }, + { + "cell_type": "markdown", + "id": "bf9f6ac5", + "metadata": {}, + "source": [ + "We can see the QSTS runs much faster than the electro-mechanical transient simulation." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "fa5b8082", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Initialization for dynamics completed in 0.0092 seconds.\n", + "Initialization was successful.\n", + "Simulation to t=20.00 sec completed in 0.1264 seconds.\n", + "Initialization for dynamics completed in 0.0223 seconds.\n", + "Initialization was successful.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "No differential equation detected.\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Simulation to t=20.00 sec completed in 0.8044 seconds.\n" + ] + } + ], + "source": [ + "for ss in [s0, s1]:\n", + " ss.TDS.run()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "8f4813e0", + "metadata": {}, + "outputs": [], + "source": [ + "stg_idx = s0.StaticGen.get_all_idxes()\n", + "gen_bus = s0.StaticGen.get(src='bus', attr='v', idx=stg_idx)\n", + "load_bus = [b for b in s0.Bus.idx.v if b not in gen_bus]" + ] + }, + { + "cell_type": "markdown", + "id": "d5dff3e7", + "metadata": {}, + "source": [ + "Since in the case file there is no voltage compensator (this is\n", + "usually not the case in real-world systems),\n", + "the voltage at load bus drops more significantly in electro-mechanical\n", + "transient simulation than in QSTS." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "fef5960e", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAABAsAAAGMCAYAAAC8tytwAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjEsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvc2/+5QAAAAlwSFlzAAAPYQAAD2EBqD+naQAAg8JJREFUeJzt3Xt4E9eBNvBXF2MM2JYNNneD5RAISQgITAJN0gJyLtBtm8SGtrvpbYPVy3a7l8aO2+5u03bXsZPt9rJtI5HtbbcXbCVt0oY2WIEkbUIKWBASkjggcUu4GctjmwDGkub7g0+KZcu2bM1Y50jv73nyPGEsHZ0zr+ec0fHMGYOqqiqIiIiIiIiIiP4/Y6orQERERERERERi4WQBEREREREREcXgZAERERERERERxeBkARERERERERHF4GQBEREREREREcXgZAERERERERERxeBkARERERERERHF4GQBEREREREREcXgZAERERERERERxTCnugJElD4URUFtbS0AoKysDB0dHdFtVqs17nv8fj8aGhpgsVii2xwOBzweD+x2e/R9BQUFKCwshM1mQ2FhIQCgqakJALBx40YAQCAQgNfrRSAQQGdn56g/g4go00X6bI/HA7/fD5vNhhUrVkR/HggE4Pf74fV6UVlZiebmZni9XtTW1mLv3r1oaGhAdXV1CluQXkTYt16vF+vWrcOzzz4Lm82medmpap+e7UpUMuc26SrRXKqqquDxeLBixQq0tLSM+jNSfVzJgpMFRKQJt9uN+vp6bNmyJaZzVxQFVVVVqKqqGtQZ+/1+VFVV4dlnnx30Rb6pqQmtra3RMgoLC9Ha2hrzur1790JRFDidzpjPW758ORRFgcViSfgziIgIsFgscDqdcLvdqKqqQl1dHSorKwe9zu12RyeHbTYbWlpaUFBQoGvd/H5/xk3ujte+HUnki6zWUt0+vdqViGTObdJdIrk0NzfD4XDA7/ePu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rOdkgYasVissFkvcg8Vut6egRhRPZPXQ/jlFZkM5GImHx5UceFyJJ3LvYuSvDJEFj3hMJYf7Tw7sk+TDY0t8PK7Eo/dYz8kCjdXV1cWsMOl2u0e8HITGl8ViQU1NTUyn5nK5UFlZycfApNhQl0bxuBJLvJx4XInF6/XC6/XCZrPB7/fD7/fD5XKhsLAQAI+pZHH/iY99ktg43ouPY734xmOsN6h8cKnmGhsbowfRnj17uEKogBRFgcvliv67o6ODOaWQ3++H2+3G1q1b4fV6UVNTg/LyclRWVkZfw+Mq9UbKiceVGBRFQWlpadz7R/sP+TymksP9Jz72SeLheC8+jvVyGK+xnpMFRERERERERBSDtyEQERERERERUQxOFhARERERERFRDE4WEBEREREREVEMThYQERERERERUQxOFhARERERERFRDE4WEBEREREREVEMThYQERERERERUQxOFhARERERERFRDE4WEFFaczgccDgcUBRlyNe4XC44HA643e7xqxgRERFphuM9kfbMqa4AEcnF7/dj+fLlsNvtsFqtAAC32w2LxYJNmzaho6MDHo8HANDa2prKqkJRFFgsFjQ0NAz7uurqagBAbW0tKisrx6NqREREQuN4T0ScLCCiUVEUBXV1daipqYluc7vdsNvtMdsqKiqi/19bWwu/34/m5uZxrSsRERGNDcd7IuJkARGNSiAQiM7MR1gslkGvq6qqiv5/RUXFsJcFEhERkVg43hMRJwuIaFQil/qNxGq1Rl9rt9v1rxgRERFphuM9EXGygIhGJdF7/CInDF6vN3pZos/nAwB4PB7U1tYCALZs2QK/349AIIDW1lY4nU64XC4UFhZi69atqKurg81miym7sbERVqsVfr8fVqt1VPcdulyu6ImN3++HxWIZ9JcTIiKiTMfxnog4WUBEurLZbGhoaIi5TNFut6OhoQEOhwOBQCA6+JeVlaG2tjZmgaLNmzfHLJxUVVWFTZs2Rd9TUVEBq9U66AQjnsjqx5ETG7/fH12ciYiIiMaO4z1R+uGjE4koJQoLC+H3+2MuWYysthxhs9ng9/uj//b7/XC73TF/WaiqqoLT6Uz4c5ubm6P3U1qtVqxYsWKMLSAiIqKRcLwnkhcnC4goZQaeLFgsFpSVlQ35eo/HA4vFAo/HE/3P5/PFnGAMJ3LSUVBQgOXLl6OxsTGhv1AQERHR2HG8J5ITb0MgImkoigKr1Rrz14nRLqbU0tICr9cLj8cT/QtF/0dAERERUWpxvCcSA68sICJpDLxMMSLRxzS5XK5oOTU1NWhtbcXWrVu1rCIRERElieM9kRg4WUBESVMURZPnKo9Uht1ux4oVK6ILF0U0NTUlXH7kBCJi4KWRREREFB/He6LMwtsQiGjMGhsb0dHREV1lOPKIo/4LEnm9XtTX18Pv96OxsRE1NTVxtzU2NmLv3r0ArgzohYWFqK+vh6IoqK2tRV1dHSwWC1paWlBbW4tAIIDCwkIASPhRSJHnRUdOPvx+P7Zs2aLhHiEiIko/HO+JMpNBVVU11ZUgItKDoiior6+PeTTTcAY+xomIiIjEx/GeSB+8DYGIiIiIiIiIYnCygIiIiIiIiIhicLKAiNKa2+2Gw+EYdjEll8uFqqqq8asUERERaYrjPZH2uGYBEREREREREcXglQVEREREREREFIOTBUREREREREQUg5MFRERERERERBSDkwVEREREREREFIOTBUREREREREQUg5MFRERERERERBSDkwVEREREREREFIOTBUREREREREQU4/8B9VV1HRs8LFAAAAAASUVORK5CYII=", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fig, ax = plt.subplots(1, 2,\n", + " figsize=(12, 4),\n", + " sharey=True)\n", + "\n", + "a_bus_to_plot = s0.Bus.idx2uid(load_bus)[1]\n", + "\n", + "_ = s0.TDS.plt.plot(s0.Bus.v,\n", + " a=a_bus_to_plot,\n", + " title='QSTS',\n", + " ylabel='Voltage [p.u.]',\n", + " ymin=1.0145,\n", + " show=False, grid=True,\n", + " fig=fig, ax=ax[0],)\n", + "\n", + "_ = s1.TDS.plt.plot(s1.Bus.v,\n", + " a=a_bus_to_plot,\n", + " title='Electro-mechanical using Trapezoidal',\n", + " ylabel='Voltage [p.u.]',\n", + " show=False, grid=True,\n", + " fig=fig, ax=ax[1])" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "ded175a9", + "metadata": {}, + "outputs": [], + "source": [ + "os.remove(\"./pqts0.xlsx\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "ams", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..66375349a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,106 @@ +[build-system] +requires = ["setuptools>=64", "setuptools-scm>=8.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "andes" +dynamic = ["version"] +description = "Python software for symbolic power system modeling and numerical analysis." +readme = "README.md" +license = {text = "GPL-3.0-or-later"} +authors = [{name = "Hantao Cui", email = "cuihantao@gmail.com"}] +requires-python = ">=3.10" +classifiers = [ + "Development Status :: 4 - Beta", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Environment :: Console", +] + +dependencies = [ + "kvxopt>=1.3.2.0", + "numpy", + "scipy<1.14", + "sympy>=1.6,!=1.10.0", + "pandas", + "matplotlib", + "openpyxl", + "xlsxwriter", + "dill", + "pathos", + "tqdm", + "pyyaml", + "coloredlogs", + "chardet", + "psutil", + "texttable", + "numba", +] + +[project.optional-dependencies] +dev = [ + "coverage", + "pytest==7.4", + "flake8", + "sphinx", + "ipython", + "numpydoc", + "sphinx-copybutton", + "sphinx-panels", + "pydata-sphinx-theme", + "myst-parser>=0.15", + "myst-nb>=0.13", + "mdit-py-plugins>=0.3.1,<0.4", + "pre-commit", +] +doc = [ + "sphinx", + "numpydoc", + "sphinx-copybutton", + "sphinx-panels", + "pydata-sphinx-theme", + "myst-parser>=0.15", + "myst-nb>=0.13", + "mdit-py-plugins>=0.3.1,<0.4", +] +interop = [ + "pandapower", + "pypowsybl", +] +web = [ + "ipywidgets==7.7", +] +all = [ + "andes[dev,doc,interop,web]", +] + +[project.scripts] +andes = "andes.cli:main" + +[project.urls] +Homepage = "https://github.com/curent/andes" +Documentation = "https://docs.andes.app/" +Repository = "https://github.com/curent/andes" + +[tool.setuptools.packages.find] +include = ["andes*"] + +[tool.setuptools.package-data] +andes = [ + "cases/**/*.xlsx", + "cases/**/*.m", + "cases/**/*.raw", + "cases/**/*.dyr", + "cases/**/*.py", + "cases/**/*.json", + "io/*.yaml", +] + +[tool.setuptools_scm] +version_scheme = "post-release" +local_scheme = "node-and-date" +write_to = "andes/_version.py" diff --git a/requirements-extra.txt b/requirements-extra.txt deleted file mode 100644 index 0684a5384..000000000 --- a/requirements-extra.txt +++ /dev/null @@ -1,27 +0,0 @@ -# FORMAT -# Put your extra requirements here in the following format -# -# package[version_required] # tag1, tag2, ... -# -# Allow at least one space between the package name/version and '#' -# -# Only one `#` is allowed per line. Lines starting with `#` are ignored. - -coverage # dev -pytest==7.4 # dev -flake8 # dev -sphinx # dev, doc -ipython # dev -numpydoc # dev, doc -sphinx-copybutton # dev, doc -sphinx-panels # dev, doc -pydata-sphinx-theme # dev, doc -myst-parser>=0.15 # dev, doc -myst-nb>=0.13 # dev, doc -mdit-py-plugins>=0.3.1,<0.4 # dev, doc -pre-commit # dev - -pandapower # interop - -# below work around a bug with tqdm bar with ipywidgets 8.0.1 -ipywidgets==7.7 # web diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 04debb32a..000000000 --- a/requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -kvxopt>=1.3.2.0 -numpy -scipy<1.14 -sympy>=1.6,!=1.10.0 -pandas -matplotlib -openpyxl -xlsxwriter -dill -pathos -tqdm -pyyaml -coloredlogs -chardet -psutil -texttable -numba diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index db22b6537..000000000 --- a/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[versioneer] -VCS = git -style = pep440-post -versionfile_source = andes/_version.py -versionfile_build = andes/_version.py -tag_prefix = v diff --git a/setup.py b/setup.py deleted file mode 100644 index 938e88fc2..000000000 --- a/setup.py +++ /dev/null @@ -1,110 +0,0 @@ -import re -import sys -import os -from collections import defaultdict - -from setuptools import find_packages, setup - -import versioneer - -if sys.version_info < (3, 6): - error = """ -andes does not support Python <= {0}.{1}. -Python 3.6 and above is required. Check your Python version like so: - -python3 --version - -This may be due to an out-of-date pip. Make sure you have pip >= 9.0.1. -Upgrade pip like so: - -pip install --upgrade pip -""".format(3, 6) - sys.exit(error) - -here = os.path.abspath(os.path.dirname(__file__)) - -with open(os.path.join(here, 'README.md'), encoding='utf-8') as readme_file: - readme = readme_file.read() - - -def parse_requires(filename): - with open(os.path.join(here, filename)) as requirements_file: - reqs = [ - line for line in requirements_file.read().splitlines() - if not line.startswith('#') - ] - return reqs - - -def get_extra_requires(filename, add_all=True): - """ - Build ``extras_require`` from an invert requirements file. - - See: - https://hanxiao.io/2019/11/07/A-Better-Practice-for-Managing-extras-require-Dependencies-in-Python/ - """ - - with open(os.path.join(here, filename)) as fp: - extra_deps = defaultdict(set) - for k in fp: - if k.strip() and not k.startswith('#'): - tags = set() - if '#' in k: - if k.count("#") > 1: - raise ValueError("Invalid line: {}".format(k)) - - k, v = k.split('#') - tags.update(vv.strip() for vv in v.split(',')) - - tags.add(re.split('[<=>]', k)[0]) - for t in tags: - extra_deps[t].add(k) - - # add tag `all` at the end - if add_all: - extra_deps['all'] = set(vv for v in extra_deps.values() for vv in v) - - return extra_deps - - -extras_require = get_extra_requires("requirements-extra.txt") - -# --- update `extras_conda` to include packages only available in PyPI --- -extras_require["interop"].add("pypowsybl") -extras_require["all"].add("pypowsybl") - -setup( - name='andes', - version=versioneer.get_version(), - cmdclass=versioneer.get_cmdclass(), - description="Python software for symbolic power system modeling and numerical analysis.", - long_description=readme, - long_description_content_type='text/markdown', - author="Hantao Cui", - author_email='cuihantao@gmail.com', - url='https://github.com/curent/andes', - packages=find_packages(exclude=[]), - entry_points={ - 'console_scripts': [ - 'andes = andes.cli:main', - ], - }, - include_package_data=True, - package_data={ - 'andes': [ - # When adding files here, remember to update MANIFEST.in as well, - # or else they will not be included in the distribution on PyPI! - # 'path/to/data_file', - ] - }, - install_requires=parse_requires('requirements.txt'), - extras_require=extras_require, - license="GNU Public License v3", - classifiers=[ - 'Development Status :: 4 - Beta', - 'Natural Language :: English', - 'Programming Language :: Python :: 3', - 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', - 'Environment :: Console', - ], -) diff --git a/versioneer.py b/versioneer.py deleted file mode 100644 index a142bf53e..000000000 --- a/versioneer.py +++ /dev/null @@ -1,2140 +0,0 @@ - -# Version: 0.22 - -"""The Versioneer - like a rocketeer, but for versions. - -The Versioneer -============== - -* like a rocketeer, but for versions! -* https://github.com/python-versioneer/python-versioneer -* Brian Warner -* License: Public Domain -* Compatible with: Python 3.6, 3.7, 3.8, 3.9, 3.10 and pypy3 -* [![Latest Version][pypi-image]][pypi-url] -* [![Build Status][travis-image]][travis-url] - -This is a tool for managing a recorded version number in distutils/setuptools-based -python projects. The goal is to remove the tedious and error-prone "update -the embedded version string" step from your release process. Making a new -release should be as easy as recording a new tag in your version-control -system, and maybe making new tarballs. - - -## Quick Install - -* `pip install versioneer` to somewhere in your $PATH -* add a `[versioneer]` section to your setup.cfg (see [Install](INSTALL.md)) -* run `versioneer install` in your source tree, commit the results -* Verify version information with `python setup.py version` - -## Version Identifiers - -Source trees come from a variety of places: - -* a version-control system checkout (mostly used by developers) -* a nightly tarball, produced by build automation -* a snapshot tarball, produced by a web-based VCS browser, like github's - "tarball from tag" feature -* a release tarball, produced by "setup.py sdist", distributed through PyPI - -Within each source tree, the version identifier (either a string or a number, -this tool is format-agnostic) can come from a variety of places: - -* ask the VCS tool itself, e.g. "git describe" (for checkouts), which knows - about recent "tags" and an absolute revision-id -* the name of the directory into which the tarball was unpacked -* an expanded VCS keyword ($Id$, etc) -* a `_version.py` created by some earlier build step - -For released software, the version identifier is closely related to a VCS -tag. Some projects use tag names that include more than just the version -string (e.g. "myproject-1.2" instead of just "1.2"), in which case the tool -needs to strip the tag prefix to extract the version identifier. For -unreleased software (between tags), the version identifier should provide -enough information to help developers recreate the same tree, while also -giving them an idea of roughly how old the tree is (after version 1.2, before -version 1.3). Many VCS systems can report a description that captures this, -for example `git describe --tags --dirty --always` reports things like -"0.7-1-g574ab98-dirty" to indicate that the checkout is one revision past the -0.7 tag, has a unique revision id of "574ab98", and is "dirty" (it has -uncommitted changes). - -The version identifier is used for multiple purposes: - -* to allow the module to self-identify its version: `myproject.__version__` -* to choose a name and prefix for a 'setup.py sdist' tarball - -## Theory of Operation - -Versioneer works by adding a special `_version.py` file into your source -tree, where your `__init__.py` can import it. This `_version.py` knows how to -dynamically ask the VCS tool for version information at import time. - -`_version.py` also contains `$Revision$` markers, and the installation -process marks `_version.py` to have this marker rewritten with a tag name -during the `git archive` command. As a result, generated tarballs will -contain enough information to get the proper version. - -To allow `setup.py` to compute a version too, a `versioneer.py` is added to -the top level of your source tree, next to `setup.py` and the `setup.cfg` -that configures it. This overrides several distutils/setuptools commands to -compute the version when invoked, and changes `setup.py build` and `setup.py -sdist` to replace `_version.py` with a small static file that contains just -the generated version data. - -## Installation - -See [INSTALL.md](./INSTALL.md) for detailed installation instructions. - -## Version-String Flavors - -Code which uses Versioneer can learn about its version string at runtime by -importing `_version` from your main `__init__.py` file and running the -`get_versions()` function. From the "outside" (e.g. in `setup.py`), you can -import the top-level `versioneer.py` and run `get_versions()`. - -Both functions return a dictionary with different flavors of version -information: - -* `['version']`: A condensed version string, rendered using the selected - style. This is the most commonly used value for the project's version - string. The default "pep440" style yields strings like `0.11`, - `0.11+2.g1076c97`, or `0.11+2.g1076c97.dirty`. See the "Styles" section - below for alternative styles. - -* `['full-revisionid']`: detailed revision identifier. For Git, this is the - full SHA1 commit id, e.g. "1076c978a8d3cfc70f408fe5974aa6c092c949ac". - -* `['date']`: Date and time of the latest `HEAD` commit. For Git, it is the - commit date in ISO 8601 format. This will be None if the date is not - available. - -* `['dirty']`: a boolean, True if the tree has uncommitted changes. Note that - this is only accurate if run in a VCS checkout, otherwise it is likely to - be False or None - -* `['error']`: if the version string could not be computed, this will be set - to a string describing the problem, otherwise it will be None. It may be - useful to throw an exception in setup.py if this is set, to avoid e.g. - creating tarballs with a version string of "unknown". - -Some variants are more useful than others. Including `full-revisionid` in a -bug report should allow developers to reconstruct the exact code being tested -(or indicate the presence of local changes that should be shared with the -developers). `version` is suitable for display in an "about" box or a CLI -`--version` output: it can be easily compared against release notes and lists -of bugs fixed in various releases. - -The installer adds the following text to your `__init__.py` to place a basic -version in `YOURPROJECT.__version__`: - - from ._version import get_versions - __version__ = get_versions()['version'] - del get_versions - -## Styles - -The setup.cfg `style=` configuration controls how the VCS information is -rendered into a version string. - -The default style, "pep440", produces a PEP440-compliant string, equal to the -un-prefixed tag name for actual releases, and containing an additional "local -version" section with more detail for in-between builds. For Git, this is -TAG[+DISTANCE.gHEX[.dirty]] , using information from `git describe --tags ---dirty --always`. For example "0.11+2.g1076c97.dirty" indicates that the -tree is like the "1076c97" commit but has uncommitted changes (".dirty"), and -that this commit is two revisions ("+2") beyond the "0.11" tag. For released -software (exactly equal to a known tag), the identifier will only contain the -stripped tag, e.g. "0.11". - -Other styles are available. See [details.md](details.md) in the Versioneer -source tree for descriptions. - -## Debugging - -Versioneer tries to avoid fatal errors: if something goes wrong, it will tend -to return a version of "0+unknown". To investigate the problem, run `setup.py -version`, which will run the version-lookup code in a verbose mode, and will -display the full contents of `get_versions()` (including the `error` string, -which may help identify what went wrong). - -## Known Limitations - -Some situations are known to cause problems for Versioneer. This details the -most significant ones. More can be found on Github -[issues page](https://github.com/python-versioneer/python-versioneer/issues). - -### Subprojects - -Versioneer has limited support for source trees in which `setup.py` is not in -the root directory (e.g. `setup.py` and `.git/` are *not* siblings). The are -two common reasons why `setup.py` might not be in the root: - -* Source trees which contain multiple subprojects, such as - [Buildbot](https://github.com/buildbot/buildbot), which contains both - "master" and "slave" subprojects, each with their own `setup.py`, - `setup.cfg`, and `tox.ini`. Projects like these produce multiple PyPI - distributions (and upload multiple independently-installable tarballs). -* Source trees whose main purpose is to contain a C library, but which also - provide bindings to Python (and perhaps other languages) in subdirectories. - -Versioneer will look for `.git` in parent directories, and most operations -should get the right version string. However `pip` and `setuptools` have bugs -and implementation details which frequently cause `pip install .` from a -subproject directory to fail to find a correct version string (so it usually -defaults to `0+unknown`). - -`pip install --editable .` should work correctly. `setup.py install` might -work too. - -Pip-8.1.1 is known to have this problem, but hopefully it will get fixed in -some later version. - -[Bug #38](https://github.com/python-versioneer/python-versioneer/issues/38) is tracking -this issue. The discussion in -[PR #61](https://github.com/python-versioneer/python-versioneer/pull/61) describes the -issue from the Versioneer side in more detail. -[pip PR#3176](https://github.com/pypa/pip/pull/3176) and -[pip PR#3615](https://github.com/pypa/pip/pull/3615) contain work to improve -pip to let Versioneer work correctly. - -Versioneer-0.16 and earlier only looked for a `.git` directory next to the -`setup.cfg`, so subprojects were completely unsupported with those releases. - -### Editable installs with setuptools <= 18.5 - -`setup.py develop` and `pip install --editable .` allow you to install a -project into a virtualenv once, then continue editing the source code (and -test) without re-installing after every change. - -"Entry-point scripts" (`setup(entry_points={"console_scripts": ..})`) are a -convenient way to specify executable scripts that should be installed along -with the python package. - -These both work as expected when using modern setuptools. When using -setuptools-18.5 or earlier, however, certain operations will cause -`pkg_resources.DistributionNotFound` errors when running the entrypoint -script, which must be resolved by re-installing the package. This happens -when the install happens with one version, then the egg_info data is -regenerated while a different version is checked out. Many setup.py commands -cause egg_info to be rebuilt (including `sdist`, `wheel`, and installing into -a different virtualenv), so this can be surprising. - -[Bug #83](https://github.com/python-versioneer/python-versioneer/issues/83) describes -this one, but upgrading to a newer version of setuptools should probably -resolve it. - - -## Updating Versioneer - -To upgrade your project to a new release of Versioneer, do the following: - -* install the new Versioneer (`pip install -U versioneer` or equivalent) -* edit `setup.cfg`, if necessary, to include any new configuration settings - indicated by the release notes. See [UPGRADING](./UPGRADING.md) for details. -* re-run `versioneer install` in your source tree, to replace - `SRC/_version.py` -* commit any changed files - -## Future Directions - -This tool is designed to make it easily extended to other version-control -systems: all VCS-specific components are in separate directories like -src/git/ . The top-level `versioneer.py` script is assembled from these -components by running make-versioneer.py . In the future, make-versioneer.py -will take a VCS name as an argument, and will construct a version of -`versioneer.py` that is specific to the given VCS. It might also take the -configuration arguments that are currently provided manually during -installation by editing setup.py . Alternatively, it might go the other -direction and include code from all supported VCS systems, reducing the -number of intermediate scripts. - -## Similar projects - -* [setuptools_scm](https://github.com/pypa/setuptools_scm/) - a non-vendored build-time - dependency -* [minver](https://github.com/jbweston/miniver) - a lightweight reimplementation of - versioneer -* [versioningit](https://github.com/jwodder/versioningit) - a PEP 518-based setuptools - plugin - -## License - -To make Versioneer easier to embed, all its code is dedicated to the public -domain. The `_version.py` that it creates is also in the public domain. -Specifically, both are released under the Creative Commons "Public Domain -Dedication" license (CC0-1.0), as described in -https://creativecommons.org/publicdomain/zero/1.0/ . - -[pypi-image]: https://img.shields.io/pypi/v/versioneer.svg -[pypi-url]: https://pypi.python.org/pypi/versioneer/ -[travis-image]: -https://img.shields.io/travis/com/python-versioneer/python-versioneer.svg -[travis-url]: https://travis-ci.com/github/python-versioneer/python-versioneer - -""" -# pylint:disable=invalid-name,import-outside-toplevel,missing-function-docstring -# pylint:disable=missing-class-docstring,too-many-branches,too-many-statements -# pylint:disable=raise-missing-from,too-many-lines,too-many-locals,import-error -# pylint:disable=too-few-public-methods,redefined-outer-name,consider-using-with -# pylint:disable=attribute-defined-outside-init,too-many-arguments - -import configparser -import errno -import json -import os -import re -import subprocess -import sys -from typing import Callable, Dict -import functools - - -class VersioneerConfig: - """Container for Versioneer configuration parameters.""" - - -def get_root(): - """Get the project root directory. - - We require that all commands are run from the project root, i.e. the - directory that contains setup.py, setup.cfg, and versioneer.py . - """ - root = os.path.realpath(os.path.abspath(os.getcwd())) - setup_py = os.path.join(root, "setup.py") - versioneer_py = os.path.join(root, "versioneer.py") - if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)): - # allow 'python path/to/setup.py COMMAND' - root = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0]))) - setup_py = os.path.join(root, "setup.py") - versioneer_py = os.path.join(root, "versioneer.py") - if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)): - err = ("Versioneer was unable to run the project root directory. " - "Versioneer requires setup.py to be executed from " - "its immediate directory (like 'python setup.py COMMAND'), " - "or in a way that lets it use sys.argv[0] to find the root " - "(like 'python path/to/setup.py COMMAND').") - raise VersioneerBadRootError(err) - try: - # Certain runtime workflows (setup.py install/develop in a setuptools - # tree) execute all dependencies in a single python process, so - # "versioneer" may be imported multiple times, and python's shared - # module-import table will cache the first one. So we can't use - # os.path.dirname(__file__), as that will find whichever - # versioneer.py was first imported, even in later projects. - my_path = os.path.realpath(os.path.abspath(__file__)) - me_dir = os.path.normcase(os.path.splitext(my_path)[0]) - vsr_dir = os.path.normcase(os.path.splitext(versioneer_py)[0]) - if me_dir != vsr_dir: - print("Warning: build in %s is using versioneer.py from %s" - % (os.path.dirname(my_path), versioneer_py)) - except NameError: - pass - return root - - -def get_config_from_root(root): - """Read the project setup.cfg file to determine Versioneer config.""" - # This might raise OSError (if setup.cfg is missing), or - # configparser.NoSectionError (if it lacks a [versioneer] section), or - # configparser.NoOptionError (if it lacks "VCS="). See the docstring at - # the top of versioneer.py for instructions on writing your setup.cfg . - setup_cfg = os.path.join(root, "setup.cfg") - parser = configparser.ConfigParser() - with open(setup_cfg, "r") as cfg_file: - parser.read_file(cfg_file) - VCS = parser.get("versioneer", "VCS") # mandatory - - # Dict-like interface for non-mandatory entries - section = parser["versioneer"] - - cfg = VersioneerConfig() - cfg.VCS = VCS - cfg.style = section.get("style", "") - cfg.versionfile_source = section.get("versionfile_source") - cfg.versionfile_build = section.get("versionfile_build") - cfg.tag_prefix = section.get("tag_prefix") - if cfg.tag_prefix in ("''", '""'): - cfg.tag_prefix = "" - cfg.parentdir_prefix = section.get("parentdir_prefix") - cfg.verbose = section.get("verbose") - return cfg - - -class NotThisMethod(Exception): - """Exception raised if a method is not valid for the current scenario.""" - - -# these dictionaries contain VCS-specific tools -LONG_VERSION_PY: Dict[str, str] = {} -HANDLERS: Dict[str, Dict[str, Callable]] = {} - - -def register_vcs_handler(vcs, method): # decorator - """Create decorator to mark a method as the handler of a VCS.""" - def decorate(f): - """Store f in HANDLERS[vcs][method].""" - HANDLERS.setdefault(vcs, {})[method] = f - return f - return decorate - - -def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, - env=None): - """Call the given command(s).""" - assert isinstance(commands, list) - process = None - - popen_kwargs = {} - if sys.platform == "win32": - # This hides the console window if pythonw.exe is used - startupinfo = subprocess.STARTUPINFO() - startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW - popen_kwargs["startupinfo"] = startupinfo - - for command in commands: - try: - dispcmd = str([command] + args) - # remember shell=False, so use git.cmd on windows, not just git - process = subprocess.Popen([command] + args, cwd=cwd, env=env, - stdout=subprocess.PIPE, - stderr=(subprocess.PIPE if hide_stderr - else None), **popen_kwargs) - break - except OSError: - e = sys.exc_info()[1] - if e.errno == errno.ENOENT: - continue - if verbose: - print("unable to run %s" % dispcmd) - print(e) - return None, None - else: - if verbose: - print("unable to find command, tried %s" % (commands,)) - return None, None - stdout = process.communicate()[0].strip().decode() - if process.returncode != 0: - if verbose: - print("unable to run %s (error)" % dispcmd) - print("stdout was %s" % stdout) - return None, process.returncode - return stdout, process.returncode - - -LONG_VERSION_PY['git'] = r''' -# This file helps to compute a version number in source trees obtained from -# git-archive tarball (such as those provided by githubs download-from-tag -# feature). Distribution tarballs (built by setup.py sdist) and build -# directories (produced by setup.py build) will contain a much shorter file -# that just contains the computed version number. - -# This file is released into the public domain. Generated by -# versioneer-0.22 (https://github.com/python-versioneer/python-versioneer) - -"""Git implementation of _version.py.""" - -import errno -import os -import re -import subprocess -import sys -from typing import Callable, Dict -import functools - - -def get_keywords(): - """Get the keywords needed to look up the version information.""" - # these strings will be replaced by git during git-archive. - # setup.py/versioneer.py will grep for the variable names, so they must - # each be defined on a line of their own. _version.py will just call - # get_keywords(). - git_refnames = "%(DOLLAR)sFormat:%%d%(DOLLAR)s" - git_full = "%(DOLLAR)sFormat:%%H%(DOLLAR)s" - git_date = "%(DOLLAR)sFormat:%%ci%(DOLLAR)s" - keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} - return keywords - - -class VersioneerConfig: - """Container for Versioneer configuration parameters.""" - - -def get_config(): - """Create, populate and return the VersioneerConfig() object.""" - # these strings are filled in when 'setup.py versioneer' creates - # _version.py - cfg = VersioneerConfig() - cfg.VCS = "git" - cfg.style = "%(STYLE)s" - cfg.tag_prefix = "%(TAG_PREFIX)s" - cfg.parentdir_prefix = "%(PARENTDIR_PREFIX)s" - cfg.versionfile_source = "%(VERSIONFILE_SOURCE)s" - cfg.verbose = False - return cfg - - -class NotThisMethod(Exception): - """Exception raised if a method is not valid for the current scenario.""" - - -LONG_VERSION_PY: Dict[str, str] = {} -HANDLERS: Dict[str, Dict[str, Callable]] = {} - - -def register_vcs_handler(vcs, method): # decorator - """Create decorator to mark a method as the handler of a VCS.""" - def decorate(f): - """Store f in HANDLERS[vcs][method].""" - if vcs not in HANDLERS: - HANDLERS[vcs] = {} - HANDLERS[vcs][method] = f - return f - return decorate - - -def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, - env=None): - """Call the given command(s).""" - assert isinstance(commands, list) - process = None - - popen_kwargs = {} - if sys.platform == "win32": - # This hides the console window if pythonw.exe is used - startupinfo = subprocess.STARTUPINFO() - startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW - popen_kwargs["startupinfo"] = startupinfo - - for command in commands: - try: - dispcmd = str([command] + args) - # remember shell=False, so use git.cmd on windows, not just git - process = subprocess.Popen([command] + args, cwd=cwd, env=env, - stdout=subprocess.PIPE, - stderr=(subprocess.PIPE if hide_stderr - else None), **popen_kwargs) - break - except OSError: - e = sys.exc_info()[1] - if e.errno == errno.ENOENT: - continue - if verbose: - print("unable to run %%s" %% dispcmd) - print(e) - return None, None - else: - if verbose: - print("unable to find command, tried %%s" %% (commands,)) - return None, None - stdout = process.communicate()[0].strip().decode() - if process.returncode != 0: - if verbose: - print("unable to run %%s (error)" %% dispcmd) - print("stdout was %%s" %% stdout) - return None, process.returncode - return stdout, process.returncode - - -def versions_from_parentdir(parentdir_prefix, root, verbose): - """Try to determine the version from the parent directory name. - - Source tarballs conventionally unpack into a directory that includes both - the project name and a version string. We will also support searching up - two directory levels for an appropriately named parent directory - """ - rootdirs = [] - - for _ in range(3): - dirname = os.path.basename(root) - if dirname.startswith(parentdir_prefix): - return {"version": dirname[len(parentdir_prefix):], - "full-revisionid": None, - "dirty": False, "error": None, "date": None} - rootdirs.append(root) - root = os.path.dirname(root) # up a level - - if verbose: - print("Tried directories %%s but none started with prefix %%s" %% - (str(rootdirs), parentdir_prefix)) - raise NotThisMethod("rootdir doesn't start with parentdir_prefix") - - -@register_vcs_handler("git", "get_keywords") -def git_get_keywords(versionfile_abs): - """Extract version information from the given file.""" - # the code embedded in _version.py can just fetch the value of these - # keywords. When used from setup.py, we don't want to import _version.py, - # so we do it with a regexp instead. This function is not used from - # _version.py. - keywords = {} - try: - with open(versionfile_abs, "r") as fobj: - for line in fobj: - if line.strip().startswith("git_refnames ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["refnames"] = mo.group(1) - if line.strip().startswith("git_full ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["full"] = mo.group(1) - if line.strip().startswith("git_date ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["date"] = mo.group(1) - except OSError: - pass - return keywords - - -@register_vcs_handler("git", "keywords") -def git_versions_from_keywords(keywords, tag_prefix, verbose): - """Get version information from git keywords.""" - if "refnames" not in keywords: - raise NotThisMethod("Short version file found") - date = keywords.get("date") - if date is not None: - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - - # git-2.2.0 added "%%cI", which expands to an ISO-8601 -compliant - # datestamp. However we prefer "%%ci" (which expands to an "ISO-8601 - # -like" string, which we must then edit to make compliant), because - # it's been around since git-1.5.3, and it's too difficult to - # discover which version we're using, or to work around using an - # older one. - date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - refnames = keywords["refnames"].strip() - if refnames.startswith("$Format"): - if verbose: - print("keywords are unexpanded, not using") - raise NotThisMethod("unexpanded keywords, not a git-archive tarball") - refs = {r.strip() for r in refnames.strip("()").split(",")} - # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of - # just "foo-1.0". If we see a "tag: " prefix, prefer those. - TAG = "tag: " - tags = {r[len(TAG):] for r in refs if r.startswith(TAG)} - if not tags: - # Either we're using git < 1.8.3, or there really are no tags. We use - # a heuristic: assume all version tags have a digit. The old git %%d - # expansion behaves like git log --decorate=short and strips out the - # refs/heads/ and refs/tags/ prefixes that would let us distinguish - # between branches and tags. By ignoring refnames without digits, we - # filter out many common branch names like "release" and - # "stabilization", as well as "HEAD" and "master". - tags = {r for r in refs if re.search(r'\d', r)} - if verbose: - print("discarding '%%s', no digits" %% ",".join(refs - tags)) - if verbose: - print("likely tags: %%s" %% ",".join(sorted(tags))) - for ref in sorted(tags): - # sorting will prefer e.g. "2.0" over "2.0rc1" - if ref.startswith(tag_prefix): - r = ref[len(tag_prefix):] - # Filter out refs that exactly match prefix or that don't start - # with a number once the prefix is stripped (mostly a concern - # when prefix is '') - if not re.match(r'\d', r): - continue - if verbose: - print("picking %%s" %% r) - return {"version": r, - "full-revisionid": keywords["full"].strip(), - "dirty": False, "error": None, - "date": date} - # no suitable tags, so version is "0+unknown", but full hex is still there - if verbose: - print("no suitable tags, using unknown + full revision id") - return {"version": "0+unknown", - "full-revisionid": keywords["full"].strip(), - "dirty": False, "error": "no suitable tags", "date": None} - - -@register_vcs_handler("git", "pieces_from_vcs") -def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): - """Get version from 'git describe' in the root of the source tree. - - This only gets called if the git-archive 'subst' keywords were *not* - expanded, and _version.py hasn't already been rewritten with a short - version string, meaning we're inside a checked out source tree. - """ - GITS = ["git"] - if sys.platform == "win32": - GITS = ["git.cmd", "git.exe"] - - # GIT_DIR can interfere with correct operation of Versioneer. - # It may be intended to be passed to the Versioneer-versioned project, - # but that should not change where we get our version from. - env = os.environ.copy() - env.pop("GIT_DIR", None) - runner = functools.partial(runner, env=env) - - _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, - hide_stderr=True) - if rc != 0: - if verbose: - print("Directory %%s not under git control" %% root) - raise NotThisMethod("'git rev-parse --git-dir' returned error") - - MATCH_ARGS = ["--match", "%%s*" %% tag_prefix] if tag_prefix else [] - - # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] - # if there isn't one, this yields HEX[-dirty] (no NUM) - describe_out, rc = runner(GITS, ["describe", "--tags", "--dirty", - "--always", "--long", *MATCH_ARGS], - cwd=root) - # --long was added in git-1.5.5 - if describe_out is None: - raise NotThisMethod("'git describe' failed") - describe_out = describe_out.strip() - full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root) - if full_out is None: - raise NotThisMethod("'git rev-parse' failed") - full_out = full_out.strip() - - pieces = {} - pieces["long"] = full_out - pieces["short"] = full_out[:7] # maybe improved later - pieces["error"] = None - - branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], - cwd=root) - # --abbrev-ref was added in git-1.6.3 - if rc != 0 or branch_name is None: - raise NotThisMethod("'git rev-parse --abbrev-ref' returned error") - branch_name = branch_name.strip() - - if branch_name == "HEAD": - # If we aren't exactly on a branch, pick a branch which represents - # the current commit. If all else fails, we are on a branchless - # commit. - branches, rc = runner(GITS, ["branch", "--contains"], cwd=root) - # --contains was added in git-1.5.4 - if rc != 0 or branches is None: - raise NotThisMethod("'git branch --contains' returned error") - branches = branches.split("\n") - - # Remove the first line if we're running detached - if "(" in branches[0]: - branches.pop(0) - - # Strip off the leading "* " from the list of branches. - branches = [branch[2:] for branch in branches] - if "master" in branches: - branch_name = "master" - elif not branches: - branch_name = None - else: - # Pick the first branch that is returned. Good or bad. - branch_name = branches[0] - - pieces["branch"] = branch_name - - # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] - # TAG might have hyphens. - git_describe = describe_out - - # look for -dirty suffix - dirty = git_describe.endswith("-dirty") - pieces["dirty"] = dirty - if dirty: - git_describe = git_describe[:git_describe.rindex("-dirty")] - - # now we have TAG-NUM-gHEX or HEX - - if "-" in git_describe: - # TAG-NUM-gHEX - mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) - if not mo: - # unparsable. Maybe git-describe is misbehaving? - pieces["error"] = ("unable to parse git-describe output: '%%s'" - %% describe_out) - return pieces - - # tag - full_tag = mo.group(1) - if not full_tag.startswith(tag_prefix): - if verbose: - fmt = "tag '%%s' doesn't start with prefix '%%s'" - print(fmt %% (full_tag, tag_prefix)) - pieces["error"] = ("tag '%%s' doesn't start with prefix '%%s'" - %% (full_tag, tag_prefix)) - return pieces - pieces["closest-tag"] = full_tag[len(tag_prefix):] - - # distance: number of commits since tag - pieces["distance"] = int(mo.group(2)) - - # commit: short hex revision ID - pieces["short"] = mo.group(3) - - else: - # HEX: no tags - pieces["closest-tag"] = None - count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root) - pieces["distance"] = int(count_out) # total number of commits - - # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = runner(GITS, ["show", "-s", "--format=%%ci", "HEAD"], cwd=root)[0].strip() - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - - return pieces - - -def plus_or_dot(pieces): - """Return a + if we don't already have one, else return a .""" - if "+" in pieces.get("closest-tag", ""): - return "." - return "+" - - -def render_pep440(pieces): - """Build up version string, with post-release "local version identifier". - - Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you - get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty - - Exceptions: - 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += plus_or_dot(pieces) - rendered += "%%d.g%%s" %% (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0+untagged.%%d.g%%s" %% (pieces["distance"], - pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_branch(pieces): - """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] . - - The ".dev0" means not master branch. Note that .dev0 sorts backwards - (a feature branch will appear "older" than the master branch). - - Exceptions: - 1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "%%d.g%%s" %% (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0" - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+untagged.%%d.g%%s" %% (pieces["distance"], - pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def pep440_split_post(ver): - """Split pep440 version string at the post-release segment. - - Returns the release segments before the post-release and the - post-release version number (or -1 if no post-release segment is present). - """ - vc = str.split(ver, ".post") - return vc[0], int(vc[1] or 0) if len(vc) == 2 else None - - -def render_pep440_pre(pieces): - """TAG[.postN.devDISTANCE] -- No -dirty. - - Exceptions: - 1: no tags. 0.post0.devDISTANCE - """ - if pieces["closest-tag"]: - if pieces["distance"]: - # update the post release segment - tag_version, post_version = pep440_split_post(pieces["closest-tag"]) - rendered = tag_version - if post_version is not None: - rendered += ".post%%d.dev%%d" %% (post_version+1, pieces["distance"]) - else: - rendered += ".post0.dev%%d" %% (pieces["distance"]) - else: - # no commits, use the tag as the version - rendered = pieces["closest-tag"] - else: - # exception #1 - rendered = "0.post0.dev%%d" %% pieces["distance"] - return rendered - - -def render_pep440_post(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX] . - - The ".dev0" means dirty. Note that .dev0 sorts backwards - (a dirty tree will appear "older" than the corresponding clean one), - but you shouldn't be releasing software with -dirty anyways. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%%d" %% pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%%s" %% pieces["short"] - else: - # exception #1 - rendered = "0.post%%d" %% pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += "+g%%s" %% pieces["short"] - return rendered - - -def render_pep440_post_branch(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . - - The ".dev0" means not master branch. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%%d" %% pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%%s" %% pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0.post%%d" %% pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+g%%s" %% pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_old(pieces): - """TAG[.postDISTANCE[.dev0]] . - - The ".dev0" means dirty. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%%d" %% pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - else: - # exception #1 - rendered = "0.post%%d" %% pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - return rendered - - -def render_git_describe(pieces): - """TAG[-DISTANCE-gHEX][-dirty]. - - Like 'git describe --tags --dirty --always'. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"]: - rendered += "-%%d-g%%s" %% (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render_git_describe_long(pieces): - """TAG-DISTANCE-gHEX[-dirty]. - - Like 'git describe --tags --dirty --always -long'. - The distance/hash is unconditional. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - rendered += "-%%d-g%%s" %% (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render(pieces, style): - """Render the given version pieces into the requested style.""" - if pieces["error"]: - return {"version": "unknown", - "full-revisionid": pieces.get("long"), - "dirty": None, - "error": pieces["error"], - "date": None} - - if not style or style == "default": - style = "pep440" # the default - - if style == "pep440": - rendered = render_pep440(pieces) - elif style == "pep440-branch": - rendered = render_pep440_branch(pieces) - elif style == "pep440-pre": - rendered = render_pep440_pre(pieces) - elif style == "pep440-post": - rendered = render_pep440_post(pieces) - elif style == "pep440-post-branch": - rendered = render_pep440_post_branch(pieces) - elif style == "pep440-old": - rendered = render_pep440_old(pieces) - elif style == "git-describe": - rendered = render_git_describe(pieces) - elif style == "git-describe-long": - rendered = render_git_describe_long(pieces) - else: - raise ValueError("unknown style '%%s'" %% style) - - return {"version": rendered, "full-revisionid": pieces["long"], - "dirty": pieces["dirty"], "error": None, - "date": pieces.get("date")} - - -def get_versions(): - """Get version information or return default if unable to do so.""" - # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have - # __file__, we can work backwards from there to the root. Some - # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which - # case we can only use expanded keywords. - - cfg = get_config() - verbose = cfg.verbose - - try: - return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, - verbose) - except NotThisMethod: - pass - - try: - root = os.path.realpath(__file__) - # versionfile_source is the relative path from the top of the source - # tree (where the .git directory might live) to this file. Invert - # this to find the root from __file__. - for _ in cfg.versionfile_source.split('/'): - root = os.path.dirname(root) - except NameError: - return {"version": "0+unknown", "full-revisionid": None, - "dirty": None, - "error": "unable to find root of source tree", - "date": None} - - try: - pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) - return render(pieces, cfg.style) - except NotThisMethod: - pass - - try: - if cfg.parentdir_prefix: - return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) - except NotThisMethod: - pass - - return {"version": "0+unknown", "full-revisionid": None, - "dirty": None, - "error": "unable to compute version", "date": None} -''' - - -@register_vcs_handler("git", "get_keywords") -def git_get_keywords(versionfile_abs): - """Extract version information from the given file.""" - # the code embedded in _version.py can just fetch the value of these - # keywords. When used from setup.py, we don't want to import _version.py, - # so we do it with a regexp instead. This function is not used from - # _version.py. - keywords = {} - try: - with open(versionfile_abs, "r") as fobj: - for line in fobj: - if line.strip().startswith("git_refnames ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["refnames"] = mo.group(1) - if line.strip().startswith("git_full ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["full"] = mo.group(1) - if line.strip().startswith("git_date ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["date"] = mo.group(1) - except OSError: - pass - return keywords - - -@register_vcs_handler("git", "keywords") -def git_versions_from_keywords(keywords, tag_prefix, verbose): - """Get version information from git keywords.""" - if "refnames" not in keywords: - raise NotThisMethod("Short version file found") - date = keywords.get("date") - if date is not None: - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - - # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant - # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 - # -like" string, which we must then edit to make compliant), because - # it's been around since git-1.5.3, and it's too difficult to - # discover which version we're using, or to work around using an - # older one. - date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - refnames = keywords["refnames"].strip() - if refnames.startswith("$Format"): - if verbose: - print("keywords are unexpanded, not using") - raise NotThisMethod("unexpanded keywords, not a git-archive tarball") - refs = {r.strip() for r in refnames.strip("()").split(",")} - # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of - # just "foo-1.0". If we see a "tag: " prefix, prefer those. - TAG = "tag: " - tags = {r[len(TAG):] for r in refs if r.startswith(TAG)} - if not tags: - # Either we're using git < 1.8.3, or there really are no tags. We use - # a heuristic: assume all version tags have a digit. The old git %d - # expansion behaves like git log --decorate=short and strips out the - # refs/heads/ and refs/tags/ prefixes that would let us distinguish - # between branches and tags. By ignoring refnames without digits, we - # filter out many common branch names like "release" and - # "stabilization", as well as "HEAD" and "master". - tags = {r for r in refs if re.search(r'\d', r)} - if verbose: - print("discarding '%s', no digits" % ",".join(refs - tags)) - if verbose: - print("likely tags: %s" % ",".join(sorted(tags))) - for ref in sorted(tags): - # sorting will prefer e.g. "2.0" over "2.0rc1" - if ref.startswith(tag_prefix): - r = ref[len(tag_prefix):] - # Filter out refs that exactly match prefix or that don't start - # with a number once the prefix is stripped (mostly a concern - # when prefix is '') - if not re.match(r'\d', r): - continue - if verbose: - print("picking %s" % r) - return {"version": r, - "full-revisionid": keywords["full"].strip(), - "dirty": False, "error": None, - "date": date} - # no suitable tags, so version is "0+unknown", but full hex is still there - if verbose: - print("no suitable tags, using unknown + full revision id") - return {"version": "0+unknown", - "full-revisionid": keywords["full"].strip(), - "dirty": False, "error": "no suitable tags", "date": None} - - -@register_vcs_handler("git", "pieces_from_vcs") -def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): - """Get version from 'git describe' in the root of the source tree. - - This only gets called if the git-archive 'subst' keywords were *not* - expanded, and _version.py hasn't already been rewritten with a short - version string, meaning we're inside a checked out source tree. - """ - GITS = ["git"] - if sys.platform == "win32": - GITS = ["git.cmd", "git.exe"] - - # GIT_DIR can interfere with correct operation of Versioneer. - # It may be intended to be passed to the Versioneer-versioned project, - # but that should not change where we get our version from. - env = os.environ.copy() - env.pop("GIT_DIR", None) - runner = functools.partial(runner, env=env) - - _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, - hide_stderr=True) - if rc != 0: - if verbose: - print("Directory %s not under git control" % root) - raise NotThisMethod("'git rev-parse --git-dir' returned error") - - MATCH_ARGS = ["--match", "%s*" % tag_prefix] if tag_prefix else [] - - # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] - # if there isn't one, this yields HEX[-dirty] (no NUM) - describe_out, rc = runner(GITS, ["describe", "--tags", "--dirty", - "--always", "--long", *MATCH_ARGS], - cwd=root) - # --long was added in git-1.5.5 - if describe_out is None: - raise NotThisMethod("'git describe' failed") - describe_out = describe_out.strip() - full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root) - if full_out is None: - raise NotThisMethod("'git rev-parse' failed") - full_out = full_out.strip() - - pieces = {} - pieces["long"] = full_out - pieces["short"] = full_out[:7] # maybe improved later - pieces["error"] = None - - branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], - cwd=root) - # --abbrev-ref was added in git-1.6.3 - if rc != 0 or branch_name is None: - raise NotThisMethod("'git rev-parse --abbrev-ref' returned error") - branch_name = branch_name.strip() - - if branch_name == "HEAD": - # If we aren't exactly on a branch, pick a branch which represents - # the current commit. If all else fails, we are on a branchless - # commit. - branches, rc = runner(GITS, ["branch", "--contains"], cwd=root) - # --contains was added in git-1.5.4 - if rc != 0 or branches is None: - raise NotThisMethod("'git branch --contains' returned error") - branches = branches.split("\n") - - # Remove the first line if we're running detached - if "(" in branches[0]: - branches.pop(0) - - # Strip off the leading "* " from the list of branches. - branches = [branch[2:] for branch in branches] - if "master" in branches: - branch_name = "master" - elif not branches: - branch_name = None - else: - # Pick the first branch that is returned. Good or bad. - branch_name = branches[0] - - pieces["branch"] = branch_name - - # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] - # TAG might have hyphens. - git_describe = describe_out - - # look for -dirty suffix - dirty = git_describe.endswith("-dirty") - pieces["dirty"] = dirty - if dirty: - git_describe = git_describe[:git_describe.rindex("-dirty")] - - # now we have TAG-NUM-gHEX or HEX - - if "-" in git_describe: - # TAG-NUM-gHEX - mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) - if not mo: - # unparsable. Maybe git-describe is misbehaving? - pieces["error"] = ("unable to parse git-describe output: '%s'" - % describe_out) - return pieces - - # tag - full_tag = mo.group(1) - if not full_tag.startswith(tag_prefix): - if verbose: - fmt = "tag '%s' doesn't start with prefix '%s'" - print(fmt % (full_tag, tag_prefix)) - pieces["error"] = ("tag '%s' doesn't start with prefix '%s'" - % (full_tag, tag_prefix)) - return pieces - pieces["closest-tag"] = full_tag[len(tag_prefix):] - - # distance: number of commits since tag - pieces["distance"] = int(mo.group(2)) - - # commit: short hex revision ID - pieces["short"] = mo.group(3) - - else: - # HEX: no tags - pieces["closest-tag"] = None - count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root) - pieces["distance"] = int(count_out) # total number of commits - - # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = runner(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - - return pieces - - -def do_vcs_install(manifest_in, versionfile_source, ipy): - """Git-specific installation logic for Versioneer. - - For Git, this means creating/changing .gitattributes to mark _version.py - for export-subst keyword substitution. - """ - GITS = ["git"] - if sys.platform == "win32": - GITS = ["git.cmd", "git.exe"] - files = [manifest_in, versionfile_source] - if ipy: - files.append(ipy) - try: - my_path = __file__ - if my_path.endswith(".pyc") or my_path.endswith(".pyo"): - my_path = os.path.splitext(my_path)[0] + ".py" - versioneer_file = os.path.relpath(my_path) - except NameError: - versioneer_file = "versioneer.py" - files.append(versioneer_file) - present = False - try: - with open(".gitattributes", "r") as fobj: - for line in fobj: - if line.strip().startswith(versionfile_source): - if "export-subst" in line.strip().split()[1:]: - present = True - break - except OSError: - pass - if not present: - with open(".gitattributes", "a+") as fobj: - fobj.write(f"{versionfile_source} export-subst\n") - files.append(".gitattributes") - run_command(GITS, ["add", "--"] + files) - - -def versions_from_parentdir(parentdir_prefix, root, verbose): - """Try to determine the version from the parent directory name. - - Source tarballs conventionally unpack into a directory that includes both - the project name and a version string. We will also support searching up - two directory levels for an appropriately named parent directory - """ - rootdirs = [] - - for _ in range(3): - dirname = os.path.basename(root) - if dirname.startswith(parentdir_prefix): - return {"version": dirname[len(parentdir_prefix):], - "full-revisionid": None, - "dirty": False, "error": None, "date": None} - rootdirs.append(root) - root = os.path.dirname(root) # up a level - - if verbose: - print("Tried directories %s but none started with prefix %s" % - (str(rootdirs), parentdir_prefix)) - raise NotThisMethod("rootdir doesn't start with parentdir_prefix") - - -SHORT_VERSION_PY = """ -# This file was generated by 'versioneer.py' (0.22) from -# revision-control system data, or from the parent directory name of an -# unpacked source archive. Distribution tarballs contain a pre-generated copy -# of this file. - -import json - -version_json = ''' -%s -''' # END VERSION_JSON - - -def get_versions(): - return json.loads(version_json) -""" - - -def versions_from_file(filename): - """Try to determine the version from _version.py if present.""" - try: - with open(filename) as f: - contents = f.read() - except OSError: - raise NotThisMethod("unable to read _version.py") - mo = re.search(r"version_json = '''\n(.*)''' # END VERSION_JSON", - contents, re.M | re.S) - if not mo: - mo = re.search(r"version_json = '''\r\n(.*)''' # END VERSION_JSON", - contents, re.M | re.S) - if not mo: - raise NotThisMethod("no version_json in _version.py") - return json.loads(mo.group(1)) - - -def write_to_version_file(filename, versions): - """Write the given version number to the given _version.py file.""" - os.unlink(filename) - contents = json.dumps(versions, sort_keys=True, - indent=1, separators=(",", ": ")) - with open(filename, "w") as f: - f.write(SHORT_VERSION_PY % contents) - - print("set %s to '%s'" % (filename, versions["version"])) - - -def plus_or_dot(pieces): - """Return a + if we don't already have one, else return a .""" - if "+" in pieces.get("closest-tag", ""): - return "." - return "+" - - -def render_pep440(pieces): - """Build up version string, with post-release "local version identifier". - - Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you - get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty - - Exceptions: - 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += plus_or_dot(pieces) - rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0+untagged.%d.g%s" % (pieces["distance"], - pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_branch(pieces): - """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] . - - The ".dev0" means not master branch. Note that .dev0 sorts backwards - (a feature branch will appear "older" than the master branch). - - Exceptions: - 1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0" - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+untagged.%d.g%s" % (pieces["distance"], - pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def pep440_split_post(ver): - """Split pep440 version string at the post-release segment. - - Returns the release segments before the post-release and the - post-release version number (or -1 if no post-release segment is present). - """ - vc = str.split(ver, ".post") - return vc[0], int(vc[1] or 0) if len(vc) == 2 else None - - -def render_pep440_pre(pieces): - """TAG[.postN.devDISTANCE] -- No -dirty. - - Exceptions: - 1: no tags. 0.post0.devDISTANCE - """ - if pieces["closest-tag"]: - if pieces["distance"]: - # update the post release segment - tag_version, post_version = pep440_split_post(pieces["closest-tag"]) - rendered = tag_version - if post_version is not None: - rendered += ".post%d.dev%d" % (post_version+1, pieces["distance"]) - else: - rendered += ".post0.dev%d" % (pieces["distance"]) - else: - # no commits, use the tag as the version - rendered = pieces["closest-tag"] - else: - # exception #1 - rendered = "0.post0.dev%d" % pieces["distance"] - return rendered - - -def render_pep440_post(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX] . - - The ".dev0" means dirty. Note that .dev0 sorts backwards - (a dirty tree will appear "older" than the corresponding clean one), - but you shouldn't be releasing software with -dirty anyways. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%s" % pieces["short"] - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += "+g%s" % pieces["short"] - return rendered - - -def render_pep440_post_branch(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . - - The ".dev0" means not master branch. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%s" % pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+g%s" % pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_old(pieces): - """TAG[.postDISTANCE[.dev0]] . - - The ".dev0" means dirty. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - return rendered - - -def render_git_describe(pieces): - """TAG[-DISTANCE-gHEX][-dirty]. - - Like 'git describe --tags --dirty --always'. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"]: - rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render_git_describe_long(pieces): - """TAG-DISTANCE-gHEX[-dirty]. - - Like 'git describe --tags --dirty --always -long'. - The distance/hash is unconditional. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render(pieces, style): - """Render the given version pieces into the requested style.""" - if pieces["error"]: - return {"version": "unknown", - "full-revisionid": pieces.get("long"), - "dirty": None, - "error": pieces["error"], - "date": None} - - if not style or style == "default": - style = "pep440" # the default - - if style == "pep440": - rendered = render_pep440(pieces) - elif style == "pep440-branch": - rendered = render_pep440_branch(pieces) - elif style == "pep440-pre": - rendered = render_pep440_pre(pieces) - elif style == "pep440-post": - rendered = render_pep440_post(pieces) - elif style == "pep440-post-branch": - rendered = render_pep440_post_branch(pieces) - elif style == "pep440-old": - rendered = render_pep440_old(pieces) - elif style == "git-describe": - rendered = render_git_describe(pieces) - elif style == "git-describe-long": - rendered = render_git_describe_long(pieces) - else: - raise ValueError("unknown style '%s'" % style) - - return {"version": rendered, "full-revisionid": pieces["long"], - "dirty": pieces["dirty"], "error": None, - "date": pieces.get("date")} - - -class VersioneerBadRootError(Exception): - """The project root directory is unknown or missing key files.""" - - -def get_versions(verbose=False): - """Get the project version from whatever source is available. - - Returns dict with two keys: 'version' and 'full'. - """ - if "versioneer" in sys.modules: - # see the discussion in cmdclass.py:get_cmdclass() - del sys.modules["versioneer"] - - root = get_root() - cfg = get_config_from_root(root) - - assert cfg.VCS is not None, "please set [versioneer]VCS= in setup.cfg" - handlers = HANDLERS.get(cfg.VCS) - assert handlers, "unrecognized VCS '%s'" % cfg.VCS - verbose = verbose or cfg.verbose - assert cfg.versionfile_source is not None, \ - "please set versioneer.versionfile_source" - assert cfg.tag_prefix is not None, "please set versioneer.tag_prefix" - - versionfile_abs = os.path.join(root, cfg.versionfile_source) - - # extract version from first of: _version.py, VCS command (e.g. 'git - # describe'), parentdir. This is meant to work for developers using a - # source checkout, for users of a tarball created by 'setup.py sdist', - # and for users of a tarball/zipball created by 'git archive' or github's - # download-from-tag feature or the equivalent in other VCSes. - - get_keywords_f = handlers.get("get_keywords") - from_keywords_f = handlers.get("keywords") - if get_keywords_f and from_keywords_f: - try: - keywords = get_keywords_f(versionfile_abs) - ver = from_keywords_f(keywords, cfg.tag_prefix, verbose) - if verbose: - print("got version from expanded keyword %s" % ver) - return ver - except NotThisMethod: - pass - - try: - ver = versions_from_file(versionfile_abs) - if verbose: - print("got version from file %s %s" % (versionfile_abs, ver)) - return ver - except NotThisMethod: - pass - - from_vcs_f = handlers.get("pieces_from_vcs") - if from_vcs_f: - try: - pieces = from_vcs_f(cfg.tag_prefix, root, verbose) - ver = render(pieces, cfg.style) - if verbose: - print("got version from VCS %s" % ver) - return ver - except NotThisMethod: - pass - - try: - if cfg.parentdir_prefix: - ver = versions_from_parentdir(cfg.parentdir_prefix, root, verbose) - if verbose: - print("got version from parentdir %s" % ver) - return ver - except NotThisMethod: - pass - - if verbose: - print("unable to compute version") - - return {"version": "0+unknown", "full-revisionid": None, - "dirty": None, "error": "unable to compute version", - "date": None} - - -def get_version(): - """Get the short version string for this project.""" - return get_versions()["version"] - - -def get_cmdclass(cmdclass=None): - """Get the custom setuptools/distutils subclasses used by Versioneer. - - If the package uses a different cmdclass (e.g. one from numpy), it - should be provide as an argument. - """ - if "versioneer" in sys.modules: - del sys.modules["versioneer"] - # this fixes the "python setup.py develop" case (also 'install' and - # 'easy_install .'), in which subdependencies of the main project are - # built (using setup.py bdist_egg) in the same python process. Assume - # a main project A and a dependency B, which use different versions - # of Versioneer. A's setup.py imports A's Versioneer, leaving it in - # sys.modules by the time B's setup.py is executed, causing B to run - # with the wrong versioneer. Setuptools wraps the sub-dep builds in a - # sandbox that restores sys.modules to it's pre-build state, so the - # parent is protected against the child's "import versioneer". By - # removing ourselves from sys.modules here, before the child build - # happens, we protect the child from the parent's versioneer too. - # Also see https://github.com/python-versioneer/python-versioneer/issues/52 - - cmds = {} if cmdclass is None else cmdclass.copy() - - # we add "version" to both distutils and setuptools - try: - from setuptools import Command - except ImportError: - from distutils.core import Command - - class cmd_version(Command): - description = "report generated version string" - user_options = [] - boolean_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - vers = get_versions(verbose=True) - print("Version: %s" % vers["version"]) - print(" full-revisionid: %s" % vers.get("full-revisionid")) - print(" dirty: %s" % vers.get("dirty")) - print(" date: %s" % vers.get("date")) - if vers["error"]: - print(" error: %s" % vers["error"]) - cmds["version"] = cmd_version - - # we override "build_py" in both distutils and setuptools - # - # most invocation pathways end up running build_py: - # distutils/build -> build_py - # distutils/install -> distutils/build ->.. - # setuptools/bdist_wheel -> distutils/install ->.. - # setuptools/bdist_egg -> distutils/install_lib -> build_py - # setuptools/install -> bdist_egg ->.. - # setuptools/develop -> ? - # pip install: - # copies source tree to a tempdir before running egg_info/etc - # if .git isn't copied too, 'git describe' will fail - # then does setup.py bdist_wheel, or sometimes setup.py install - # setup.py egg_info -> ? - - # we override different "build_py" commands for both environments - if 'build_py' in cmds: - _build_py = cmds['build_py'] - elif "setuptools" in sys.modules: - from setuptools.command.build_py import build_py as _build_py - else: - from distutils.command.build_py import build_py as _build_py - - class cmd_build_py(_build_py): - def run(self): - root = get_root() - cfg = get_config_from_root(root) - versions = get_versions() - _build_py.run(self) - # now locate _version.py in the new build/ directory and replace - # it with an updated value - if cfg.versionfile_build: - target_versionfile = os.path.join(self.build_lib, - cfg.versionfile_build) - print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, versions) - cmds["build_py"] = cmd_build_py - - if 'build_ext' in cmds: - _build_ext = cmds['build_ext'] - elif "setuptools" in sys.modules: - from setuptools.command.build_ext import build_ext as _build_ext - else: - from distutils.command.build_ext import build_ext as _build_ext - - class cmd_build_ext(_build_ext): - def run(self): - root = get_root() - cfg = get_config_from_root(root) - versions = get_versions() - _build_ext.run(self) - if self.inplace: - # build_ext --inplace will only build extensions in - # build/lib<..> dir with no _version.py to write to. - # As in place builds will already have a _version.py - # in the module dir, we do not need to write one. - return - # now locate _version.py in the new build/ directory and replace - # it with an updated value - target_versionfile = os.path.join(self.build_lib, - cfg.versionfile_build) - print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, versions) - cmds["build_ext"] = cmd_build_ext - - if "cx_Freeze" in sys.modules: # cx_freeze enabled? - from cx_Freeze.dist import build_exe as _build_exe - # nczeczulin reports that py2exe won't like the pep440-style string - # as FILEVERSION, but it can be used for PRODUCTVERSION, e.g. - # setup(console=[{ - # "version": versioneer.get_version().split("+", 1)[0], # FILEVERSION - # "product_version": versioneer.get_version(), - # ... - - class cmd_build_exe(_build_exe): - def run(self): - root = get_root() - cfg = get_config_from_root(root) - versions = get_versions() - target_versionfile = cfg.versionfile_source - print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, versions) - - _build_exe.run(self) - os.unlink(target_versionfile) - with open(cfg.versionfile_source, "w") as f: - LONG = LONG_VERSION_PY[cfg.VCS] - f.write(LONG % - {"DOLLAR": "$", - "STYLE": cfg.style, - "TAG_PREFIX": cfg.tag_prefix, - "PARENTDIR_PREFIX": cfg.parentdir_prefix, - "VERSIONFILE_SOURCE": cfg.versionfile_source, - }) - cmds["build_exe"] = cmd_build_exe - del cmds["build_py"] - - if 'py2exe' in sys.modules: # py2exe enabled? - from py2exe.distutils_buildexe import py2exe as _py2exe - - class cmd_py2exe(_py2exe): - def run(self): - root = get_root() - cfg = get_config_from_root(root) - versions = get_versions() - target_versionfile = cfg.versionfile_source - print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, versions) - - _py2exe.run(self) - os.unlink(target_versionfile) - with open(cfg.versionfile_source, "w") as f: - LONG = LONG_VERSION_PY[cfg.VCS] - f.write(LONG % - {"DOLLAR": "$", - "STYLE": cfg.style, - "TAG_PREFIX": cfg.tag_prefix, - "PARENTDIR_PREFIX": cfg.parentdir_prefix, - "VERSIONFILE_SOURCE": cfg.versionfile_source, - }) - cmds["py2exe"] = cmd_py2exe - - # we override different "sdist" commands for both environments - if 'sdist' in cmds: - _sdist = cmds['sdist'] - elif "setuptools" in sys.modules: - from setuptools.command.sdist import sdist as _sdist - else: - from distutils.command.sdist import sdist as _sdist - - class cmd_sdist(_sdist): - def run(self): - versions = get_versions() - self._versioneer_generated_versions = versions - # unless we update this, the command will keep using the old - # version - self.distribution.metadata.version = versions["version"] - return _sdist.run(self) - - def make_release_tree(self, base_dir, files): - root = get_root() - cfg = get_config_from_root(root) - _sdist.make_release_tree(self, base_dir, files) - # now locate _version.py in the new base_dir directory - # (remembering that it may be a hardlink) and replace it with an - # updated value - target_versionfile = os.path.join(base_dir, cfg.versionfile_source) - print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, - self._versioneer_generated_versions) - cmds["sdist"] = cmd_sdist - - return cmds - - -CONFIG_ERROR = """ -setup.cfg is missing the necessary Versioneer configuration. You need -a section like: - - [versioneer] - VCS = git - style = pep440 - versionfile_source = src/myproject/_version.py - versionfile_build = myproject/_version.py - tag_prefix = - parentdir_prefix = myproject- - -You will also need to edit your setup.py to use the results: - - import versioneer - setup(version=versioneer.get_version(), - cmdclass=versioneer.get_cmdclass(), ...) - -Please read the docstring in ./versioneer.py for configuration instructions, -edit setup.cfg, and re-run the installer or 'python versioneer.py setup'. -""" - -SAMPLE_CONFIG = """ -# See the docstring in versioneer.py for instructions. Note that you must -# re-run 'versioneer.py setup' after changing this section, and commit the -# resulting files. - -[versioneer] -#VCS = git -#style = pep440 -#versionfile_source = -#versionfile_build = -#tag_prefix = -#parentdir_prefix = - -""" - -OLD_SNIPPET = """ -from ._version import get_versions -__version__ = get_versions()['version'] -del get_versions -""" - -INIT_PY_SNIPPET = """ -from . import {0} -__version__ = {0}.get_versions()['version'] -""" - - -def do_setup(): - """Do main VCS-independent setup function for installing Versioneer.""" - root = get_root() - try: - cfg = get_config_from_root(root) - except (OSError, configparser.NoSectionError, - configparser.NoOptionError) as e: - if isinstance(e, (OSError, configparser.NoSectionError)): - print("Adding sample versioneer config to setup.cfg", - file=sys.stderr) - with open(os.path.join(root, "setup.cfg"), "a") as f: - f.write(SAMPLE_CONFIG) - print(CONFIG_ERROR, file=sys.stderr) - return 1 - - print(" creating %s" % cfg.versionfile_source) - with open(cfg.versionfile_source, "w") as f: - LONG = LONG_VERSION_PY[cfg.VCS] - f.write(LONG % {"DOLLAR": "$", - "STYLE": cfg.style, - "TAG_PREFIX": cfg.tag_prefix, - "PARENTDIR_PREFIX": cfg.parentdir_prefix, - "VERSIONFILE_SOURCE": cfg.versionfile_source, - }) - - ipy = os.path.join(os.path.dirname(cfg.versionfile_source), - "__init__.py") - if os.path.exists(ipy): - try: - with open(ipy, "r") as f: - old = f.read() - except OSError: - old = "" - module = os.path.splitext(os.path.basename(cfg.versionfile_source))[0] - snippet = INIT_PY_SNIPPET.format(module) - if OLD_SNIPPET in old: - print(" replacing boilerplate in %s" % ipy) - with open(ipy, "w") as f: - f.write(old.replace(OLD_SNIPPET, snippet)) - elif snippet not in old: - print(" appending to %s" % ipy) - with open(ipy, "a") as f: - f.write(snippet) - else: - print(" %s unmodified" % ipy) - else: - print(" %s doesn't exist, ok" % ipy) - ipy = None - - # Make sure both the top-level "versioneer.py" and versionfile_source - # (PKG/_version.py, used by runtime code) are in MANIFEST.in, so - # they'll be copied into source distributions. Pip won't be able to - # install the package without this. - manifest_in = os.path.join(root, "MANIFEST.in") - simple_includes = set() - try: - with open(manifest_in, "r") as f: - for line in f: - if line.startswith("include "): - for include in line.split()[1:]: - simple_includes.add(include) - except OSError: - pass - # That doesn't cover everything MANIFEST.in can do - # (http://docs.python.org/2/distutils/sourcedist.html#commands), so - # it might give some false negatives. Appending redundant 'include' - # lines is safe, though. - if "versioneer.py" not in simple_includes: - print(" appending 'versioneer.py' to MANIFEST.in") - with open(manifest_in, "a") as f: - f.write("include versioneer.py\n") - else: - print(" 'versioneer.py' already in MANIFEST.in") - if cfg.versionfile_source not in simple_includes: - print(" appending versionfile_source ('%s') to MANIFEST.in" % - cfg.versionfile_source) - with open(manifest_in, "a") as f: - f.write("include %s\n" % cfg.versionfile_source) - else: - print(" versionfile_source already in MANIFEST.in") - - # Make VCS-specific changes. For git, this means creating/changing - # .gitattributes to mark _version.py for export-subst keyword - # substitution. - do_vcs_install(manifest_in, cfg.versionfile_source, ipy) - return 0 - - -def scan_setup_py(): - """Validate the contents of setup.py against Versioneer's expectations.""" - found = set() - setters = False - errors = 0 - with open("setup.py", "r") as f: - for line in f.readlines(): - if "import versioneer" in line: - found.add("import") - if "versioneer.get_cmdclass()" in line: - found.add("cmdclass") - if "versioneer.get_version()" in line: - found.add("get_version") - if "versioneer.VCS" in line: - setters = True - if "versioneer.versionfile_source" in line: - setters = True - if len(found) != 3: - print("") - print("Your setup.py appears to be missing some important items") - print("(but I might be wrong). Please make sure it has something") - print("roughly like the following:") - print("") - print(" import versioneer") - print(" setup( version=versioneer.get_version(),") - print(" cmdclass=versioneer.get_cmdclass(), ...)") - print("") - errors += 1 - if setters: - print("You should remove lines like 'versioneer.VCS = ' and") - print("'versioneer.versionfile_source = ' . This configuration") - print("now lives in setup.cfg, and should be removed from setup.py") - print("") - errors += 1 - return errors - - -if __name__ == "__main__": - cmd = sys.argv[1] - if cmd == "setup": - errors = do_setup() - errors += scan_setup_py() - if errors: - sys.exit(1)