Browse Source

Use setuptools_scm

pull/359/head
Simon Conseil 7 years ago
parent
commit
2e9ffd9ec0
  1. 1
      .gitignore
  2. 13
      docs/conf.py
  3. 4
      setup.cfg
  4. 2
      setup.py
  5. 8
      sigal/__init__.py

1
.gitignore vendored

@ -4,6 +4,7 @@
*_flymake
.coverage
.DS_Store
.eggs/
.pytest_cache/
.ropeproject/
.tox/

13
docs/conf.py

@ -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 @@ copyright = '2012-2019, Simon Conseil'
# 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.

4
setup.cfg

@ -1,6 +1,5 @@
[metadata]
name = sigal
version = attr: sigal.__version__
description = Simple static gallery generator
long_description = file: README.rst
author = Simon Conseil
@ -8,6 +7,7 @@ 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

2
setup.py

@ -4,4 +4,4 @@ from setuptools import setup
if sys.version_info[:2] < (3, 5):
sys.exit('Sigal supports Python 3.5+ only')
setup()
setup(use_scm_version=True)

8
sigal/__init__.py

@ -29,13 +29,19 @@ import time
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'

Loading…
Cancel
Save