spines.versioning

Versioning subpackage for spines.

class spines.versioning.ClassSignature(obj: [<class 'type'>, <class 'object'>])[source]

Bases: spines.versioning.base.Signature

Signature for classes

functions

Function names and signatures for this class

Type

dict

properties

Properties and their signatures for this class

Type

dict

class spines.versioning.FunctionSignature(obj: function)[source]

Bases: spines.versioning.base.Signature

Signature class for versioning individual functions.

arguments

The signature function’s argument specifications

Type

OrderedDict

return_type

The function’s return type specification (if any)

Type

type

similar(other: Type[FunctionSignature], strict: bool = False) → bool[source]

Compares this FunctionSignature to another for similarity

Similarity is defined as having the same number and types of parameters and the same return type, regardless of the naming conventions used for each.

Parameters
  • other (FunctionSignature) – The other function signature to compare with.

  • strict (bool, optional) – Whether or not the types must be the same or if subclasses are permittable (the default is False, subclasses are also acceptable).

Returns

Whether or not the two functions are similar (as defined above).

Return type

bool

class spines.versioning.SourceMixin(obj: [<class 'type'>, <class 'object'>])[source]

Bases: abc.ABC

Source mixin for storing source code of Signature object’s

source

Source code for the signature’s object.

Type

str

class spines.versioning.PropertySignature(obj: property, name: str)[source]

Bases: spines.versioning.base.Signature

Signature for properties

deleter

Signature for this property’s fdel

Type

FunctionSignature

getter

Signature for this property’s fget

Type

FunctionSignature

setter

Signature for this property’s fset

Type

FunctionSignature

class spines.versioning.VersionMixin(obj)[source]

Bases: abc.ABC

Version mixin for versioning Signature objects.

description

Description for the main object versioned.

Type

str

slug

Slugified version of this version object

Type

str

spines_version

Version of spines this version object was created with

Type

str

to_dev() → None[source]

Switches the version to development

to_post() → None[source]

Switches the version to post-release

to_pre() → None[source]

Switches the version to pre-release

to_release() → None[source]

Switches the version to release

version

Version string for this version object.

Type

str