Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
kwant
tinyarray
Commits
67077122
Commit
67077122
authored
Dec 21, 2016
by
Christoph Groth
Browse files
setup.py: remove our_ prefix for distutils commands
parent
158fb875
Changes
1
Hide whitespace changes
Inline
Side-by-side
setup.py
View file @
67077122
...
...
@@ -19,8 +19,8 @@ import configparser
from
setuptools
import
setup
,
Extension
,
Command
from
sysconfig
import
get_platform
from
distutils.errors
import
DistutilsError
,
DistutilsModuleError
from
setuptools.command.build_ext
import
build_ext
from
setuptools.command.sdist
import
sdist
from
setuptools.command.build_ext
import
build_ext
as
build_ext_orig
from
setuptools.command.sdist
import
sdist
as
sdist_orig
try
:
from
os.path
import
samefile
...
...
@@ -218,18 +218,18 @@ def long_description():
return
''
.
join
(
text
)
class
our_
build_ext
(
build_ext
):
class
build_ext
(
build_ext
_orig
):
def
run
(
self
):
with
open
(
os
.
path
.
join
(
'src'
,
'version.hh'
),
'w'
)
as
f
:
f
.
write
(
"// This file has been generated by setup.py.
\n
"
)
f
.
write
(
"// It is not included in source distributions.
\n
"
)
f
.
write
(
'#define VERSION "{}"
\n
'
.
format
(
version
))
build_ext
.
run
(
self
)
build_ext
_orig
.
run
(
self
)
class
our_
sdist
(
sdist
):
class
sdist
(
sdist
_orig
):
def
make_release_tree
(
self
,
base_dir
,
files
):
sdist
.
make_release_tree
(
self
,
base_dir
,
files
)
sdist
_orig
.
make_release_tree
(
self
,
base_dir
,
files
)
fname
=
os
.
path
.
join
(
base_dir
,
SAVED_VERSION_FILE
)
# This could be a hard link, so try to delete it first. Is there any way
...
...
@@ -280,8 +280,8 @@ def main():
license
=
"Simplified BSD license"
,
platforms
=
[
"Unix"
,
"Linux"
,
"Mac OS-X"
,
"Windows"
],
classifiers
=
classifiers
.
split
(
'
\n
'
),
cmdclass
=
{
'build_ext'
:
our_
build_ext
,
'sdist'
:
our_
sdist
},
cmdclass
=
{
'build_ext'
:
build_ext
,
'sdist'
:
sdist
},
ext_modules
=
[
Extension
(
name
,
**
kwargs
)
for
name
,
kwargs
in
exts
.
items
()],
setup_requires
=
[
'pytest-runner'
],
...
...
Write
Preview
Supports
Markdown
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