Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to setuptools_scm instead of bumpversion. #403

Merged
merged 1 commit into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .bumpversion.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ docs: build-docs
linux-docs: build-docs
xdg-open docs/_build/html/index.html

.PHONY: bumpversion
bumpversion:
bumpversion $(bump)

.PHONY: pushversion
pushversion:
git push upstream && git push upstream --tags
Expand Down
18 changes: 5 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,8 @@
# 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.insert(0, os.path.abspath('.'))
from pkg_resources import get_distribution

import os

DIR = os.path.dirname('__file__')
with open (os.path.join(DIR, '../setup.py'), 'r') as f:
for line in f:
if 'version=' in line:
setup_version = line.split('\'')[1]
break

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

Expand Down Expand Up @@ -85,15 +77,15 @@ def django_configure():
project = 'Simple JWT'
copyright = '2020, David Sanders'

__version__ = setup_version
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '.'.join(__version__.split('.')[:2])
# The full version, including alpha/beta/rc tags.
release = __version__
release = get_distribution("django-rest-framework-simplejwt").version

# The short X.Y version.
version = ".".join(release.split(".")[:2])

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
8 changes: 7 additions & 1 deletion rest_framework_simplejwt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
__version__ = '4.7.0'
from pkg_resources import get_distribution, DistributionNotFound

try:
__version__ = get_distribution("django-rest-framework-simplejwt").version
except DistributionNotFound:
# package is not installed
__version__ = None
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
'sphinx_rtd_theme>=0.1.9',
],
'dev': [
'bumpversion>=0.5.3,<1',
'pytest-watch',
'wheel',
'twine',
Expand All @@ -45,7 +44,8 @@

setup(
name='djangorestframework_simplejwt',
version='4.6.0',
use_scm_version={"version_scheme": "post-release"},
setup_requires=["setuptools_scm"],
url='https://github.com/SimpleJWT/django-rest-framework-simplejwt',
license='MIT',
description='A minimal JSON Web Token authentication plugin for Django REST Framework',
Expand Down