Skip to content

Commit dbff081

Browse files
fixes
1 parent 86d2104 commit dbff081

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
import os
2+
from pathlib import Path
23
import sys
34

45
from setuptools import setup
56

67
# ensure the current directory is on sys.path so versioneer can be imported
78
# when pip uses PEP 517/518 build rules.
89
# https://github.com/python-versioneer/python-versioneer/issues/193
9-
sys.path.append(os.path.dirname(__file__))
1010

11+
12+
sys.path.append(str(Path(__file__).parent))
1113
import versioneer # noqa: E402
12-
from snakemake.assets import Assets
14+
15+
# import Assets, while avoiding that the rest of snakemake is imported here before
16+
# setup has been called.
17+
sys.path.append(str(Path(__file__).parent / "snakemake"))
18+
from assets import Assets
1319

1420
# download online assets
1521
Assets.deploy()

snakemake/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
__license__ = "MIT"
55

66
import sys
7-
from snakemake.common import __version__, PIP_DEPLOYMENTS_PATH
7+
8+
from snakemake._version import get_versions
9+
10+
__version__ = get_versions()["version"]
11+
del get_versions
12+
13+
PIP_DEPLOYMENTS_PATH = ".snakemake/pip-deployments"
814

915
sys.path.append(PIP_DEPLOYMENTS_PATH)
1016

snakemake/common/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@
1717
import collections
1818
from pathlib import Path
1919

20-
from snakemake._version import get_versions
21-
20+
from snakemake import __version__
2221
from snakemake_interface_common.exceptions import WorkflowError
2322

24-
__version__ = get_versions()["version"]
25-
del get_versions
26-
2723

2824
MIN_PY_VERSION = (3, 7)
2925
UUID_NAMESPACE = uuid.uuid5(uuid.NAMESPACE_URL, "https://snakemake.readthedocs.io")
@@ -46,7 +42,6 @@
4642
),
4743
)
4844
)
49-
PIP_DEPLOYMENTS_PATH = ".snakemake/pip-deployments"
5045

5146

5247
def get_snakemake_searchpaths():

0 commit comments

Comments
 (0)