Пример #1
0
 def test_version_dev_wo_pep440_git_describe(self):
     v105 = Version(release=(1,0,5), dev=4)
     v105._update_from_vcs('v1.0.6dev4-42-gabcdefgh')
     self.assertEqual(v105.release, (1,0,6))
     self.assertEqual(v105.commit_count, 42)
     self.assertEqual(v105.dev, 4)
     self.assertEqual(v105.commit, 'abcdefgh')
Пример #2
0
 def test_version_simple_git_describe(self):
     v105 = Version(release=(1,0,5))
     v105._update_from_vcs('v1.0.5-42-gabcdefgh')
     self.assertEqual(v105.release, (1,0,5))
     self.assertEqual(v105.commit_count, 42)
     self.assertEqual(v105.dev, None)
     self.assertEqual(v105.commit, 'abcdefgh')
Пример #3
0
def get_setup_version(reponame):
    """Use autover to get up to date version."""
    # importing self into setup.py is unorthodox, but param has no
    # required dependencies outside of python
    from param.version import Version
    return Version.setup_version(os.path.dirname(__file__),
                                 reponame,
                                 archive_commit="$Format:%h$")
Пример #4
0
Callable objects that generate numbers according to different distributions.
"""

import random
import operator
import hashlib
import struct
import fractions

from math import e, pi

import param

from param.version import Version
__version__ = Version(release=(1, 3, 2),
                      fpath=__file__,
                      commit="1459880",
                      reponame="param")


class TimeAware(param.Parameterized):
    """
    Class of objects that have access to a global time function
    and have the option of using it to generate time-dependent values
    as necessary.

    In the simplest case, an object could act as a strict function of
    time, returning the current time transformed according to a fixed
    equation.  Other objects may support locking their results to a
    timebase, but also work without time.  For instance, objects with
    random state could return a new random value for every call, with
    no notion of time, or could always return the same value until the
Пример #5
0
from param.version import Version

__version__ = str(
    Version(fpath=__file__, archive_commit="66e9a311", reponame="pkg_params"))
Пример #6
0
Callable objects that generate numbers according to different distributions.
"""

import random
import operator
import hashlib
import struct
import fractions

from math import e, pi

import param

from param.version import Version
__version__ = Version(release=(1, 5, 1),
                      fpath=__file__,
                      commit="aa087db2",
                      reponame="param")


class TimeAware(param.Parameterized):
    """
    Class of objects that have access to a global time function
    and have the option of using it to generate time-dependent values
    as necessary.

    In the simplest case, an object could act as a strict function of
    time, returning the current time transformed according to a fixed
    equation.  Other objects may support locking their results to a
    timebase, but also work without time.  For instance, objects with
    random state could return a new random value for every call, with
    no notion of time, or could always return the same value until the
Пример #7
0
 def test_version_init_v1(self):
     Version(release=(1, 0))
Пример #8
0
 def test_version_greater_than(self):
     v1 = Version(release=(1, 0))
     v101 = Version(release=(1, 0, 1))
     self.assertEqual((v1 > v101), False)
Пример #9
0
 def test_version_commit(self):
     "No version control system assumed for tests"
     v1 = Version(release=(1, 0), commit='shortSHA')
     self.assertEqual(v1.commit, 'shortSHA')
Пример #10
0
 def test_version_v101_dirty(self):
     v101 = Version(release=(1, 0, 1))
     self.assertEqual(v101.dirty, False)
Пример #11
0
from param.version import Version
__version__ = str(
    Version(fpath=__file__, archive_commit="$Format:%h$", reponame="pyct"))
del Version
Пример #12
0
def get_setup_version(reponame):
    """Use autover to get up to date version."""
    # importing self into setup.py is unorthodox, but param has no
    # required dependencies outside of python
    from param.version import Version
    return Version.setup_version(os.path.dirname(__file__),reponame,archive_commit="$Format:%h$")
Пример #13
0
 def test_version_str_v1dev3(self):
     v1 = Version(release=(1,0),dev=3)
     self.assertEqual(str(v1), '1.0.dev3')
Пример #14
0
 def test_version_neq_v101_dev(self):
     v101dev2 = Version(release=(1,0,1), dev=2)
     v101dev3 = Version(release=(1,0,1), dev=3)
     self.assertEqual(v101dev2!=v101dev3, True)
Пример #15
0
 def test_version_greater_than_dev(self):
     v101 = Version(release=(1,0,1))
     v102dev3 = Version(release=(1,0,2), dev=3)
     self.assertEqual((v102dev3 > v101), True)
Пример #16
0
 def test_version_str_v101(self):
     v101 = Version(release=(1, 0, 1))
     self.assertEqual(str(v101), '1.0.1')
Пример #17
0
Callable objects that generate numbers according to different distributions.
"""

import random
import operator
import hashlib
import struct
import fractions

from math import e, pi

import param

from param.version import Version
__version__ = Version(release=(1, 5, 1),
                      fpath=__file__,
                      commit="39b370df",
                      reponame="param")


class TimeAware(param.Parameterized):
    """
    Class of objects that have access to a global time function
    and have the option of using it to generate time-dependent values
    as necessary.

    In the simplest case, an object could act as a strict function of
    time, returning the current time transformed according to a fixed
    equation.  Other objects may support locking their results to a
    timebase, but also work without time.  For instance, objects with
    random state could return a new random value for every call, with
    no notion of time, or could always return the same value until the
Пример #18
0
 def test_version_v101_commit_count(self):
     v101 = Version(release=(1, 0, 1))
     self.assertEqual(v101.commit_count, 0)
Пример #19
0
 def test_repr_v1(self):
     v1 = Version(release=(1, 0))
     self.assertEqual(repr(v1), '1.0')
Пример #20
0
 def test_version_less_than(self):
     v1 = Version(release=(1, 0))
     v101 = Version(release=(1, 0, 1))
     self.assertEqual((v1 < v101), True)
Пример #21
0
 def test_repr_v101(self):
     v101 = Version(release=(1, 0, 1), commit='fffffff')
     if not ((repr(v101) == '1.0.1-0-gfffffff') or
             (repr(v101), '1.0.1-x-gfffffff')):
         raise AssertionError('Unexpected version string returned')
Пример #22
0
 def test_version_eq_v101(self):
     v101 = Version(release=(1, 0, 1))
     self.assertEqual(v101 == v101, True)
Пример #23
0
 def test_repr_v101_10_commits(self):
     v101 = Version(release=(1, 0, 1), commit_count=10, commit='aaaaaaa')
     self.assertEqual(repr(v101), '1.0.1-10-gaaaaaaa')
Пример #24
0
 def test_version_neq(self):
     v1 = Version(release=(1, 0))
     v101 = Version(release=(1, 0, 1))
     self.assertEqual(v1 != v101, True)
Пример #25
0
 def test_repr_v1(self):
     v1 = Version(release=(1, 0))
     self.assertEqual(repr(v1), 'Version((1, 0),None,None)')
Пример #26
0
Callable objects that generate numbers according to different distributions.
"""

import random
import operator
import hashlib
import struct
import fractions

from math import e, pi

import param

from param.version import Version
__version__ = Version(release=(1, 5, 0),
                      fpath=__file__,
                      commit="7f1db3f0",
                      reponame="param")


class TimeAware(param.Parameterized):
    """
    Class of objects that have access to a global time function
    and have the option of using it to generate time-dependent values
    as necessary.

    In the simplest case, an object could act as a strict function of
    time, returning the current time transformed according to a fixed
    equation.  Other objects may support locking their results to a
    timebase, but also work without time.  For instance, objects with
    random state could return a new random value for every call, with
    no notion of time, or could always return the same value until the
Пример #27
0
 def test_repr_v101(self):
     v101 = Version(release=(1, 0, 1), commit='shortSHA')
     self.assertEqual(repr(v101), "Version((1, 0, 1),None,'shortSHA')")
Пример #28
0
Callable objects that generate numbers according to different distributions.
"""

import random
import operator
import hashlib
import struct
import fractions

from math import e,pi

import param


from param.version import Version
__version__ = Version(release=(1,3,2), fpath=__file__,
                      commit="8b8409aa", reponame="param")


class TimeAware(param.Parameterized):
    """
    Class of objects that have access to a global time function
    and have the option of using it to generate time-dependent values
    as necessary.

    In the simplest case, an object could act as a strict function of
    time, returning the current time transformed according to a fixed
    equation.  Other objects may support locking their results to a
    timebase, but also work without time.  For instance, objects with
    random state could return a new random value for every call, with
    no notion of time, or could always return the same value until the
    global time changes.  Subclasses should thus provide an ability to
Пример #29
0
 def test_version_str_v1(self):
     v1 = Version(release=(1, 0))
     self.assertEqual(str(v1), '1.0')
Пример #30
0
 def test_version_release_v101(self):
     v101 = Version(release=(1, 0, 1))
     self.assertEqual(v101.release, (1, 0, 1))
Пример #31
0
 def test_version_less_than_dev_number(self):
     v101dev1 = Version(release=(1,0,1), dev=1)
     v101dev2 = Version(release=(1,0,1), dev=2)
     self.assertEqual((v101dev1 < v101dev2), True)