8000 Use setuptools_scm for versioning · codingjoe/django-select2@0021f35 · GitHub
[go: up one dir, main page]

Skip to content
10000

Commit 0021f35

Browse files
committed
Use setuptools_scm for versioning
1 parent ad42a01 commit 0021f35

File tree

3 files changed

+48
-41
lines changed

3 files changed

+48
-41
lines changed

docs/conf.py

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,46 @@
1-
import os
2-
import sys
3-
4-
# This is needed since django_select2 requires django model modules
5-
# and those modules assume that django settings is configured and
6-
# have proper DB settings.
7-
# Using this we give a proper environment with working django settings.
8-
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.testapp.settings")
9-
10-
# If extensions (or modules to document with autodoc) are in another directory,
11-
# add these directories to sys.path here. If the directory is relative to the
12-
# documentation root, use os.path.abspath to make it absolute, like shown here.
13-
sys.path.insert(0, os.path.abspath('../tests.testapp'))
14-
sys.path.insert(0, os.path.abspath('..'))
15-
16-
extensions = [
17-
'sphinx.ext.autodoc',
18-
'sphinx.ext.napoleon',
19-
'sphinx.ext.inheritance_diagram',
20-
'sphinx.ext.intersphinx',
21-
'sphinx.ext.viewcode',
22-
'sphinx.ext.doctest',
23-
]
24-
25-
intersphinx_mapping = {
26-
'python': ('http://docs.python.org/3', None),
27-
'django': ('https://docs.djangoproject.com/en/stable/',
28-
'https://docs.djangoproject.com/en/stable/_objects/'),
29-
}
30-
31-
autodoc_default_flags = ['members', 'show-inheritance']
32-
autodoc_member_order = 'bysource'
33-
34-
inheritance_graph_attrs = dict(rankdir='TB')
35-
36-
inheritance_node_attrs = dict(shape='rect', fontsize=14, fillcolor='gray90',
37-
color='gray30', style='filled')
38-
39-
inheritance_edge_attrs = dict(penwidth=0.75)
1+
import os
2+
import sys
3+
4+
from pkg_resources import get_distribution
5+
6+
# This is needed since django_select2 requires django model modules
7+
# and those modules assume that django settings is configured and
8+
# have proper DB settings.
9+
# Using this we give a proper environment with working django settings.
10+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.testapp.settings")
11+
12+
# If extensions (or modules to document with autodoc) are in another directory,
13+
# add these directories to sys.path here. If the directory is relative to the
14+
# documentation root, use os.path.abspath to make it absolute, like shown here.
15+
sys.path.insert(0, os.path.abspath('../tests.testapp'))
16+
sys.path.insert(0, os.path.abspath('..'))
17+
18+
19+
release = get_distribution('django_select2').version
20+
version = '.'.join(release.split('.')[:2])
21+
22+
23+
extensions = [
24+
'sphinx.ext.autodoc',
25+
'sphinx.ext.napoleon',
26+
'sphinx.ext.inheritance_diagram',
27+
'sphinx.ext.intersphinx',
28+
'sphinx.ext.viewcode',
29+
'sphinx.ext.doctest',
30+
]
31+
32+
intersphinx_mapping = {
33+
'python': ('http://docs.python.org/3', None),
34+
'django': ('https://docs.djangoproject.com/en/stable/',
35+
'https://docs.djangoproject.com/en/stable/_objects/'),
36+
}
37+
38+
autodoc_default_flags = ['members', 'show-inheritance']
39+
autodoc_member_order = 'bysource'
40+
41+
inheritance_graph_attrs = dict(rankdir='TB')
42+
43+
inheritance_node_attrs = dict(shape='rect', fontsize=14, fillcolor='gray90',
44+
color='gray30', style='filled')
45+
46+
inheritance_edge_attrs = dict(penwidth=0.75)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ install_requires =
2424
django>=2.0
2525
django-appconf>=0.6.0
2626
setup_requires =
27-
very-good-setuptools-git-version
27+
setuptools_scm
2828
sphinx
2929
pytest-runner
3030
tests_require =

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
from setuptools import setup
44

5-
setup(version_format='{tag}')
5+
setup(use_scm_version=True)

0 commit comments

Comments
 (0)
0