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
21bffb67
Commit
21bffb67
authored
Sep 03, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into sortzip
parents
d12975ca
b4d58d49
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
20 deletions
+59
-20
CHANGES.rst
CHANGES.rst
+6
-0
docs/setuptools.txt
docs/setuptools.txt
+2
-2
setup.cfg
setup.cfg
+2
-2
setup.py
setup.py
+1
-1
setuptools/config.py
setuptools/config.py
+20
-14
setuptools/msvc.py
setuptools/msvc.py
+10
-1
setuptools/tests/test_config.py
setuptools/tests/test_config.py
+18
-0
No files found.
CHANGES.rst
View file @
21bffb67
...
...
@@ -4,6 +4,12 @@ v36.4.0
*
#
1068
:
Sort
files
and
directories
when
building
eggs
for
deterministic
order
.
v36
.3.0
-------
*
#
1131
:
Make
possible
using
several
files
within
``
file
:``
directive
in
metadata
.
long_description
in
``
setup
.
cfg
``.
v36
.2.7
-------
...
...
docs/setuptools.txt
View file @
21bffb67
...
...
@@ -2306,7 +2306,7 @@ boilerplate code in some cases.
name = my_package
version = attr: src.VERSION
description = My package description
long_description = file: README.rst
long_description = file: README.rst
, CHANGELOG.rst, LICENSE.rst
keywords = one, two
license = BSD 3-Clause License
classifiers =
...
...
@@ -2379,7 +2379,7 @@ Type names used below:
Special directives:
* ``attr:`` - value could be read from module attribute
* ``file:`` - value could be read from a
file
* ``file:`` - value could be read from a
list of files and then concatenated
.. note::
...
...
setup.cfg
View file @
21bffb67
[bumpversion]
current_version = 36.
2.7
current_version = 36.
3.0
commit = True
tag = True
...
...
@@ -19,7 +19,7 @@ repository = https://upload.pypi.org/legacy/
[sdist]
formats = zip
[wheel]
[
bdist_
wheel]
universal = 1
[bumpversion:file:setup.py]
...
...
setup.py
View file @
21bffb67
...
...
@@ -89,7 +89,7 @@ def pypi_link(pkg_filename):
setup_params
=
dict
(
name
=
"setuptools"
,
version
=
"36.
2.7
"
,
version
=
"36.
3.0
"
,
description
=
"Easily download, build, install, upgrade, and uninstall "
"Python packages"
,
author
=
"Python Packaging Authority"
,
...
...
setuptools/config.py
View file @
21bffb67
...
...
@@ -245,33 +245,39 @@ class ConfigHandler(object):
directory with setup.py.
Examples:
includ
e: LICENSE
include:
src/file.txt
fil
e: LICENSE
file: README.rst, CHANGELOG.md,
src/file.txt
:param str value:
:rtype: str
"""
include_directive
=
'file:'
if
not
isinstance
(
value
,
string_types
):
return
value
include_directive
=
'file:'
if
not
value
.
startswith
(
include_directive
):
return
value
current_directory
=
os
.
getcwd
()
filepath
=
value
.
replace
(
include_directive
,
''
).
strip
()
filepath
=
os
.
path
.
abspath
(
filepath
)
if
not
filepath
.
startswith
(
current_directory
):
spec
=
value
[
len
(
include_directive
):]
filepaths
=
(
os
.
path
.
abspath
(
path
.
strip
())
for
path
in
spec
.
split
(
','
))
return
'
\
n
'
.
join
(
cls
.
_read_file
(
path
)
for
path
in
filepaths
if
(
cls
.
_assert_local
(
path
)
or
True
)
and
os
.
path
.
isfile
(
path
)
)
@
staticmethod
def
_assert_local
(
filepath
):
if
not
filepath
.
startswith
(
os
.
getcwd
()):
raise
DistutilsOptionError
(
'`file:` directive can not access %s'
%
filepath
)
if
os
.
path
.
isfile
(
filepath
):
with
io
.
open
(
filepath
,
encoding
=
'utf-8'
)
as
f
:
value
=
f
.
read
()
return
value
@
staticmethod
def
_read_file
(
filepath
):
with
io
.
open
(
filepath
,
encoding
=
'utf-8'
)
as
f
:
return
f
.
read
()
@
classmethod
def
_parse_attr
(
cls
,
value
):
...
...
setuptools/msvc.py
View file @
21bffb67
...
...
@@ -45,9 +45,18 @@ else:
safe_env
=
dict
()
_msvc9_suppress_errors
=
(
# msvc9compiler isn't available on some platforms
ImportError
,
# msvc9compiler raises DistutilsPlatformError in some
# environments. See #1118.
distutils
.
errors
.
DistutilsPlatformError
,
)
try
:
from
distutils.msvc9compiler
import
Reg
except
ImportError
:
except
_msvc9_suppress_errors
:
pass
...
...
setuptools/tests/test_config.py
View file @
21bffb67
...
...
@@ -139,6 +139,24 @@ class TestMetadata:
assert
metadata
.
download_url
==
'http://test.test.com/test/'
assert
metadata
.
maintainer_email
==
'test@test.com'
def
test_file_mixed
(
self
,
tmpdir
):
fake_env
(
tmpdir
,
'[metadata]
\
n
'
'long_description = file: README.rst, CHANGES.rst
\
n
'
'
\
n
'
)
tmpdir
.
join
(
'README.rst'
).
write
(
'readme contents
\
n
line2'
)
tmpdir
.
join
(
'CHANGES.rst'
).
write
(
'changelog contents
\
n
and stuff'
)
with
get_dist
(
tmpdir
)
as
dist
:
assert
dist
.
metadata
.
long_description
==
(
'readme contents
\
n
line2
\
n
'
'changelog contents
\
n
and stuff'
)
def
test_file_sandboxed
(
self
,
tmpdir
):
fake_env
(
...
...
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