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
8edd129d
Commit
8edd129d
authored
Mar 04, 2021
by
Kaleb Barrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename default dso info module
parent
f4ea2eb3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
README.md
README.md
+5
-5
example/src/dsodemo/cli.py
example/src/dsodemo/cli.py
+2
-2
example/src/dsodemo/ext/__init__.py
example/src/dsodemo/ext/__init__.py
+1
-1
src/setuptools_dso/dsocmd.py
src/setuptools_dso/dsocmd.py
+1
-1
No files found.
README.md
View file @
8edd129d
...
...
@@ -68,7 +68,7 @@ eg. the result of `dsodemo.lib.demo` will be eg. `dsodemo/lib/libdemo.so` or `ds
installed in the python module tree along-side any other python code or C extensions.
Note that there need not be a
`dsodemo/lib/__init__.py`
as
`dsodemo.lib`
need not be a python package.
However, if this file is present, then the generated
`dsodemo/lib/demo_dso.py`
will be accessible.
However, if this file is present, then the generated
`dsodemo/lib/demo_dso
info
.py`
will be accessible.
```
py
from
setuptools_dso
import
DSO
,
Extension
,
setup
...
...
@@ -117,10 +117,10 @@ Version 1.3 added a `setuptools_dso.cythonize()` wrapper to correctly handle `Ex
### Runtime
Beginning with setuptools-dso 2.0 a file
`*_dso.py`
will be generated alongside each DSO.
eg. dso
`mypkg.lib.thelib`
will create
`mypkg/lib/thelib_dso.py`
.
Beginning with setuptools-dso 2.0 a file
`*_dso
info
.py`
will be generated alongside each DSO.
eg. dso
`mypkg.lib.thelib`
will create
`mypkg/lib/thelib_dso
info
.py`
.
If
`mypkg.lib`
is a valid python packages (contains
`__init__.py`
)
then
`mypkg.lib.thelib_dso
.py
`
can be imported, and will contain the attributes:
then
`mypkg.lib.thelib_dso
info
`
can be imported, and will contain the attributes:
-
`.dsoname`
eg. "mypkg.lib.thelib"
-
`.libname`
eg. "thelib.so"
...
...
@@ -128,7 +128,7 @@ then `mypkg.lib.thelib_dso.py` can be imported, and will contain the attributes:
-
`.filename`
eg. "/full/path/to/thelib.so"
-
`.sofilename`
eg. "/full/path/to/thelib.so.0"
Beginning with 2.0
`os.add_dll_directory()`
is called by the generated
`*_dso.py`
module.
Beginning with 2.0
`os.add_dll_directory()`
is called by the generated
`*_dso
info
.py`
module.
Prior to 2.0, or if the generated module is not used,
some additional runtime preparation is needed in order to find the
`'dsodemo.lib.demo'`
library
when the
`dsodemo.ext.dtest`
Extension is imported on Windows.
...
...
example/src/dsodemo/cli.py
View file @
8edd129d
...
...
@@ -4,13 +4,13 @@ from __future__ import print_function
import
ctypes
from
.ext
import
dtest
from
.lib
import
demo_dso
from
.lib
import
demo_dso
info
def
main
():
print
(
dtest
.
foo
())
print
(
dtest
.
bar
())
# ctypes.RTLD_GLOBAL ensures we don't load a second instance.
demolib
=
ctypes
.
CDLL
(
demo_dso
.
sofilename
,
ctypes
.
RTLD_GLOBAL
)
demolib
=
ctypes
.
CDLL
(
demo_dso
info
.
sofilename
,
ctypes
.
RTLD_GLOBAL
)
myvar
=
ctypes
.
c_int
.
in_dll
(
demolib
,
'myvar'
)
dtest
.
check_myvar
(
ctypes
.
addressof
(
myvar
))
...
...
example/src/dsodemo/ext/__init__.py
View file @
8edd129d
# import calls os.add_dll_directory() on windows
from
..lib
import
demo_dso
from
..lib
import
demo_dso
info
src/setuptools_dso/dsocmd.py
View file @
8edd129d
...
...
@@ -85,7 +85,7 @@ class DSO(_Extension):
soversion
=
None
,
lang_compile_args
=
None
,
dsos
=
None
,
dso_info_module_name
=
"{}_dso.py"
,
dso_info_module_name
=
"{}_dso
info
.py"
,
**
kws
):
_Extension
.
__init__
(
self
,
name
,
sources
,
**
kws
)
self
.
lang_compile_args
=
lang_compile_args
or
{}
...
...
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