Skip to content

Commit 40af9ae

Browse files
authored
Merge pull request #63 from tarasko/feature/simply_setup
Simplify setup.py, get rid off PICOWS_BUILD_EXAMPLES
2 parents 3eacbaa + 3433e97 commit 40af9ae

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

MANIFEST.in

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
include picows/picows.pxd picows/picows.pyx
2-
exclude picows/*.c
3-
exclude examples/*
1+
graft examples
2+
graft tests
3+
4+
recursive-include picows *.pxd *.pyx
5+
recursive-include examples *.pyx
6+
7+
global-exclude *.c *.py[cod] __pycache__ *.so *.pyd *.dll *.dylib *.html

README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ Contributing / Building From Source
173173

174174
4. Build inplace and run tests::
175175

176-
$ export PICOWS_BUILD_EXAMPLES=1
177176
$ python setup.py build_ext --inplace
178177
$ pytest -s -v
179178

setup.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,20 @@
1313
else:
1414
libraries = None
1515

16-
cython_modules = [
17-
Extension(
18-
"picows.picows",
19-
["picows/picows.pyx"],
20-
libraries=libraries,
21-
)
16+
pkg_extensions = [
17+
Extension("picows.picows", ["picows/picows.pyx"], libraries=libraries),
2218
]
2319

24-
if os.getenv("PICOWS_BUILD_EXAMPLES") is not None:
25-
cython_modules.append(
26-
Extension(
27-
"examples.echo_client_cython",
28-
["examples/echo_client_cython.pyx"],
29-
)
30-
)
20+
example_extensions = [
21+
Extension("examples.echo_client_cython", ["examples/echo_client_cython.pyx"], libraries=libraries),
22+
]
23+
24+
build_wheel = any(cmd in sys.argv for cmd in ("bdist_wheel",))
25+
extensions = (pkg_extensions + example_extensions) if not build_wheel and os.name != 'nt' else pkg_extensions
3126

3227
setup(
3328
ext_modules=cythonize(
34-
cython_modules,
29+
extensions,
3530
compiler_directives={
3631
'language_level': vi[0],
3732
'profile': False,
@@ -43,6 +38,7 @@
4338
'cdivision': True
4439
},
4540
annotate=False,
46-
gdb_debug=False
41+
gdb_debug=False,
4742
),
43+
include_package_data=True,
4844
)

0 commit comments

Comments
 (0)