Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
0d642959
Commit
0d642959
authored
Mar 06, 2010
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
files used by win32 tests
parent
205a0969
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
338 additions
and
0 deletions
+338
-0
tests/setuptools_build_ext.py
tests/setuptools_build_ext.py
+287
-0
tests/setuptools_extension.py
tests/setuptools_extension.py
+51
-0
No files found.
tests/setuptools_build_ext.py
0 → 100644
View file @
0d642959
This diff is collapsed.
Click to expand it.
tests/setuptools_extension.py
0 → 100644
View file @
0d642959
from
distutils.core
import
Extension
as
_Extension
from
distutils.core
import
Distribution
as
_Distribution
def
_get_unpatched
(
cls
):
"""Protect against re-patching the distutils if reloaded
Also ensures that no other distutils extension monkeypatched the distutils
first.
"""
while
cls
.
__module__
.
startswith
(
'setuptools'
):
cls
,
=
cls
.
__bases__
if
not
cls
.
__module__
.
startswith
(
'distutils'
):
raise
AssertionError
(
"distutils has already been patched by %r"
%
cls
)
return
cls
_Distribution
=
_get_unpatched
(
_Distribution
)
_Extension
=
_get_unpatched
(
_Extension
)
try
:
from
Pyrex.Distutils.build_ext
import
build_ext
except
ImportError
:
have_pyrex
=
False
else
:
have_pyrex
=
True
class
Extension
(
_Extension
):
"""Extension that uses '.c' files in place of '.pyx' files"""
if
not
have_pyrex
:
# convert .pyx extensions to .c
def
__init__
(
self
,
*
args
,
**
kw
):
_Extension
.
__init__
(
self
,
*
args
,
**
kw
)
sources
=
[]
for
s
in
self
.
sources
:
if
s
.
endswith
(
'.pyx'
):
sources
.
append
(
s
[:
-
3
]
+
'c'
)
else
:
sources
.
append
(
s
)
self
.
sources
=
sources
class
Library
(
Extension
):
"""Just like a regular Extension, but built as a library instead"""
import
sys
,
distutils
.
core
,
distutils
.
extension
distutils
.
core
.
Extension
=
Extension
distutils
.
extension
.
Extension
=
Extension
if
'distutils.command.build_ext'
in
sys
.
modules
:
sys
.
modules
[
'distutils.command.build_ext'
].
Extension
=
Extension
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