Skip to content

Commit

Permalink
Enable setuptools-scm.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed May 14, 2019
1 parent 2f31fc3 commit e1d6df6
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'
search = 'fallback_version': '{current_version}'
replace = 'fallback_version': '{new_version}'

[bumpversion:file:README.rst]
search = v{current_version}.
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ docs/_build
.bootstrap
.appveyor.token
*.bak

# Generated by setuptools-scm
src/*/_version.py
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
sphinx>=1.3
sphinx-py3doc-enhanced-theme>=2.3.2
-e .
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm>=3.3.1"]
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[options]
setup_requires =
setuptools_scm>=3.3.1

[flake8]
max-line-length = 140
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ def _unavailable(self, e):

setup(
name='hunter',
version='2.2.1',
use_scm_version={
'local_scheme': 'dirty-tag',
'write_to': 'src/hunter/_version.py',
'fallback_version': '2.2.1',
},
license='BSD 2-Clause License',
description='Hunter is a flexible code tracing toolkit.',
long_description='%s\n%s' % (
Expand Down
6 changes: 5 additions & 1 deletion src/hunter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
from .predicates import Query
from .tracer import Tracer

__version__ = '2.2.1'
try:
from ._version import version as __version__
except ImportError:
__version__ = '2.2.1'

__all__ = (
'And',
'CallPrinter',
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ envlist =
{py27,py34,py35,py36,py37,pypy,pypy3}-{pure,cython}-{cover,nocov},
report


[testenv]
wheel = true
basepython =
Expand All @@ -26,9 +27,6 @@ setenv =
{docs,pure}: SETUPPY_NOEXT=yes
passenv =
*
usedevelop =
cover: true
nocov: false
deps =
pytest
pytest-travis-fold
Expand Down Expand Up @@ -90,6 +88,9 @@ deps =
[testenv:docs]
deps =
-r{toxinidir}/docs/requirements.txt
usedevelop = true
install_command =
python -m pip install --no-use-pep517 {opts} {packages}
commands =
sphinx-build {posargs:-E} -b html docs dist/docs
sphinx-build -b linkcheck docs dist/docs
Expand Down

0 comments on commit e1d6df6

Please sign in to comment.