Skip to content

Commit

Permalink
Don't duplicate version in __init__.py and pyproject.toml
Browse files Browse the repository at this point in the history
Support of Python <= 3.7 is a bit more complicated.
To simplify when the support will be dropped.
  • Loading branch information
stephane committed Sep 2, 2022
1 parent 8b8b3f0 commit 4218013
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions django_auth_adfs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
Don't put imports or code here
This file is imported by setup.py
Adding imports here will break setup.py
"""
import sys

__version__ = '1.11.0'
if sys.version_info[:2] >= (3, 8):
from importlib import metadata
else:
import importlib_metadata as metadata

__version__ = metadata.version(__package__)

del metadata # optional, avoids polluting the results of dir(__package__)
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = 'django-auth-adfs'
version = "1.11.0" # Remember to also change __init__.py version
version = "1.11.0"
description = 'A Django authentication backend for Microsoft ADFS and AzureAD'
authors = ['Joris Beckers <[email protected]>']
maintainers = ['Jonas Krüger Svensson <[email protected]>', 'Sondre Lillebø Gundersen <[email protected]>']
Expand Down Expand Up @@ -43,6 +43,7 @@ requests = '^1 || ^2'
urllib3 = '^1.26.0'
cryptography = '>=1.7,<39.0'
PyJWT = "^2.4.0"
importlib-metadata = {version = ">=1.7.0", python = "<3.8"}

[tool.poetry.dev-dependencies]
responses = '*'
Expand Down

0 comments on commit 4218013

Please sign in to comment.