Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools_dso
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
setuptools_dso
Commits
bf5e7225
Commit
bf5e7225
authored
Feb 03, 2023
by
Michael Davidsaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CI: ensure DSO only package isn't purelib
parent
e41543a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
0 deletions
+71
-0
.github/workflows/build.yml
.github/workflows/build.yml
+13
-0
example/setup-dso-only.py
example/setup-dso-only.py
+58
-0
No files found.
.github/workflows/build.yml
View file @
bf5e7225
...
...
@@ -99,6 +99,19 @@ jobs:
python setup.py -v build_ext -i
(cd src && python -m dsodemo.cli)
cd ..
-
name
:
Test Example DSO only
shell
:
bash
run
:
|
set -x
cd example
python setup.py clean -a
git clean -fdx .
rm -f dist/*.whl
python setup-dso-only.py -v bdist_wheel
python -m wheel unpack -d junk dist/*.whl
find junk
ls junk/*/*.dist-info/WHEEL
! ls junk/*/*/purelib
manylinux
:
runs-on
:
ubuntu-latest
...
...
example/setup-dso-only.py
0 → 100755
View file @
bf5e7225
#!/usr/bin/env python
from
setuptools_dso
import
DSO
,
Extension
,
setup
from
setuptools_dso.probe
import
ProbeToolchain
def
define_DSOs
(
cmd
):
# 'cmd' is instance of distutils Command with attributes:
# 'build_lib', 'build_temp', 'inplace', 'distribution', etc.
# example of inspecting the target toolchain.
# could be used to alter source list, macro definitions, or compiler flags.
probe
=
ProbeToolchain
()
assert
probe
.
try_compile
(
'#include <stdlib.h>'
)
assert
not
probe
.
try_compile
(
'intentionally invalid syntax'
)
assert
probe
.
check_include
(
'stdlib.h'
)
assert
not
probe
.
check_include
(
'no-such-header.h'
)
assert
probe
.
sizeof
(
'short'
)
==
2
assert
probe
.
check_symbol
(
'RAND_MAX'
,
headers
=
[
'stdlib.h'
])
assert
probe
.
check_symbol
(
'abort'
,
headers
=
[
'stdlib.h'
])
assert
not
probe
.
check_symbol
(
'intentionally_undeclared_symbol'
,
headers
=
[
'stdlib.h'
])
dso
=
DSO
(
'dsodemo.lib.demo'
,
[
'src/foo.c'
,
'src/bar.cpp'
],
define_macros
=
[(
'BUILD_FOO'
,
None
)],
# demonstrate passing other compiler flags, either conditionally or not.
# these are not actually used.
extra_compile_args
=
[
'-DALL'
],
lang_compile_args
=
{
'c'
:[
'-DISC'
],
'c++'
:[
'-DISCXX'
],
},
# demonstrate how to set an SONAME.
# eg. on linux the result will be two files:
# dsodemo/lib/libdemo.so
# dsodemo/lib/libdemo.so.1.0
soversion
=
'1.0'
,
)
return
[
dso
]
ext
=
Extension
(
'dsodemo.ext.dtest'
,
[
'src/extension.cpp'
],
dsos
=
[
'dsodemo.lib.demo'
],
)
setup
(
name
=
'dsodemo'
,
version
=
"0.1"
,
# setup/build time dependencies listed in pyproject.toml
# cf. PEP 518
#setup_requires = ['setuptools_dso'],
# also need at runtime for DSO filename lookup since demo uses ctypes
install_requires
=
[
'setuptools_dso'
],
packages
=
[
'dsodemo'
,
'dsodemo.ext'
,
'dsodemo.lib'
],
package_dir
=
{
''
:
'src'
},
# 'x_dsos' may be None, a list of DSO instances,
# or a callable returning a list of DSOs.
#x_dsos = [dso],
x_dsos
=
define_DSOs
,
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment