Skip to content
Permalink
Browse files

Use setuptools_scm

  • Loading branch information
saimn committed Jan 27, 2019
1 parent 05a28f3 commit 2e9ffd9ec0f48c5abd73d08cf2f99291c02578b7
Showing with 17 additions and 11 deletions.
  1. +1 −0 .gitignore
  2. +5 −8 docs/conf.py
  3. +3 −1 setup.cfg
  4. +1 −1 setup.py
  5. +7 −1 sigal/__init__.py
@@ -4,6 +4,7 @@
*_flymake
.coverage
.DS_Store
.eggs/
.pytest_cache/
.ropeproject/
.tox/
@@ -1,18 +1,14 @@
import os
import re
import sys

import alabaster
from setuptools.config import read_configuration
from pkg_resources import get_distribution

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.append(os.path.abspath('..'))

conf_dict = read_configuration('../setup.cfg')
__version__ = conf_dict['metadata']['version']

# -- General configuration ----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
@@ -49,9 +45,10 @@
# built documents.
#
# The short X.Y version.
version = re.match(r'\d+\.\d+', __version__).group()
# The full version, including alpha/beta/rc tags.
release = __version__
release = get_distribution('sigal').version
# for example take major/minor
version = '.'.join(release.split('.')[:2])


# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -1,13 +1,13 @@
[metadata]
name = sigal
version = attr: sigal.__version__
description = Simple static gallery generator
long_description = file: README.rst
author = Simon Conseil
author_email = contact@saimon.org
url = https://github.com/saimn/sigal
keywords = gallery, static, generator, image, video, galleria
license = MIT License
license_file = LICENSE
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Console
@@ -26,6 +26,8 @@ zip_safe = False
include_package_data = True
packages = find:
python_requires = >=3.5
setup_requires =
setuptools_scm
install_requires =
blinker
click
@@ -4,4 +4,4 @@
if sys.version_info[:2] < (3, 5):
sys.exit('Sigal supports Python 3.5+ only')

setup()
setup(use_scm_version=True)
@@ -29,13 +29,19 @@

from click import argument, option
from http import server
from pkg_resources import get_distribution, DistributionNotFound

from .gallery import Gallery
from .log import init_logging
from .settings import read_settings
from .utils import copy

__version__ = '2.1.dev'
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass

__url__ = 'https://github.com/saimn/sigal'

_DEFAULT_CONFIG_FILE = 'sigal.conf.py'

0 comments on commit 2e9ffd9

Please sign in to comment.
You can’t perform that action at this time.