Skip to content

Commit

Permalink
setup.py: support PEP 517 isolated builds when sourcing version
Browse files Browse the repository at this point in the history
  • Loading branch information
intelfx committed Feb 4, 2024
1 parent 3e22e61 commit 1bee928
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import importlib.util
import setuptools
from pathlib import Path

from mautrix import __version__
# get mautrix.__version__ in a way that's compatible with PEP517 isolation
spec = importlib.util.spec_from_file_location("mautrix", Path(__file__).parent / "mautrix/__init__.py")
mautrix = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mautrix)
__version__ = mautrix.__version__

encryption_dependencies = ["python-olm", "unpaddedbase64", "pycryptodome"]
test_dependencies = ["aiosqlite", "asyncpg", "ruamel.yaml", *encryption_dependencies]
Expand Down

0 comments on commit 1bee928

Please sign in to comment.