def __getCodeInfo(self): try: self.__agentModule = __import__(self.__class__.__module__, globals(), locals(), "__doc__") except Exception as excp: self.log.exception("Cannot load agent module", lException=excp) if six.PY3: try: from importlib.metadata import version as get_version # pylint: disable=import-error,no-name-in-module import inspect self.__codeProperties["version"] = get_version( inspect.getmodule(self).__package__.split(".")[0]) except Exception: self.log.exception("Failed to find version for " + repr(self)) self.__codeProperties["version"] = "unset" else: try: self.__codeProperties["version"] = getattr( self.__agentModule, "__RCSID__") except Exception: self.log.error("Missing property __RCSID__") self.__codeProperties["version"] = "unset" try: self.__codeProperties["description"] = getattr( self.__agentModule, "__doc__") except Exception: self.log.error("Missing property __doc__") self.__codeProperties["description"] = "unset" self.__codeProperties["DIRACVersion"] = DIRAC.version self.__codeProperties["platform"] = DIRAC.getPlatform()
def version_info(): """ Version information. Prints the version information of the package. """ package = "bgpy" version = get_version(package) echo(f"{package} {version}")
def getVersion(): """Get a dictionary corresponding to the current version of the DIRAC package and all the installed extension packages """ vDict = {"Extensions": {}} for ext in extensionsByPriority(): version = get_version(ext) vDict["Extensions"][ext] = version return S_OK(vDict)
class environment(_Config): """ Read-only options regarding the platform and environment. Crawls runtime descriptive settings (e.g., default FreeSurfer license, execution environment, nipype and *MRIQC* versions, etc.). The ``environment`` section is not loaded in from file, only written out when settings are exported. This config section is useful when reporting issues, and these variables are tracked whenever the user does not opt-out using the ``--notrack`` argument. """ cpu_count = os.cpu_count() """Number of available CPUs.""" exec_docker_version = _docker_ver """Version of Docker Engine.""" exec_env = _exec_env """A string representing the execution platform.""" free_mem = _free_mem_at_start """Free memory at start.""" overcommit_policy = _oc_policy """Linux's kernel virtual memory overcommit policy.""" overcommit_limit = _oc_limit """Linux's kernel virtual memory overcommit limits.""" nipype_version = get_version("nipype") """Nipype's current version.""" templateflow_version = get_version("templateflow") """The TemplateFlow client version installed.""" total_memory = _memory_gb """Total memory available, in GB.""" version = __version__ """*MRIQC*'s version.""" _pre_mriqc = _pre_exec_env """Environment variables before MRIQC's execution."""
def getVersion(): """Get a dictionary corresponding to the current version of the DIRAC package and all the installed extension packages """ vDict = {"Extensions": {}} for ext in extensionsByPriority(): if six.PY2: try: version = importlib.import_module(ext).version except (ImportError, AttributeError): continue if ext.endswith("DIRAC") and ext != "DIRAC": ext = ext[: -len("DIRAC")] else: from importlib.metadata import version as get_version # pylint: disable=import-error,no-name-in-module version = get_version(ext) vDict["Extensions"][ext] = version return S_OK(vDict)
import sys if sys.version_info >= (3, 8): from importlib.metadata import version as get_version else: from importlib_metadata import version as get_version __version__ = get_version("pyborg")
source_suffix = ".rst" # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = "index" # General information about the project. project = "PyVISA-Py" author = "PyVISA Authors" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. version = get_version("pyvisa_py") release = version this_year = datetime.date.today().year copyright = "%s, %s" % (this_year, author) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and
from packaging.version import parse extensions = [ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx_autodoc_typehints", ] templates_path = ["_templates"] source_suffix = ".rst" master_doc = "index" project = "AnyIO" author = "Alex Grönholm" copyright = "2018, " + author v = parse(get_version("anyio")) version = v.base_version release = v.public language = None exclude_patterns = ["_build"] pygments_style = "sphinx" autodoc_default_options = {"members": True, "show-inheritance": True} todo_include_todos = False html_theme = "sphinx_rtd_theme" html_static_path = ["_static"] htmlhelp_basename = "anyiodoc" intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)}
from importlib.metadata import version as get_version from packaging.version import parse extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx_autodoc_typehints' ] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = 'smtpproto' author = 'Alex Grönholm' copyright = '2020, ' + author v = parse(get_version('smtpproto')) version = v.base_version release = v.public language = None exclude_patterns = ['_build'] pygments_style = 'sphinx' autodoc_default_options = {'members': True, 'show-inheritance': True} todo_include_todos = False html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] htmlhelp_basename = project + 'doc' intersphinx_mapping = {
source_suffix = ".rst" # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = "index" # General information about the project. project = "PyVISA-Py" author = "PyVISA Authors" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. version = get_version(project) release = version this_year = datetime.date.today().year copyright = "%s, %s" % (this_year, author) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and
# * Neither the name of the Parrot Company nor the names # of its contributors may be used to endorse or promote products # derived from this software without specific prior written # permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # Parrot internal version number try: from importlib.metadata import version as get_version from importlib.metadata import PackageNotFoundError except ImportError: from importlib_metadata import version as get_version from importlib_metadata import PackageNotFoundError try: __version__ = get_version("parrot-olympe") except PackageNotFoundError: __version__ = "0.0.0"
import os import sys from importlib.metadata import version as get_version sys.path.insert(0, os.path.abspath('../../')) sys.path.insert(0, os.path.abspath('./')) # -- Project information ----------------------------------------------------- project = 'inference-tools' copyright = '2019, Chris Bowman' author = 'Chris Bowman' # The full version, including alpha/beta/rc tags release = get_version(project) # Major.minor version version = ".".join(release.split(".")[:2]) # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.githubpages',
import os import sys from pathlib import Path from time import strftime from uuid import uuid4 try: # This option is only available with Python 3.8 from importlib.metadata import version as get_version except ImportError: from importlib_metadata import version as get_version # Ignore annoying warnings from mriqc._warnings import logging __version__ = get_version("mriqc") _pre_exec_env = dict(os.environ) # Reduce numpy's vms by limiting OMP_NUM_THREADS _default_omp_threads = int(os.getenv("OMP_NUM_THREADS", os.cpu_count())) # Disable NiPype etelemetry always _disable_et = bool( os.getenv("NO_ET") is not None or os.getenv("NIPYPE_NO_ET") is not None) os.environ["NIPYPE_NO_ET"] = "1" os.environ["NO_ET"] = "1" if not hasattr(sys, "_is_pytest_session"): sys._is_pytest_session = False # Trick to avoid sklearn's FutureWarnings # Disable all warnings in main and children processes only on production versions if not any((
# List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] # -- Project information ----------------------------------------------------- # See https://www.sphinx-doc.org/en/master/config.html#project-information project = "GeoVista" copyright_years = f"2021 - {datetime.datetime.now().year}" copyright = f"{copyright_years}, {project} Contributors" author = f"{project} Contributors" # The full version, including alpha/beta/rc tags release = get_version("geovista") if release.endswith("+dirty"): release = release[:-len("+dirty")] # The name of the Pygments (syntax highlighting) style to use. # https://pygments.org/styles/ pygments_style = "friendly" # -- Options for HTML output ------------------------------------------------- # See https://www.sphinx-doc.org/en/master/config.html#options-for-html-output # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = "pydata_sphinx_theme"
import os import sys root_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) sys.path.insert(0, root_path) sys.setrecursionlimit(1500) # -- Project information ----------------------------------------------------- project = "Wisconsin Autonomous Simulator" copyright = f"{date.today().year}, Wisconsin Autonomous" author = "Wisconsin Autonomous" # The full version, including alpha/beta/rc tags from importlib.metadata import version as get_version release = get_version('wa_simulator') # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ # "rinoh.frontend.sphinx", "sphinx.ext.napoleon", "sphinx.ext.autodoc", "sphinx.ext.todo", "sphinx.ext.viewcode", "autoapi.extension", "sphinx.ext.githubpages", "myst_parser",