Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
08fb925b
Commit
08fb925b
authored
Aug 20, 2015
by
Ehsan Azarnasab
Browse files
always clean up dist folder to have a clean sdist and clean builds
parent
a61a8d56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
setup.py
setup.py
+21
-7
No files found.
setup.py
View file @
08fb925b
...
@@ -245,6 +245,25 @@ def copy_file(src, dst):
...
@@ -245,6 +245,25 @@ def copy_file(src, dst):
shutil
.
copy2
(
src
,
dst
)
shutil
.
copy2
(
src
,
dst
)
def
clean_dist
():
"""re-create the dist folder
"""
dist_dir
=
os
.
path
.
join
(
script_dir
,
"./dist"
)
if
os
.
path
.
exists
(
dist_dir
):
log
.
info
(
'Removing distribution directory %s'
%
dist_dir
)
rmtree
(
dist_dir
)
dist_dir
=
os
.
path
.
join
(
script_dir
,
"./dist/dlib"
)
try
:
os
.
makedirs
(
dist_dir
)
except
OSError
:
pass
# always start with a clean slate
clean_dist
()
# noinspection PyPep8Naming
# noinspection PyPep8Naming
class
build
(
_build
):
class
build
(
_build
):
def
run
(
self
):
def
run
(
self
):
...
@@ -252,11 +271,6 @@ class build(_build):
...
@@ -252,11 +271,6 @@ class build(_build):
if
not
repackage
:
if
not
repackage
:
self
.
build_dlib
()
self
.
build_dlib
()
dist_dir
=
os
.
path
.
join
(
script_dir
,
"dist"
)
if
os
.
path
.
exists
(
dist_dir
):
log
.
info
(
'Removing distribution directory %s'
%
dist_dir
)
rmtree
(
dist_dir
)
# this is where the extension examples go
# this is where the extension examples go
dist_dir_examples
=
os
.
path
.
join
(
script_dir
,
"./dist/dlib/examples"
)
dist_dir_examples
=
os
.
path
.
join
(
script_dir
,
"./dist/dlib/examples"
)
try
:
try
:
...
@@ -265,8 +279,8 @@ class build(_build):
...
@@ -265,8 +279,8 @@ class build(_build):
pass
pass
# this is where the extension goes
# this is where the extension goes
log
.
info
(
'Populating the distribution directory %s ...'
%
dist_dir
)
dist_dir
=
os
.
path
.
join
(
script_dir
,
"./dist/dlib"
)
dist_dir
=
os
.
path
.
join
(
script_dir
,
"./dist/dlib"
)
log
.
info
(
'Populating the distribution directory %s ...'
%
dist_dir
)
# create the module init files
# create the module init files
with
open
(
os
.
path
.
join
(
dist_dir
,
'__init__.py'
),
'w'
)
as
f
:
with
open
(
os
.
path
.
join
(
dist_dir
,
'__init__.py'
),
'w'
)
as
f
:
...
@@ -385,7 +399,7 @@ setup(
...
@@ -385,7 +399,7 @@ setup(
author_email
=
'davis@dlib.net'
,
author_email
=
'davis@dlib.net'
,
url
=
'https://github.com/davisking/dlib'
,
url
=
'https://github.com/davisking/dlib'
,
license
=
'Boost Software License'
,
license
=
'Boost Software License'
,
packages
=
[
'dlib'
,
'dlib.examples'
],
packages
=
[
'dlib'
],
package_dir
=
{
''
:
'dist'
},
package_dir
=
{
''
:
'dist'
},
include_package_data
=
True
,
include_package_data
=
True
,
cmdclass
=
{
cmdclass
=
{
...
...
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