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
8cbbd8e2
Commit
8cbbd8e2
authored
May 10, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up style in distutils upload command
parent
f1c0d353
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
command/upload.py
command/upload.py
+19
-14
No files found.
command/upload.py
View file @
8cbbd8e2
"""distutils.command.upload
"""
distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
Implements the Distutils 'upload' subcommand (upload package to a package
index).
"""
from
distutils.errors
import
*
from
distutils.core
import
PyPIRCCommand
from
distutils.spawn
import
spawn
from
distutils
import
log
import
sys
import
os
,
io
import
socket
import
os
import
io
import
platform
from
base64
import
standard_b64encode
from
urllib.request
import
urlopen
,
Request
,
HTTPError
from
urllib.parse
import
urlparse
from
distutils.errors
import
*
from
distutils.core
import
PyPIRCCommand
from
distutils.spawn
import
spawn
from
distutils
import
log
# this keeps compatibility for 2.3 and 2.4
if
sys
.
version
<
"2.5"
:
...
...
@@ -106,7 +109,7 @@ class upload(PyPIRCCommand):
'md5_digest'
:
md5
(
content
).
hexdigest
(),
# additional meta-data
'metadata_version'
:
'1.0'
,
'metadata_version'
:
'1.0'
,
'summary'
:
meta
.
get_description
(),
'home_page'
:
meta
.
get_url
(),
'author'
:
meta
.
get_contact
(),
...
...
@@ -167,13 +170,15 @@ class upload(PyPIRCCommand):
body
.
write
(
b"
\
n
"
)
body
=
body
.
getvalue
()
self
.
announce
(
"Submitting %s to %s"
%
(
filename
,
self
.
repository
),
log
.
INFO
)
msg
=
"Submitting %s to %s"
%
(
filename
,
self
.
repository
)
self
.
announce
(
msg
,
log
.
INFO
)
# build the Request
headers
=
{
'Content-type'
:
'multipart/form-data; boundary=%s'
%
boundary
,
'Content-length'
:
str
(
len
(
body
)),
'Authorization'
:
auth
}
headers
=
{
'Content-type'
:
'multipart/form-data; boundary=%s'
%
boundary
,
'Content-length'
:
str
(
len
(
body
)),
'Authorization'
:
auth
,
}
request
=
Request
(
self
.
repository
,
data
=
body
,
headers
=
headers
)
...
...
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