Skip to main content

setuptools_scm plugin to use version from __about__.py

Project description

Travis AppVeyor Coverage Updates PyPI

This is a setuptools_scm plugin that adds support for __about__.py files.

If version cannot be resolved via SCM, the fallback registered by this plugin will be called. It will try to find the __about__.py file (using the **/__about__.py glob pattern) that defines the __version__ variable.

Since there is no SCM metadata available, package will return VERSION.dev0+unknown where VERSION is a version from __about__.py.

Usage

Add 'setuptools_scm_about' to the setup_requires parameter in your project’s setup.py file:

setup(
    ...,
    use_scm_version={
        'write_to': 'myproject/_version.py'
    },
    setup_requires=['setuptools_scm', 'setuptools_scm_about'],
    ...,
)

Define __version__ in myproject/__about__.py:

__version__ = 1.0

Import __version__ in myproject/__init__.py for external access:

try:
    from ._version import version as __version__
except ImportError:
    from .__about__ import __version__

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

setuptools_scm_about-1.0.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

setuptools_scm_about-1.0-py2.py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page