Skip to content

Commit 83cf548

Browse files
authored
Fix source distribution so it does not depend on eccodeslib (#141)
1 parent 68cff89 commit 83cf548

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.github/workflows/cd.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,12 @@ jobs:
2424
pypi:
2525
needs: [wheel-windows]
2626
uses: ecmwf/reusable-workflows/.github/workflows/cd-pypi.yml@v2
27+
with:
28+
env_vars: |
29+
{
30+
"DEPEND_ON_ECCODESLIB": "1"
31+
}
32+
buildargs: --no-isolation
2733
secrets: inherit
34+
2835

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import setuptools
1919

20+
binary = os.getenv("DEPEND_ON_ECCODESLIB", "") == "1"
21+
2022

2123
def read(path):
2224
file_path = os.path.join(os.path.dirname(__file__), *path.split("/"))
@@ -90,9 +92,14 @@ def shared(directory):
9092
"attrs",
9193
"cffi",
9294
"findlibs",
93-
"eccodeslib;platform_system!='Windows'",
9495
]
9596

97+
# only add eccodeslib as dependency if building a distribution that should depend on it
98+
if binary:
99+
install_requires += [
100+
"eccodeslib;platform_system!='Windows'",
101+
]
102+
96103
setuptools.setup(
97104
name="eccodes",
98105
version=parse_version_from("gribapi/bindings.py"),

0 commit comments

Comments
 (0)