/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Colin Watson
  • Date: 2022-08-08 17:26:06 UTC
  • mto: This revision was merged to the branch mainline in revision 529.
  • Revision ID: cjwatson@canonical.com-20220808172606-77xzhydq226ohtma
Modernize packaging.

There are new dependencies on `importlib_metadata` (for Python < 3.8)
and `packaging`, in order to avoid a self-import in `setup.py`.  People
proxying Loggerhead through Apache should install the
`loggerhead[proxied]` extra; people running it via FastCGI, SCGI, or AJP
should install the `loggerhead[flup]` extra.

The version handling rearrangements make it possible to install
Loggerhead using `pip`.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
starts a web server to browse the contents of a branch.
31
31
"""
32
32
 
 
33
try:
 
34
    import importlib.metadata as importlib_metadata
 
35
except ImportError:
 
36
    import importlib_metadata
33
37
import sys
34
38
 
35
 
version_info = (1, 20, 0) # Keep in sync with loggerhead/__init__.py
 
39
from packaging.version import Version
 
40
 
 
41
try:
 
42
    version_info = Version(importlib_metadata.version("loggerhead")).release
 
43
except importlib_metadata.PackageNotFoundError:
 
44
    # Support running tests from the build tree without installation.
 
45
    version_info = None
36
46
 
37
47
import breezy
38
48
from breezy import commands