How to use the incremental.Version function in incremental

To help you get started, we’ve selected a few incremental examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twisted / incremental / tests / test_version.py View on Github external
def test_baseWithPrerelease(self):
        """
        The base version includes 'preX' for versions with prereleases.
        """
        self.assertEqual(Version("foo", 1, 0, 0, prerelease=8).base(),
                          "1.0.0pre8")
github twisted / incremental / tests / test_version.py View on Github external
def test_versionComparison(self):
        """
        Versions can be compared for equality and order.
        """
        va = Version("dummy", 1, 0, 0)
        vb = Version("dummy", 0, 1, 0)
        self.assertTrue(va > vb)
        self.assertTrue(vb < va)
        self.assertTrue(va >= vb)
        self.assertTrue(vb <= va)
        self.assertTrue(va != vb)
        self.assertTrue(vb == Version("dummy", 0, 1, 0))
        self.assertTrue(vb == vb)
github twisted / klein / src / klein / _version.py View on Github external
"""
Provides klein version information.
"""

# This file is auto-generated! Do not edit!
# Use `python -m incremental.update klein` to change this file.

from incremental import Version

__version__ = Version("klein", 19, 6, 0)
__all__ = ["__version__"]
github twisted / twisted / src / twisted / web / http.py View on Github external
return self is not other
        return NotImplemented


    def __hash__(self):
        """
        A C{Request} is hashable so that it can be used as a mapping key.

        @return A C{int} based on the instance's identity.
        """
        return id(self)



Request.getClientIP = deprecated(
    Version("Twisted", "NEXT", 0, 0),
    replacement="getClientAddress",
)(Request.getClientIP)

Request.noLongerQueued = deprecated(
    Version("Twisted", 16, 3, 0))(Request.noLongerQueued)


class _DataLoss(Exception):
    """
    L{_DataLoss} indicates that not all of a message body was received. This
    is only one of several possible exceptions which may indicate that data
    was lost.  Because of this, it should not be checked for by
    specifically; any unexpected exception should be treated as having
    caused data loss.
    """
github Kitware / VTK / ThirdParty / Twisted / vtkTwisted / src / twisted / web / __init__.py View on Github external
Twisted Web: HTTP clients and servers, plus tools for implementing them.

Contains a L{web server} (including an
L{HTTP implementation}, a
L{resource model}), and
a L{web client}.
"""

from incremental import Version
from twisted.python.deprecate import deprecatedModuleAttribute

from twisted._version import __version__ as version
__version__ = version.short()

deprecatedModuleAttribute(
    Version("Twisted", 16, 0, 0),
    "Use twisted.__version__ instead.",
    "twisted.web", "__version__")
github twisted / twisted / src / twisted / web / http.py View on Github external
"""
        A C{Request} is hashable so that it can be used as a mapping key.

        @return A C{int} based on the instance's identity.
        """
        return id(self)



Request.getClientIP = deprecated(
    Version("Twisted", "NEXT", 0, 0),
    replacement="getClientAddress",
)(Request.getClientIP)

Request.noLongerQueued = deprecated(
    Version("Twisted", 16, 3, 0))(Request.noLongerQueued)


class _DataLoss(Exception):
    """
    L{_DataLoss} indicates that not all of a message body was received. This
    is only one of several possible exceptions which may indicate that data
    was lost.  Because of this, it should not be checked for by
    specifically; any unexpected exception should be treated as having
    caused data loss.
    """



class PotentialDataLoss(Exception):
    """
    L{PotentialDataLoss} may be raised by a transfer encoding decoder's
github twisted / twisted / src / twisted / web / tap.py View on Github external
def opt_port(self, port):
        """
        (DEPRECATED: use --listen)
        Strports description of port to start the server on
        """
        msg = deprecate.getDeprecationWarningString(
            self.opt_port, incremental.Version('Twisted', 18, 4, 0))
        warnings.warn(msg, category=DeprecationWarning, stacklevel=2)
        self['port'] = port
github Kitware / VTK / ThirdParty / Twisted / vtkTwisted / src / twisted / web / client.py View on Github external
@deprecated(Version("Twisted", 16, 7, 0),
            _GETPAGE_REPLACEMENT_TEXT)
def downloadPage(url, file, contextFactory=None, *args, **kwargs):
    """
    Download a web page to a file.

    @param file: path to file on filesystem, or file-like object.

    See HTTPDownloader to see what extra args can be passed.
    """
    factoryFactory = lambda url, *a, **kw: HTTPDownloader(url, file, *a, **kw)
    return _makeGetterFactory(
        url,
        factoryFactory,
        contextFactory=contextFactory,
        *args, **kwargs).deferred

incremental

A small library that versions your Python projects.

MIT
Latest version published 5 months ago

Package Health Score

86 / 100
Full package analysis