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
0a9fe1c3
Commit
0a9fe1c3
authored
Feb 03, 2023
by
Michael Davidsaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure package with DSO but no Extension is installed as platlib
parent
5080fbb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
5 deletions
+31
-5
src/setuptools_dso/__init__.py
src/setuptools_dso/__init__.py
+3
-2
src/setuptools_dso/dsocmd.py
src/setuptools_dso/dsocmd.py
+28
-3
No files found.
src/setuptools_dso/__init__.py
View file @
0a9fe1c3
...
...
@@ -6,12 +6,11 @@ from __future__ import print_function
import
os
# import of setuptools implicitly monkey patches distutils...
from
setuptools
import
setup
as
_setup
from
.dsocmd
import
DSO
,
Extension
,
build_dso
,
build_ext
,
bdist_egg
from
.dsocmd
import
DSO
,
Extension
,
install
,
build
,
build_dso
,
build_ext
,
bdist_egg
from
.runtime
import
dylink_prepare_dso
,
find_dso
from
.probe
import
ProbeToolchain
from
distutils
import
log
from
setuptools.command.install
import
install
__all__
=
(
'DSO'
,
...
...
@@ -49,6 +48,8 @@ def setup(**kws):
cmdclass_setdefault
(
'bdist_egg'
,
bdist_egg
)
cmdclass_setdefault
(
'build_dso'
,
build_dso
)
cmdclass_setdefault
(
'build_ext'
,
build_ext
)
cmdclass_setdefault
(
'build'
,
build
,
error
=
False
)
cmdclass_setdefault
(
'install'
,
install
,
error
=
False
)
try
:
from
.dsocmd
import
bdist_wheel
except
ImportError
:
...
...
src/setuptools_dso/dsocmd.py
View file @
0a9fe1c3
...
...
@@ -16,8 +16,14 @@ except ImportError:
from
setuptools
import
Command
,
Distribution
,
Extension
as
_Extension
from
setuptools.command.build_ext
import
build_ext
as
_build_ext
from
setuptools.command.install
import
install
from
setuptools.command.install
import
install
as
_install
from
setuptools.command.bdist_egg
import
bdist_egg
as
_bdist_egg
try
:
# attempt at future proofing
# doesn't exist as of setuptools 52.0.0
from
setuptools.command.build
import
build
as
_build
except
ImportError
:
from
distutils.command.build
import
build
as
_build
from
distutils.dep_util
import
newer_group
from
distutils
import
log
...
...
@@ -527,6 +533,26 @@ class build_ext(dso2libmixin, _build_ext):
self
.
dso2lib_post
(
self
.
get_ext_fullpath
(
ext
.
name
))
# hack...
# setuptools/distutils decides to treat build as a "purelib" vs. "platlib"
# by testing 'dist.ext_modules' (not call 'dist.has_ext_modules()' mind you...)
# So we can't simply patch has_ext_modules() to also check for DSOs.
#
# Otherwise a package contains DSOs, but not Extensions, would incorrectly
# be treated as "purelib".
class
build
(
_build
):
def
finalize_options
(
self
):
_build
.
finalize_options
(
self
)
if
self
.
distribution
.
x_dsos
:
self
.
build_lib
=
self
.
build_platlib
class
install
(
_install
):
def
finalize_options
(
self
):
_install
.
finalize_options
(
self
)
if
self
.
distribution
.
x_dsos
:
self
.
install_lib
=
self
.
install_platlib
if
_bdist_wheel
:
class
bdist_wheel
(
_bdist_wheel
):
"""Since 'auditwheel' doesn't understand the idea of non-python libraries in the python tree,
...
...
@@ -607,8 +633,7 @@ def _needs_builddso(command, right_before=None):
_
.
insert
(
where
,
(
'build_dso'
,
has_dsos
))
command
.
sub_commands
=
_
from
distutils.command.build
import
build
_needs_builddso
(
build
,
right_before
=
'build_clib'
)
_needs_builddso
(
_build
,
right_before
=
'build_clib'
)
# depend build_ext: build_dso, for DSOs to be automatically built on
...
...
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