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
17f89f4f
Commit
17f89f4f
authored
Oct 14, 2016
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update sdist to use sdist_add_defaults forward compatibility.
parent
6b175fcf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
54 deletions
+8
-54
setuptools/command/sdist.py
setuptools/command/sdist.py
+8
-43
setuptools/utils.py
setuptools/utils.py
+0
-11
No files found.
setuptools/command/sdist.py
View file @
17f89f4f
from
glob
import
glob
from
distutils
import
log
import
distutils.command.sdist
as
orig
import
os
...
...
@@ -7,9 +6,8 @@ import io
import
contextlib
from
setuptools.extern
import
six
from
setuptools.extern.six.moves
import
filter
from
setuptools.utils
import
cs_path_exis
ts
from
.py36compat
import
sdist_add_defaul
ts
import
pkg_resources
...
...
@@ -23,7 +21,7 @@ def walk_revctrl(dirname=''):
yield
item
class
sdist
(
orig
.
sdist
):
class
sdist
(
sdist_add_defaults
,
orig
.
sdist
):
"""Smart sdist that finds anything supported by revision control"""
user_options
=
[
...
...
@@ -127,34 +125,8 @@ class sdist(orig.sdist):
if
has_leaky_handle
:
read_template
=
__read_template_hack
def
add_defaults
(
self
):
standards
=
[
self
.
READMES
,
self
.
distribution
.
script_name
]
for
fn
in
standards
:
if
isinstance
(
fn
,
tuple
):
alts
=
fn
got_it
=
0
for
fn
in
alts
:
if
cs_path_exists
(
fn
):
got_it
=
1
self
.
filelist
.
append
(
fn
)
break
if
not
got_it
:
self
.
warn
(
"standard file not found: should have one of "
+
', '
.
join
(
alts
))
else
:
if
cs_path_exists
(
fn
):
self
.
filelist
.
append
(
fn
)
else
:
self
.
warn
(
"standard file '%s' not found"
%
fn
)
optional
=
[
'test/test*.py'
,
'setup.cfg'
]
for
pattern
in
optional
:
files
=
filter
(
cs_path_exists
,
glob
(
pattern
))
self
.
filelist
.
extend
(
files
)
# getting python files
def
_add_defaults_python
(
self
):
"""getting python files"""
if
self
.
distribution
.
has_pure_modules
():
build_py
=
self
.
get_finalized_command
(
'build_py'
)
self
.
filelist
.
extend
(
build_py
.
get_source_files
())
...
...
@@ -167,17 +139,10 @@ class sdist(orig.sdist):
self
.
filelist
.
extend
([
os
.
path
.
join
(
src_dir
,
filename
)
for
filename
in
filenames
])
if
self
.
distribution
.
has_ext_modules
():
build_ext
=
self
.
get_finalized_command
(
'build_ext'
)
self
.
filelist
.
extend
(
build_ext
.
get_source_files
())
if
self
.
distribution
.
has_c_libraries
():
build_clib
=
self
.
get_finalized_command
(
'build_clib'
)
self
.
filelist
.
extend
(
build_clib
.
get_source_files
())
if
self
.
distribution
.
has_scripts
():
build_scripts
=
self
.
get_finalized_command
(
'build_scripts'
)
self
.
filelist
.
extend
(
build_scripts
.
get_source_files
())
def
_add_defaults_data_files
(
self
):
"""
Don't add any data files, but why?
"""
def
check_readme
(
self
):
for
f
in
self
.
READMES
:
...
...
setuptools/utils.py
deleted
100644 → 0
View file @
6b175fcf
import
os
import
os.path
def
cs_path_exists
(
fspath
):
if
not
os
.
path
.
exists
(
fspath
):
return
False
# make absolute so we always have a directory
abspath
=
os
.
path
.
abspath
(
fspath
)
directory
,
filename
=
os
.
path
.
split
(
abspath
)
return
filename
in
os
.
listdir
(
directory
)
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