Skip to content

Commit e8ec140

Browse files
Use setuptools_scm for packaging
Follow recommendation from https://jazzband.co/about/releases#packaging. The documentation now derives its version from the packaged release. Follow https://github.com/pypa/setuptools_scm/#usage-from-sphinx and read the version with setuptools.
1 parent 1ce1df7 commit e8ec140

File tree

7 files changed

+31
-8
lines changed

7 files changed

+31
-8
lines changed

.github/workflows/docs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ jobs:
1313
TOXENV: docs
1414

1515
steps:
16+
- name: Install LDAP libs
17+
run: |
18+
sudo apt-get update
19+
# https://www.python-ldap.org/en/latest/installing.html#debian
20+
sudo apt-get install slapd ldap-utils libldap2-dev libsasl2-dev
21+
# https://github.com/python-ldap/python-ldap/issues/370
22+
sudo apt-get install apparmor-utils
23+
sudo aa-disable /usr/sbin/slapd
24+
1625
- uses: actions/checkout@v2
1726

1827
- name: Set up Python

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ build/
77
dist/
88
MANIFEST
99

10+
# Written by setuptools_scm.
11+
django_auth_ldap/version.py
12+
1013
.coverage
1114
.tox/

django_auth_ldap/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
VERSION = (2, 2, 0)
2-
__version__ = ".".join(str(i) for i in VERSION)
1+
try:
2+
from .version import version
3+
except ImportError:
4+
__version__ = None
5+
else:
6+
__version__ = version

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import os
1414
import sys
1515

16+
from pkg_resources import get_distribution
17+
1618
sys.path.insert(0, os.path.abspath("ext"))
1719

1820

@@ -22,10 +24,8 @@
2224
copyright = "2009, Peter Sagerson"
2325
author = "Peter Sagerson"
2426

25-
# The short X.Y version
26-
version = "2.2"
27-
# The full version, including alpha/beta/rc tags
28-
release = "2.2.0"
27+
release = get_distribution("django-auth-ldap").version
28+
version = ".".join(release.split(".")[:2])
2929

3030

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

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel",
5+
"setuptools_scm[toml]>=3.4",
6+
]
7+
8+
[tool.setuptools_scm]
9+
write_to = "django_auth_ldap/version.py"

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[metadata]
22
name = django-auth-ldap
3-
version = attr: django_auth_ldap.__version__
43
description = Django LDAP authentication backend.
54
long_description = file: README.rst
65
long_description_content_type = text/x-rst

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ deps =
3838
sphinx
3939
commands =
4040
make -C docs html
41-
skip_install = true
4241
whitelist_externals = make
4342

4443
[testenv:packaging]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy