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 71d2b14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import importlib.util
import setuptools

from mautrix import __version__
# get mautrix.__version__ in a way that's compatible with PEP517 isolation
spec = importlib.util.spec_from_file_location("mautrix", "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 71d2b14

Please sign in to comment.