Skip to content

Commit 4c1a9f0

Browse files
committed
Fix sdist included files
1 parent 574d582 commit 4c1a9f0

2 files changed

Lines changed: 12 additions & 15 deletions

File tree

setup.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ dev =
4848
cothread; sys_platform != "win32"
4949
p4p
5050

51+
# Include the OS specific files in the sdist, even
52+
# if not packages by setup.py (as we only build sdist on one arch)
53+
[options.data_files]
54+
iocStats/devIocStats = iocStats/devIocStats/*.c, iocStats/devIocStats/*.h
55+
iocStats/devIocStats/os/default = iocStats/devIocStats/os/default/*
56+
iocStats/devIocStats/os/Darwin = iocStats/devIocStats/os/Darwin/*
57+
iocStats/devIocStats/os/WIN32 = iocStats/devIocStats/os/WIN32/*
58+
iocStats/devIocStats/os/Linux = iocStats/devIocStats/os/Linux/*
59+
5160
[flake8]
5261
max-line-length = 80
5362
extend-ignore =

setup.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"devIocStatsWaveform.c",
2424
"devIocStatsSub.c",
2525
"devIocStatsTest.c",
26-
"devIocStats.h",
2726
]
2827

2928
devIocStats_OSD = [
@@ -39,30 +38,19 @@
3938
"osdSystemInfo.c",
4039
"osdHostInfo.c",
4140
"osdPIDInfo.c",
42-
"devIocStatsOSD.h",
4341
]
4442

4543
devIocStats_src = os.path.join("iocStats", "devIocStats")
4644
devIocStats_os = os.path.join(devIocStats_src, "os", get_config_var('OS_CLASS'))
4745
devIocStats_default = os.path.join(devIocStats_src, "os", "default")
4846

49-
def _add_file(f):
50-
if f.endswith(".h"):
51-
# Only add header files if making an sdist
52-
# https://github.com/pypa/packaging-problems/issues/84#issuecomment-383718492
53-
should_add = "sdist" in sys.argv
54-
else:
55-
should_add = True
56-
if should_add:
57-
sources.append(f)
58-
5947
for f in devIocStats_OSI:
60-
_add_file(os.path.join(devIocStats_src, f))
48+
sources.append(os.path.join(devIocStats_src, f))
6149
for f in devIocStats_OSD:
6250
if os.path.exists(os.path.join(devIocStats_os, f)):
63-
_add_file(os.path.join(devIocStats_os, f))
51+
sources.append(os.path.join(devIocStats_os, f))
6452
else:
65-
_add_file(os.path.join(devIocStats_default, f))
53+
sources.append(os.path.join(devIocStats_default, f))
6654

6755
# Extension with all our C code
6856
ext = Extension(

0 commit comments

Comments
 (0)