コード例 #1
1
def test_pip_egg_info(tmpdir, monkeypatch):
    """if we are indeed a sdist, the root does not apply"""

    # we should get the version from pkg-info if git is broken
    p = tmpdir.ensure('sub/package', dir=1)
    tmpdir.mkdir('.git')
    p.join('setup.py').write(
        'from setuptools import setup;'
        'setup(use_scm_version={"root": ".."})')

    with pytest.raises(LookupError):
        get_version(root=p.strpath)

    p.ensure('pip-egg-info/random.egg-info/PKG-INFO').write('Version: 1.0')
    assert get_version(root=p.strpath) == '1.0'
コード例 #2
0
ファイル: integration.py プロジェクト: gh0std4ncer/pyscaffold
def pyscaffold_keyword(dist, keyword, value):
    """
    Handles the `use_pyscaffold` keyword of the setup(...) command

    :param dist: distribution object as :obj:`setuptools.dist`
    :param keyword: keyword argument = 'use_pyscaffold'
    :param value: value of the keyword argument
    """
    check_setuptools_version()
    if value:
        # If value is a dictionary we keep it otherwise use for configuration
        value = value if isinstance(value, dict) else dict()
        command_options = dist.command_options.copy()
        cmdclass = dist.cmdclass.copy()
        deactivate_pbr_authors_changelog()
        read_setup_cfg(dist, keyword, True)
        try:
            dist.metadata.version = get_version(
                version_scheme=value.get('version_scheme', version2str),
                local_scheme=value.get('local_scheme', local_version2str))
        except Exception as e:
            trace('error', e)
        # Adding old command classes and options since pbr seems to drop these
        dist.cmdclass['doctest'] = build_cmd_docs()
        dist.command_options['doctest'] = {'builder': ('setup.py', 'doctest')}
        dist.cmdclass['test'] = PyTest
        dist.cmdclass.update(cmdclass)
        dist.cmdclass.update(command_options)
コード例 #3
0
ファイル: setup.py プロジェクト: anthrotype/setuptools_scm
def scm_config():
    here = os.path.dirname(os.path.abspath(__file__))
    egg_info = os.path.join(here, 'setuptools_scm.egg-info')
    has_entrypoints = os.path.isdir(egg_info)

    sys.path.insert(0, here)
    from setuptools_scm.hacks import parse_pkginfo
    from setuptools_scm.git import parse as parse_git
    from setuptools_scm.version import (

        guess_next_dev_version,
        get_local_node_and_date,
    )

    def parse(root):
        try:
            return parse_pkginfo(root)
        except IOError:
            return parse_git(root)

    config = dict(
        version_scheme=guess_next_dev_version,
        local_scheme=get_local_node_and_date,
    )

    if has_entrypoints:
        return dict(use_scm_version=config)
    else:
        from setuptools_scm import get_version
        return dict(version=get_version(
            root=here, parse=parse, **config))
コード例 #4
0
ファイル: fabtasks.py プロジェクト: pobot-pybot/pybot-fabric
def inc_version_major(pkg='.'):
    """ Increment the version major number """
    with lcd(pkg):
        major, _ = get_version().split('.', 1)
        major = int(major) + 1
        tag = "%d.0.0" % major
        local('git tag %s -am "%s"' % (tag, tag))
コード例 #5
0
ファイル: crossbow.py プロジェクト: dremio/arrow
 def from_repo(cls, repo):
     assert isinstance(repo, Repo)
     version = get_version(repo.path, local_scheme=lambda v: '')
     return cls(head=str(repo.head.target),
                email=repo.email,
                branch=repo.branch.branch_name,
                remote=repo.remote_url,
                version=version)
コード例 #6
0
ファイル: fabtasks.py プロジェクト: pobot-pybot/pybot-fabric
def inc_version_build(pkg='.'):
    """ Increment the version build (aka patch) number """
    with lcd(pkg):
        major, minor, build_num, dirty = (get_version().split('.') + [''])[:4]
        if dirty.startswith('dev'):
            build_num = int(build_num)
        else:
            build_num = int(build_num) + 1
        tag = "%s.%s.%d" % (major, minor, build_num)
        local('git tag %s -am "%s"' % (tag, tag))
コード例 #7
0
ファイル: setup.py プロジェクト: kynan/pyscaffold
    def make_release_tree(self, base_dir, files):
        sdist_orig.make_release_tree(self, base_dir, files)
        target = os.path.join(base_dir, "setup.py")
        with open(__file__) as fp:
            template = fp.read()
        ver = self.distribution.version
        if not ver:
            from setuptools_scm import get_version

            ver = get_version(**scm_config())

        finalized = template.replace("use_scm_version=scm_config,\n", 'version="%s",\n' % ver)
        os.remove(target)
        with open(target, "w") as fp:
            fp.write(finalized)
コード例 #8
0
ファイル: integration.py プロジェクト: h0arry/pyscaffold
def pyscaffold_keyword(dist, keyword, value):
    """
    Handles the `use_pyscaffold` keyword of the setup(...) command

    :param dist: distribution object as :obj:`setuptools.dist`
    :param keyword: keyword argument = 'use_pyscaffold'
    :param value: value of the keyword argument
    """
    _warn_if_setuptools_outdated()
    if value is True:
        deactivate_pbr_authors_changelog()
        read_setup_cfg(dist, keyword, value)
        try:
            dist.metadata.version = get_version(version_scheme=version2str,
                                                local_scheme=local_version2str)
        except Exception as e:
            trace('error', e)
        # Adding doctest again since PBR seems to drop these
        dist.cmdclass['doctest'] = build_cmd_docs()
        dist.command_options['doctest'] = {'builder': ('setup.py', 'doctest')}
コード例 #9
0
ファイル: tasks.py プロジェクト: obitec/dstack-tasks
def release_code(ctx, project_name=None, version=None, upload=True, push=False, static=True, build=True):
    """Tag, build and optionally push and upload new project release

    """
    # TODO set project name in ctx
    project_name = project_name or os.path.basename(os.getcwd()).replace('-', '_')
    scm_version = get_version()
    version = version or '.'.join(scm_version.split('.')[:3])

    if build:
        print(f'Git version: {scm_version}')
        if len(scm_version.split('.')) > 4:
            print('First commit all changes, then run this task again')
            return False

        if scm_version != version:
            git(ctx, f'tag v{version}')

        # Clean and build
        do(ctx, cmd='rm -rf build/')
        python(ctx, cmd='setup.py bdist_wheel', conda_env=True)

    if push:
        git(ctx, f'push origin v{version}')

    if upload:
        s3cmd(ctx,
              simple_path=f'dist/{project_name}-{version}-py3-none-any.whl', direction='up', project_name=project_name)

    if static:
        excludes = '--exclude=' + ' --exclude='.join(['"*.less"', '"*.md"', '"ckeditor/"'])
        do(ctx, f'webpack', path='src/assets/')
        python(ctx, f'./src/manage.py collectstatic --no-input -v0', conda_env=True)
        # do(ctx, f'rm -rf .local/static/ckeditor/')
        if upload:
            do(ctx, f'tar -zcvf .local/static_v{version}.tar.gz {excludes} -C .local/static/ .')
            s3cmd(ctx, local_path=f'.local/static_v{version}.tar.gz', s3_path=f'{project_name}/static/')
コード例 #10
0
def main():
    logging.basicConfig(level=logging.DEBUG)
    parser = OptionParser(
            usage="%prog --dir path/to/dir --lines lines.png [options] path/to/image",
            version=get_version(),
            description="Cut a picture into pieces by cutting along pixel lines")

    parser.add_option("--dir", "-d",
            action="store",
            type="string",
            help="Set the directory to store the clip files in.",)
    parser.add_option("--lines", "-l",
            action="store",
            type="string",
            help="Set the lines file.",)

    (options, args) = parser.parse_args()

    if not args and not (options.dir and options.lines):
        parser.error("Must set a directory and lines file with an image")

    handler = Handler(options.dir, options.lines)
    for image in args:
        handler.process(image)
コード例 #11
0
import distutils.command.build_py
import distutils.command.sdist
import distutils.core
from distutils.core import setup
import distutils.log
from glob import glob
from pathlib import Path
import string
try:
    import distutils_pytest
except ImportError:
    pass
try:
    import setuptools_scm
    version = setuptools_scm.get_version()
    with open(".version", "wt") as f:
        f.write(version)
except (ImportError, LookupError):
    try:
        with open(".version", "rt") as f:
            version = f.read()
    except OSError:
        distutils.log.warn("warning: cannot determine version number")
        version = "UNKNOWN"

doclines = __doc__.strip().split("\n")


class init_py(distutils.core.Command):
コード例 #12
0
ファイル: conf.py プロジェクト: jaraco/nat-pmp
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import setuptools_scm

extensions = [
    'sphinx.ext.autodoc',
]

# General information about the project.
project = 'nat-pmp'
copyright = '2015 Jason R. Coombs'

# The short X.Y version.
version = setuptools_scm.get_version(root='..')
# The full version, including alpha/beta/rc tags.
release = version

master_doc = 'index'
コード例 #13
0
 def set_version(self):
     from setuptools_scm import get_version
     self.release = get_version()
     self.version = self.release.split('-', 1)[0]
コード例 #14
0
ファイル: setup.py プロジェクト: keirf/Greaseweazle
def version():
    version = get_version()
    with open('src/greaseweazle/__init__.py', 'w') as f:
        f.write('__version__ = \'%s\'\n' % version)
    return version
コード例 #15
0
ファイル: setup.py プロジェクト: tylerbutler/propane
    def run(self):
        from setuptools_scm import get_version

        print('Current version is: ' + get_version(root='.', relative_to=__file__))
コード例 #16
0
def test_pretended(version, monkeypatch):
    monkeypatch.setenv(setuptools_scm.PRETEND_KEY, version)
    assert setuptools_scm.get_version() == version
コード例 #17
0
master_doc = 'index'

# General information about the project.
project = 'Ibex Documentation'
copyright = '2017-2018, ETH Zurich and University of Bologna, 2018-present lowRISC'
author = 'lowRISC contributors'

# 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.
#
# The short X.Y version.
version = ''
# The full version, including alpha/beta/rc tags.
from setuptools_scm import get_version
release = get_version(root=topsrcdir)

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'venv']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
コード例 #18
0
ファイル: conf.py プロジェクト: XD-embedded/xd-docker
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'XD Docker'
copyright = '2016, Esben Haabendal'
author = 'Esben Haabendal'

# 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.
#
from setuptools_scm import get_version
from setuptools_scm.version import postrelease_version
# The full version, including alpha/beta/rc tags.
release = get_version('..', version_scheme=postrelease_version)
# The short X.Y version.
version = '.'.join(release.split('.')[:2])

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
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'
コード例 #19
0
def test_root_relative_to(monkeypatch):
    assert_root(monkeypatch, '/tmp/alt')
    __file__ = '/tmp/module/file.py'
    setuptools_scm.get_version(root='../alt', relative_to=__file__)
コード例 #20
0
ファイル: conf.py プロジェクト: jeromekelleher/msprime
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'msprime'
copyright = '2015-2019, Jerome Kelleher'
author = 'Jerome Kelleher'

# 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.
#
try:
    from setuptools_scm import get_version
    release = get_version(root='..', relative_to=__file__)
    version = release[:3]
except pkg_resources.DistributionNotFound:
    release = "0.0.0"
    version = "0.0.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
コード例 #21
0
def test_pretended(monkeypatch):
    pretense = '2345'
    monkeypatch.setenv(setuptools_scm.PRETEND_KEY, pretense)
    assert setuptools_scm.get_version() == pretense
コード例 #22
0
def test_root_parameter_pass_by(monkeypatch):
    assert_root(monkeypatch, '/tmp')
    setuptools_scm.get_version(root='/tmp')
コード例 #23
0
ファイル: setup.py プロジェクト: larsyencken/cjktools
#  cjktools
#

"""
Package setup file for the cjktools package.
"""

import sys
from setuptools import setup

from scripts.load_as_rst import convert

try:
    from setuptools_scm import get_version

    VERSION = get_version()

    with open('cjktools/__version__.py', 'w') as f:
        f.write('# Autogenerated by setup.py\n')
        f.write('version = "%s"\n' % VERSION)

except ImportError:
    pass

LONG_DESCRIPTION = convert('README.md', strict=False)

# For Python <= 3.4, we need to pull in the backport of enum
REQUIRES = ['six']
if sys.version_info < (3, 4, 0):
    REQUIRES.append('enum34')
コード例 #24
0
# -*- coding: utf-8 -*-
# @Author: p-chambers
# @Date:   2016-10-05 14:35:02
# @Last Modified by:   p-chambers
# @Last Modified time: 2016-10-05 15:30:29

import os
from setuptools_scm import get_version


version = get_version(root=os.path.join('..', '..'), relative_to=__file__)

os.environ['OCC_AIRCONICS_VERSION'] = version
コード例 #25
0
    keywords="cli zeroae",
    name="zeroae-cli",
    packages=find_namespace_packages(include=["zeroae.*"]),
    setup_requires=setup_requirements,
    test_suite="tests",
    tests_require=test_requirements,
    extras_require={
        # fmt: off
        "test": test_requirements
        # fmt: on
    },
    url="https://github.com/zeroae/zeroae-cli",
    zip_safe=False,
)

if "CONDA_BUILD_STATE" in os.environ:
    try:
        from setuptools_scm import get_version

        setup_kwargs["version"] = get_version(
            **setup_kwargs["use_scm_version"])
        del setup_kwargs["use_scm_version"]
    except ModuleNotFoundError:
        print(
            "Error: zeroae-cli requires that setuptools_scm be installed with conda-build!"  # noqa: E501
        )
        raise
    setup_kwargs["conda_rosetta_stone"] = conda_rosetta_stone

setup(**setup_kwargs)
コード例 #26
0
ファイル: setup.py プロジェクト: brian-team/brian2tools
                        'setuptools',
                        'setuptools_scm'],
      provides=['brian2tools'],
      extras_require={'test': ['pytest'],
                      'docs': ['sphinx>=1.0.1', 'sphinxcontrib-issuetracker',
                               'mock']},
      use_2to3=False,
      description='Tools for the Brian 2 simulator',
      long_description=readme(),
      author='Marcel Stimberg, Dan Goodman, Romain Brette',
      author_email='*****@*****.**',
      license='CeCILL-2.1',
      classifiers=[
          'Development Status :: 4 - Beta',
          'Intended Audience :: Science/Research',
          'License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)',
          'Natural Language :: English',
          'Operating System :: OS Independent',
          'Programming Language :: Python',
          'Programming Language :: Python :: 2',
          'Programming Language :: Python :: 3',
          'Topic :: Scientific/Engineering :: Bio-Informatics'
      ],
      keywords='visualization neuroscience'
      )

# If we are building a conda package, we write the version number to a file
if 'CONDA_BUILD' in os.environ and 'RECIPE_DIR' in os.environ:
    from setuptools_scm import get_version
    get_version(write_to='__conda_version__.txt')
コード例 #27
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import setuptools_scm

extensions = [
    'sphinx.ext.autodoc',
]

# General information about the project.
project = 'backports.functools_lru_cache'
copyright = '2015 Jason R. Coombs'

# The short X.Y version.
version = setuptools_scm.get_version(root='..', relative_to=__file__)
# The full version, including alpha/beta/rc tags.
release = version

master_doc = 'index'
コード例 #28
0
ファイル: setup.py プロジェクト: brean/txtrpacker
        def set_version(self):
            from setuptools_scm import get_version

            self.release = get_version()
            self.version = self.release.split("-", 1)[0]
コード例 #29
0
ファイル: __init__.py プロジェクト: openshift/doozer
def version():
    return get_version(
        root=os.path.abspath(
            os.path.join(os.path.dirname(__file__), '..')
        )
    )
コード例 #30
0
def test_root_parameter_pass_by(monkeypatch, tmpdir):
    assert_root(monkeypatch, tmpdir)
    setuptools_scm.get_version(root=tmpdir.strpath)
コード例 #31
0
ファイル: __init__.py プロジェクト: ulricheck/arrow
    # Package is not installed, parse git tag at runtime
    try:
        import setuptools_scm

        # Code duplicated from setup.py to avoid a dependency on each other
        def parse_git(root, **kwargs):
            """
            Parse function for setuptools_scm that ignores tags for non-C++
            subprojects, e.g. apache-arrow-js-XXX tags.
            """
            from setuptools_scm.git import parse
            kwargs['describe_command'] = \
                "git describe --dirty --tags --long --match 'apache-arrow-[0-9].*'"
            return parse(root, **kwargs)

        __version__ = setuptools_scm.get_version('../', parse=parse_git)
    except ImportError:
        __version__ = None

import pyarrow.compat as compat

from pyarrow.lib import cpu_count, set_cpu_count
from pyarrow.lib import (
    null, bool_, int8, int16, int32, int64, uint8, uint16, uint32, uint64,
    time32, time64, timestamp, date32, date64, float16, float32, float64,
    binary, string, utf8, large_binary, large_string, large_utf8, decimal128,
    list_, large_list, struct, union, dictionary, field, type_for_alias,
    DataType, DictionaryType, StructType, ListType, LargeListType, UnionType,
    TimestampType, Time32Type, Time64Type, FixedSizeBinaryType, Decimal128Type,
    BaseExtensionType, ExtensionType, UnknownExtensionType, DictionaryMemo,
    Field, Schema, schema, Array, Tensor, array, chunked_array, record_batch,
コード例 #32
0
def test_root_relative_to(monkeypatch, tmpdir):
    assert_root(monkeypatch, tmpdir.join("alt").strpath)
    __file__ = tmpdir.join("module/file.py").strpath
    setuptools_scm.get_version(root="../alt", relative_to=__file__)
コード例 #33
0
ファイル: conf.py プロジェクト: jcpettina/python-escpos-jcp
master_doc = 'index'

# General information about the project.
project = u'python-escpos'
copyright = u'2016, Manuel F Martinez and others'

# 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.
#
if on_rtd:
    # The full version, including alpha/beta/rc tags.
    release = escpos.__version__
else:
    # locally setuptools_scm should work
    release = get_version(root=root)
# The short X.Y version.
version = '.'.join(release.split('.')[:2])  # The short X.Y version.

# 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
# directories to ignore when looking for source files.
コード例 #34
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os

# third party imports
import h5py
from setuptools_scm import get_version

# local imports
from .stream_workspace import StreamWorkspace

TIMEPAT = "[0-9]{4}-[0-9]{2}-[0-9]{2}T"
VERSION = get_version(
    root=os.path.join(os.pardir, os.pardir, os.pardir), relative_to=__file__
)


def is_asdf(filename, config=None):
    """Verify that the input file is an ASDF file.

    Args:
        filename (str):
            Path to candidate ASDF file.
        config (dict):
            Dictionary containing configuration.

    Returns:
        bool: True if ASDF, False if not.
    """
    try:
コード例 #35
0
import contextlib

__version__ = None
try:
    from api._version import version as __version__
except ImportError:
    with contextlib.suppress(ImportError, LookupError):
        from setuptools_scm import get_version
        __version__ = get_version(root='..', relative_to=__file__)
コード例 #36
0
# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'sshuttle'
copyright = '2016, Brian May'

# 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.
#
# The short X.Y version.
version = get_version(root="..")
# The full version, including alpha/beta/rc tags.
release = version

# 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
# directories to ignore when looking for source files.
コード例 #37
0
ファイル: conftest.py プロジェクト: Jallasia/setuptools_scm
 def version(self):
     __tracebackhide__ = True
     from setuptools_scm import get_version
     version = get_version(root=str(self.cwd))
     print(version)
     return version
コード例 #38
0
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

# flake8: noqa

from pkg_resources import get_distribution, DistributionNotFound
try:
    __version__ = get_distribution(__name__).version
except DistributionNotFound:
    # package is not installed
    try:
        import setuptools_scm
        __version__ = setuptools_scm.get_version('../')
    except (ImportError, LookupError):
        __version__ = None

from pyarrow.lib import cpu_count, set_cpu_count
from pyarrow.lib import (
    null, bool_, int8, int16, int32, int64, uint8, uint16, uint32, uint64,
    time32, time64, timestamp, date32, date64, float16, float32, float64,
    binary, string, decimal, list_, struct, dictionary, field, DataType,
    NAType, Field, Schema, schema, Array, Tensor, array, from_numpy_dtype,
    NullArray, NumericArray, IntegerArray, FloatingPointArray, BooleanArray,
    Int8Array, UInt8Array, Int16Array, UInt16Array, Int32Array, UInt32Array,
    Int64Array, UInt64Array, ListArray, BinaryArray, StringArray,
    FixedSizeBinaryArray, DictionaryArray, Date32Array, Date64Array,
    TimestampArray, Time32Array, Time64Array, DecimalArray, StructArray,
    ArrayValue, Scalar, NA, BooleanValue, Int8Value, Int16Value, Int32Value,
コード例 #39
0
ファイル: base.py プロジェクト: obitec/dstack-tasks
conf = Config()
env = Environment(config=conf, prefix='')
env.load()

# Global config
env.log_level = logging.INFO
env.pwd = os.getcwd()
env.src = os.path.join(env.pwd, 'src')
env.directory = os.path.basename(env.pwd)
env.remote = False
env.dry_run = False

# Attempt to get a version number
try:
    # env.version = get_version(root='.', relative_to=env.pwd)
    env.version = get_version()
except LookupError:
    try:
        with open(os.path.join(env.src, 'version.txt')) as f:
            env.version = f.readline().strip()
    except FileNotFoundError:
        env.version = os.getenv('VERSION', '0.0.0-dev')

env.tag = env.version

LOCAL_PREFIX = colorama.Fore.YELLOW + '[local]' + colorama.Fore.RESET
REMOTE_PREFIX = colorama.Fore.RED + '[remote]' + colorama.Fore.RESET


@task
def t1(ctx):
コード例 #40
0
ファイル: setup.py プロジェクト: tdegeus/GooseFEM
                # CMake 3.12+ only.
                build_args += ["-j{}".format(self.parallel)]

        if not os.path.exists(self.build_temp):
            os.makedirs(self.build_temp)

        subprocess.check_call(["cmake", ext.sourcedir] + cmake_args,
                              cwd=self.build_temp)
        subprocess.check_call(["cmake", "--build", "."] + build_args,
                              cwd=self.build_temp)


# ==================================================================
# Actual setup
# ==================================================================

setup(
    name='GooseFEM',
    description='Finite element meshes, quadrature, and assembly tools',
    long_description='Finite element meshes, quadrature, and assembly tools',
    version=get_version(),
    license='GPLv3',
    author='Tom de Geus',
    author_email='*****@*****.**',
    url='https://github.com/tdegeus/GooseFEM',
    setup_requires=['setuptools_scm'],
    ext_modules=[CMakeExtension("GooseFEM")],
    cmdclass={"build_ext": CMakeBuild},
    zip_safe=False,
)
コード例 #41
0
ファイル: versions.py プロジェクト: zakv/labscript-utils
def get_version(import_name, project_name=None, import_path=None):
    """Try very hard to get the version of a package without importing it. 
    
    If import_path is not given, first find where it would be imported from, without
    importing it. Then look for metadata in the same import path with the given project
    name (note: this is not always the same as the import name, it is the name for
    example you would ask pip to install). If that is found, return the version info
    from it. Otherwise look for a :code:`__version__.py` file in the package directory,
    or a :code:`__version__ = <version>` literal defined in the package source (without
    executing it).

    Args:
        import_name (str): The module name.
        project_name (str, optional): The package name (e.g. the name used when pip
            installing the package). This must be specified if it does not match the
            module name.
        import_path (str, optional): The path to the folder containing the installed
            package.

    Raises:
        NotImplementedError: Raised if the module name contains a period. Only 
            top-level packages are supported at this time.

    Returns: 
        The version literal of the package. 
        If the package cannot be found, :class:`NotFound` is returned. 
        If the version cannot be obtained in the above way, or if the version was found
        but was :code:`None`, :class:`NoVersionInfo` is returned.
    """
    if project_name is None:
        project_name = import_name
    if '.' in import_name:
        msg = "Version checking of top-level packages only implemented"
        raise NotImplementedError(msg)
    if import_path is None:
        # Find the path where the module lives:
        try:
            import_path = get_import_path(import_name)
        except ImportError:
            return NotFound
    if not os.path.exists(os.path.join(import_path, import_name)):
        return NotFound
    try:
        # Check if setuptools_scm gives us a version number, for the case that it's a
        # git repo or PyPI tarball:
        return setuptools_scm.get_version(import_path)
    except LookupError:
        pass
    # Check if importlib_metadata knows about this module:
    version = _get_metadata_version(project_name, import_path)
    if version is not None:
        return version
    # Check if it has a version literal defined in a __version__.py file:
    version_dot_py = os.path.join(import_path, import_name, '__version__.py')
    version = _get_literal_version(version_dot_py)
    if version is not None:
        return version
    # check if it has a __version__ literal defined in its main module.
    pkg = os.path.join(import_path, import_name)
    if os.path.isdir(pkg):
        module_file = os.path.join(pkg, '__init__.py')
    else:
        module_file = pkg + '.py'
    version = _get_literal_version(module_file)
    if version is not None:
        return version
    return NoVersionInfo
コード例 #42
0
""" Timeflux """

# Fix Ctrl-C handling in Windows
import os

os.environ["FOR_DISABLE_CONSOLE_CTRL_HANDLER"] = "1"

# Versioning
try:
    from setuptools_scm import get_version

    __version__ = get_version(root="..", relative_to=__file__)
except:
    try:
        from .version import version

        __version__ = version
    except:
        __version__ = "0.0.0"
コード例 #43
0
sys.path.insert(0, os.path.abspath('..'))

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.napoleon'
]

napoleon_google_docstring = True
napoleon_numpy_docstring = False


source_suffix = '.rst'

master_doc = 'index'

project = u'Smartsheet Python SDK'
copyright = u'Copyright 2016 Smartsheet.com, Inc.'

version = get_version(root="../")
release = get_version(root="../")

exclude_patterns = ['_build']
html_static_path = ['_static']
pygments_style = 'sphinx'

html_theme = 'sphinx_rtd_theme'

html_show_sourcelink = False
html_show_sphinx = False
htmlhelp_basename = 'Smartsheetdoc'
コード例 #44
0
'''
Tools for use with the Brian 2 simulator.
'''
import os
import warnings

from .plotting import *
from .nmlexport import *
from .tests import run as test
from .baseexport import *
from .mdexport import *

from pkg_resources import get_distribution, DistributionNotFound
try:
    __version__ = get_distribution(__name__).version
except DistributionNotFound:
    # Apparently we are running directly from a git clone, let
    # setuptools_scm fetch the version from git
    try:
        from setuptools_scm import get_version
        __version__ = get_version(relative_to=os.path.dirname(__file__))
    except (ImportError, LookupError):
        warnings.warn('Cannot determine brian2tools version')
        __version__ = None
コード例 #45
0
ファイル: setup.py プロジェクト: jochym/Elastic
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages
from setuptools_scm import get_version

ver = get_version().split('+')[0].split('.')

if ver[-1].startswith('dev'):
    ver[-1] = ver[-1][3:]
    ver[-2] = str(int(ver[-2])-1)

ver = '.'.join(ver)

print("Building version:", ver)

setup(
    name='elastic',
    version=ver,
    packages=find_packages(),
    license='GPLv3',
    description='Extension for ASE to calculate elastic constants',
    long_description=open('README.md', 'rb').read().decode('utf-8'),
    long_description_content_type='text/markdown',
    author='Paweł T. Jochym',
    author_email='*****@*****.**',
    url='https://github.com/jochym/Elastic',
    keywords=['science', 'physics', 'ase', 'elastic constants', 'crystals'],
    requires=['click', 'spglib', 'numpy', 'scipy', 'ase'],
    setup_requires=['docutils', 'sphinx', 'setuptools_scm'],
    provides=['elastic', 'parcalc'],
    platforms=['all'],
コード例 #46
0
ファイル: _version.py プロジェクト: sr735/slackmoji
# Default version file -- DO NOT CHANGE, gets overwritten by setuptools_scm

from setuptools_scm import get_version

version = get_version()
コード例 #47
0
 def get_schema(self, *args, **kwargs):
     schema = super().get_schema(*args, **kwargs)
     schema['info']['title'] = settings.NAVBAR_TITLE_TEXT
     schema['info']['description'] = 'API documentation for the OCS Science Archive'
     schema['info']['version'] = get_version(version_scheme=version_scheme, local_scheme='no-local-version')
     return schema
コード例 #48
0
ファイル: conf.py プロジェクト: larsyencken/cjktools
master_doc = 'index'

# General information about the project.
project = 'cjktools'
copyright = '2016, Lars Yencken'
author = 'Lars Yencken'

# 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.
#

from setuptools_scm import get_version

# The full version, including alpha/beta/rc tags.
release = get_version(root='../..')

# The short X.Y version.
version = '.'.join(release.split('.')[:2])

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
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.
コード例 #49
0
# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Neuronal Dynamics Exercises'
copyright = u'2016, EPFL-LCN'
author = u'EPFL-LCN'

# 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(root='../.')
# The full version, including alpha/beta/rc tags.
release = get_version(root='../.')

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
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'
コード例 #50
0
ファイル: setup.py プロジェクト: atztogo/phonopy
    from setuptools import setup, Extension
    use_setuptools = True
    print("setuptools is used.")
except ImportError:
    from distutils.core import setup, Extension
    use_setuptools = False
    print("distutils is used.")

try:
    from setuptools_scm import get_version
except ImportError:
    git_num = None

if 'setuptools_scm' in sys.modules.keys():
    try:
        git_ver = get_version()
        git_num = int(git_ver.split('.')[3].split('+')[0].replace("dev", ""))
    except:
        git_num = None

include_dirs_numpy = [numpy.get_include()]

cc = None
if 'CC' in os.environ:
    if 'clang' in os.environ['CC']:
        cc = 'clang'
    if 'gcc' in os.environ['CC']:
        cc = 'gcc'

# Workaround Python issue 21121
config_var = sysconfig.get_config_var("CFLAGS")
コード例 #51
0
ファイル: setup.py プロジェクト: lxf-gzu/phonopy
    from setuptools import setup, Extension
    use_setuptools = True
    print("setuptools is used.")
except ImportError:
    from distutils.core import setup, Extension
    use_setuptools = False
    print("distutils is used.")

try:
    from setuptools_scm import get_version
except ImportError:
    git_num = None

if 'setuptools_scm' in sys.modules.keys():
    try:
        git_ver = get_version()
        git_num = int(git_ver.split('.')[3].split('+')[0].replace("dev", ""))
    except:
        git_num = None

include_dirs_numpy = [numpy.get_include()]

cc = None
if 'CC' in os.environ:
    if 'clang' in os.environ['CC']:
        cc = 'clang'
    if 'gcc' in os.environ['CC']:
        cc = 'gcc'

# Workaround Python issue 21121
config_var = sysconfig.get_config_var("CFLAGS")
コード例 #52
0
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'asciimatics'
# noinspection PyShadowingBuiltins
copyright = u'2015-16, Peter Brittain'

# 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.
#
# Use setuptools_scm to get detailed patch versions.
base_version = get_version(root='../..', relative_to=__file__)
# The full version, including alpha/beta/rc tags.
release = '.'.join(base_version.split('.')[:3])
# The short X.Y version.
version = '.'.join(release.split('.')[:2])

# 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'
コード例 #53
0
from pkg_resources import get_distribution, DistributionNotFound
from setuptools_scm import get_version
import warnings

try:
    try:
        _dist_info = get_distribution(__name__)
        __version__ = _dist_info.version
        # the following fails with a local repo with an egg in it
        assert __file__.lower().startswith(_dist_info.location.lower())
    except (DistributionNotFound, AssertionError):
        # this might be a local git repo
        __version__ = get_version(root='..', relative_to=__file__)
except Exception:
    warnings.warn(
        'Failed to find skare3_tools package version, setting to 0.0.0')
    __version__ = '0.0.0'
コード例 #54
0
ファイル: __init__.py プロジェクト: emkornfield/arrow
    from ._generated_version import version as __version__
except ImportError:
    # Package is not installed, parse git tag at runtime
    try:
        import setuptools_scm
        # Code duplicated from setup.py to avoid a dependency on each other
        def parse_git(root, **kwargs):
            """
            Parse function for setuptools_scm that ignores tags for non-C++
            subprojects, e.g. apache-arrow-js-XXX tags.
            """
            from setuptools_scm.git import parse
            kwargs['describe_command'] = \
                "git describe --dirty --tags --long --match 'apache-arrow-[0-9].*'"
            return parse(root, **kwargs)
        __version__ = setuptools_scm.get_version('../',
                                                 parse=parse_git)
    except ImportError:
        __version__ = None


import pyarrow.compat as compat

from pyarrow.lib import cpu_count, set_cpu_count
from pyarrow.lib import (null, bool_,
                         int8, int16, int32, int64,
                         uint8, uint16, uint32, uint64,
                         time32, time64, timestamp, date32, date64,
                         float16, float32, float64,
                         binary, string, utf8, decimal128,
                         list_, struct, union, dictionary, field,
                         type_for_alias,
コード例 #55
0
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.autosummary',
    'sphinx.ext.mathjax',
    'numpydoc',
    #'sphinx.ext.graphviz'
]

source_suffix = '.rst'

master_doc = 'index'

project = u'JiTCDDE'
copyright = u'2016, Gerrit Ansmann'

release = version = get_version(root='..', relative_to=__file__)

default_role = "any"

add_function_parentheses = True

add_module_names = False

html_theme = 'pyramid'
pygments_style = 'colorful'
#html_theme_options = {}
htmlhelp_basename = 'JiTCDDEdoc'

numpydoc_show_class_members = False
autodoc_member_order = 'bysource'
コード例 #56
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import setuptools_scm

extensions = [
    'sphinx.ext.autodoc',
]

# General information about the project.
project = 'jaraco.functools'
copyright = '2015 Jason R. Coombs'

# The short X.Y version.
version = setuptools_scm.get_version(root='..', relative_to=__file__)
# The full version, including alpha/beta/rc tags.
release = version

master_doc = 'index'
コード例 #57
0
def test_parse_plain_fails(recwarn):
    def parse(root):
        return "tricked you"

    with pytest.raises(TypeError):
        setuptools_scm.get_version(parse=parse)
コード例 #58
0
ファイル: conf.orig.py プロジェクト: brianmay/resume
# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'Brian May'
copyright = '2016, Brian May'

# 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.
#
# The short X.Y version.
version = get_version(root="..")
# The full version, including alpha/beta/rc tags.
release = version

# 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
# directories to ignore when looking for source files.
コード例 #59
0
def test_root_parameter_creation(monkeypatch):
    assert_root(monkeypatch, os.getcwd())
    setuptools_scm.get_version()