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
c80f03be
Commit
c80f03be
authored
Jan 16, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Plain Diff
Merge with master
parents
e6087bfa
730834b5
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
114 additions
and
270 deletions
+114
-270
.travis.yml
.travis.yml
+7
-4
CHANGES.rst
CHANGES.rst
+18
-0
README.rst
README.rst
+11
-229
docs/developer-guide.txt
docs/developer-guide.txt
+5
-5
docs/history.txt
docs/history.txt
+38
-0
setup.cfg
setup.cfg
+1
-1
setup.py
setup.py
+1
-1
setuptools/__init__.py
setuptools/__init__.py
+1
-1
setuptools/namespaces.py
setuptools/namespaces.py
+0
-1
setuptools/package_index.py
setuptools/package_index.py
+2
-2
setuptools/py33compat.py
setuptools/py33compat.py
+0
-1
setuptools/ssl_support.py
setuptools/ssl_support.py
+30
-25
No files found.
.travis.yml
View file @
c80f03be
...
...
@@ -5,12 +5,15 @@ python:
-
3.3
-
3.4
-
3.5
-
"
3.6-dev"
-
3.6
-
nightly
-
pypy
env
:
-
"
"
-
LC_ALL=C LC_CTYPE=C
matrix
:
include
:
-
python
:
3.6
env
:
LC_ALL=C LC_CTYPE=C
-
python
:
2.7
env
:
LC_ALL=C LC_CTYPE=C
script
:
# need tox and rwt to get started
-
pip install tox rwt
...
...
CHANGES.rst
View file @
c80f03be
v33
.1.1
-------
*
#
921
:
Correct
issue
where
certifi
fallback
not
being
reached
on
Windows
.
v33
.1.0
-------
Installation
via
pip
,
as
indicated
in
the
`
Python
Packaging
User
's Guide <https://packaging.python.org/installing/>`_,
is the officially-supported mechanism for installing
Setuptools, and this recommendation is now explicit in the
much more concise README.
Other edits and tweaks were made to the documentation. The
codebase is unchanged.
v33.0.0
-------
...
...
README.rst
View file @
c80f03be
===============================
Installing and Using Setuptools
===============================
.. contents:: **Table of Contents**
.. image:: https://readthedocs.org/projects/setuptools/badge/?version=latest
:target: https://setuptools.readthedocs.io
-------------------------
Installation Instructions
-------------------------
The recommended way to bootstrap setuptools on any system is to download
`ez_setup.py`_ and run it using the target Python environment. Different
operating systems have different recommended techniques to accomplish this
basic routine, so below are some examples to get you started.
Setuptools requires Python 2.6 or later. To install setuptools
on Python 2.4 or Python 2.5, use the `bootstrap script for Setuptools 1.x
<https://raw.githubusercontent.com/pypa/setuptools/bootstrap-py24/ez_setup.py>`_.
The link provided to ez_setup.py is a bookmark to bootstrap script for the
latest known stable release.
.. _ez_setup.py: https://bootstrap.pypa.io/ez_setup.py
Windows (Powershell 3 or later)
===============================
For best results, uninstall previous versions FIRST (see `Uninstalling`_).
Using Windows 8 (which includes PowerShell 3) or earlier versions of Windows
with PowerShell 3 installed, it's possible to install with one simple
Powershell command. Start up Powershell and paste this command::
> (Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | python -
.. image:: https://badges.gitter.im/pypa/setuptools.svg
:alt: Join the chat at https://gitter.im/pypa/setuptools
:target: https://gitter.im/pypa/setuptools?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
You must start the Powershell with Administrative privileges or you may choose
to install a user-local installation::
> (Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | python - --user
If you have Python 3.3 or later, you can use the ``py`` command to install to
different Python versions. For example, to install to Python 3.3 if you have
Python 2.7 installed::
> (Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | py -3 -
The recommended way to install setuptools on Windows is to download
`ez_setup.py`_ and run it. The script will download the appropriate
distribution file and install it for you.
Once installation is complete, you will find an ``easy_install`` program in
your Python ``Scripts`` subdirectory. For simple invocation and best results,
add this directory to your ``PATH`` environment variable, if it is not already
present. If you did a user-local install, the ``Scripts`` subdirectory is
``$env:APPDATA\Python\Scripts``.
Windows (simplified)
====================
For Windows without PowerShell 3 or for installation without a command-line,
download `ez_setup.py`_ using your preferred web browser or other technique
and "run" that file.
Unix (wget)
===========
Most Linux distributions come with wget.
Download `ez_setup.py`_ and run it using the target Python version. The script
will download the appropriate version and install it for you::
> wget https://bootstrap.pypa.io/ez_setup.py -O - | python
Note that you will may need to invoke the command with superuser privileges to
install to the system Python::
> wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
Alternatively, Setuptools may be installed to a user-local path::
> wget https://bootstrap.pypa.io/ez_setup.py -O - | python - --user
Note that on some older systems (noted on Debian 6 and CentOS 5 installations),
`wget` may refuse to download `ez_setup.py`, complaining that the certificate common name `*.c.ssl.fastly.net`
does not match the host name `bootstrap.pypa.io`. In addition, the `ez_setup.py` script may then encounter similar problems using
`wget` internally to download `setuptools-x.y.zip`, complaining that the certificate common name of `www.python.org` does not match the
host name `pypi.python.org`. Those are known issues, related to a bug in the older versions of `wget`
(see `Issue 59 <https://bitbucket.org/pypa/pypi/issue/59#comment-5881915>`_). If you happen to encounter them,
install Setuptools as follows::
> wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
> python ez_setup.py --insecure
Unix including Mac OS X (curl)
==============================
See the `Installation Instructions
<https://packaging.python.org/installing/>`_ in the Python Packaging
User's Guide for instructions on installing, upgrading, and uninstalling
Setuptools.
If your system has curl installed, follow the ``wget`` instructions but
replace ``wget`` with ``curl`` and ``-O`` with ``-o``. For example::
The project is `maintained at GitHub <https://github.com/pypa/setuptools>`_.
> curl https://bootstrap.pypa.io/ez_setup.py -o - | python
Questions and comments should be directed to the `distutils-sig
mailing list <http://mail.python.org/pipermail/distutils-sig/>`_.
Bug reports and especially tested patches may be
submitted directly to the `bug tracker
<https://github.com/pypa/setuptools/issues>`_.
Advanced Installation
=====================
For more advanced installation options, such as installing to custom
locations or prefixes, download and extract the source
tarball from `Setuptools on PyPI <https://pypi.python.org/pypi/setuptools>`_
and run setup.py with any supported distutils and Setuptools options.
For example::
setuptools-x.x$ python setup.py install --prefix=/opt/setuptools
Use ``--help`` to get a full options list, but we recommend consulting
the `EasyInstall manual`_ for detailed instructions, especially `the section
on custom installation locations`_.
.. _EasyInstall manual: https://setuptools.readthedocs.io/en/latest/easy_install.html
.. _the section on custom installation locations: https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
Downloads
=========
All setuptools downloads can be found at `the project's home page in the Python
Package Index`_. Scroll to the very bottom of the page to find the links.
.. _the project's home page in the Python Package Index: https://pypi.python.org/pypi/setuptools
In addition to the PyPI downloads, the development version of ``setuptools``
is available from the `GitHub repo`_, and in-development versions of the
`0.6 branch`_ are available as well.
.. _GitHub repo: https://github.com/pypa/setuptools/archive/master.tar.gz#egg=setuptools-dev
.. _0.6 branch: http://svn.python.org/projects/sandbox/branches/setuptools-0.6/#egg=setuptools-dev06
Uninstalling
============
On Windows, if Setuptools was installed using an ``.exe`` or ``.msi``
installer, simply use the uninstall feature of "Add/Remove Programs" in the
Control Panel.
Otherwise, to uninstall Setuptools or Distribute, regardless of the Python
version, delete all ``setuptools*`` and ``distribute*`` files and
directories from your system's ``site-packages`` directory
(and any other ``sys.path`` directories) FIRST.
If you are upgrading or otherwise plan to re-install Setuptools or Distribute,
nothing further needs to be done. If you want to completely remove Setuptools,
you may also want to remove the 'easy_install' and 'easy_install-x.x' scripts
and associated executables installed to the Python scripts directory.
--------------------------------
Using Setuptools and EasyInstall
--------------------------------
Here are some of the available manuals, tutorials, and other resources for
learning about Setuptools, Python Eggs, and EasyInstall:
* `The EasyInstall user's guide and reference manual`_
* `The setuptools Developer's Guide`_
* `The pkg_resources API reference`_
* `The Internal Structure of Python Eggs`_
Questions, comments, and bug reports should be directed to the `distutils-sig
mailing list`_. If you have written (or know of) any tutorials, documentation,
plug-ins, or other resources for setuptools users, please let us know about
them there, so this reference list can be updated. If you have working,
*tested* patches to correct problems or add features, you may submit them to
the `setuptools bug tracker`_.
.. _setuptools bug tracker: https://github.com/pypa/setuptools/issues
.. _The Internal Structure of Python Eggs: https://setuptools.readthedocs.io/en/latest/formats.html
.. _The setuptools Developer's Guide: https://setuptools.readthedocs.io/en/latest/developer-guide.html
.. _The pkg_resources API reference: https://setuptools.readthedocs.io/en/latest/pkg_resources.html
.. _The EasyInstall user's guide and reference manual: https://setuptools.readthedocs.io/en/latest/easy_install.html
.. _distutils-sig mailing list: http://mail.python.org/pipermail/distutils-sig/
-------
Credits
-------
* The original design for the ``.egg`` format and the ``pkg_resources`` API was
co-created by Phillip Eby and Bob Ippolito. Bob also implemented the first
version of ``pkg_resources``, and supplied the OS X operating system version
compatibility algorithm.
* Ian Bicking implemented many early "creature comfort" features of
easy_install, including support for downloading via Sourceforge and
Subversion repositories. Ian's comments on the Web-SIG about WSGI
application deployment also inspired the concept of "entry points" in eggs,
and he has given talks at PyCon and elsewhere to inform and educate the
community about eggs and setuptools.
* Jim Fulton contributed time and effort to build automated tests of various
aspects of ``easy_install``, and supplied the doctests for the command-line
``.exe`` wrappers on Windows.
* Phillip J. Eby is the seminal author of setuptools, and
first proposed the idea of an importable binary distribution format for
Python application plug-ins.
* Significant parts of the implementation of setuptools were funded by the Open
Source Applications Foundation, to provide a plug-in infrastructure for the
Chandler PIM application. In addition, many OSAF staffers (such as Mike
"Code Bear" Taylor) contributed their time and stress as guinea pigs for the
use of eggs and setuptools, even before eggs were "cool". (Thanks, guys!)
* Tarek Ziadé is the principal author of the Distribute fork, which
re-invigorated the community on the project, encouraged renewed innovation,
and addressed many defects.
* Since the merge with Distribute, Jason R. Coombs is the
maintainer of setuptools. The project is maintained in coordination with
the Python Packaging Authority (PyPA) and the larger Python community.
.. _files:
---------------
Code of Conduct
---------------
Everyone interacting in the setuptools project's codebases, issue trackers,
chat rooms, and mailing lists is expected to follow the
`PyPA Code of Conduct`_.
.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/
`PyPA Code of Conduct <https://www.pypa.io/en/latest/code-of-conduct/>`_.
docs/developer-guide.txt
View file @
c80f03be
...
...
@@ -13,11 +13,11 @@ Recommended Reading
-------------------
Please read `How to write the perfect pull request
<http
://blog.jaraco.com/2014/04/how-to-write-perfect-pull-request.html>`_
for some tips on contributing to open source projects. Although the article
is not authoritative, it was authored by the maintainer of Setuptools, so
reflects his opinions and will improve the likelihood of acceptance and
quality of
contribution.
<http
s://blog.jaraco.com/how-to-write-perfect-pull-request/>`_ for some tips
on contributing to open source projects. Although the article is not
authoritative, it was authored by the maintainer of Setuptools, so reflects
his opinions and will improve the likelihood of acceptance and quality of
contribution.
------------------
Project Management
...
...
docs/history.txt
View file @
c80f03be
...
...
@@ -6,3 +6,41 @@ History
*******
.. include:: ../CHANGES (links).rst
Credits
*******
* The original design for the ``.egg`` format and the ``pkg_resources`` API was
co-created by Phillip Eby and Bob Ippolito. Bob also implemented the first
version of ``pkg_resources``, and supplied the OS X operating system version
compatibility algorithm.
* Ian Bicking implemented many early "creature comfort" features of
easy_install, including support for downloading via Sourceforge and
Subversion repositories. Ian's comments on the Web-SIG about WSGI
application deployment also inspired the concept of "entry points" in eggs,
and he has given talks at PyCon and elsewhere to inform and educate the
community about eggs and setuptools.
* Jim Fulton contributed time and effort to build automated tests of various
aspects of ``easy_install``, and supplied the doctests for the command-line
``.exe`` wrappers on Windows.
* Phillip J. Eby is the seminal author of setuptools, and
first proposed the idea of an importable binary distribution format for
Python application plug-ins.
* Significant parts of the implementation of setuptools were funded by the Open
Source Applications Foundation, to provide a plug-in infrastructure for the
Chandler PIM application. In addition, many OSAF staffers (such as Mike
"Code Bear" Taylor) contributed their time and stress as guinea pigs for the
use of eggs and setuptools, even before eggs were "cool". (Thanks, guys!)
* Tarek Ziadé is the principal author of the Distribute fork, which
re-invigorated the community on the project, encouraged renewed innovation,
and addressed many defects.
* Since the merge with Distribute, Jason R. Coombs is the
maintainer of setuptools. The project is maintained in coordination with
the Python Packaging Authority (PyPA) and the larger Python community.
setup.cfg
View file @
c80f03be
[bumpversion]
current_version = 33.
0.0
current_version = 33.
1.1
commit = True
tag = True
...
...
setup.py
View file @
c80f03be
...
...
@@ -88,7 +88,7 @@ def pypi_link(pkg_filename):
setup_params
=
dict
(
name
=
"setuptools"
,
version
=
"33.
0.0
"
,
version
=
"33.
1.1
"
,
description
=
"Easily download, build, install, upgrade, and uninstall "
"Python packages"
,
author
=
"Python Packaging Authority"
,
...
...
setuptools/__init__.py
View file @
c80f03be
...
...
@@ -7,7 +7,7 @@ import distutils.filelist
from
distutils.util
import
convert_path
from
fnmatch
import
fnmatchcase
from
six.moves
import
filter
,
filterfalse
,
map
from
six.moves
import
filter
,
map
import
setuptools.version
from
setuptools.extension
import
Extension
...
...
setuptools/namespaces.py
View file @
c80f03be
import
os
import
sys
from
distutils
import
log
import
itertools
...
...
setuptools/package_index.py
View file @
c80f03be
...
...
@@ -20,7 +20,7 @@ from six.moves import urllib, http_client, configparser, map
import
setuptools
from
pkg_resources
import
(
CHECKOUT_DIST
,
Distribution
,
BINARY_DIST
,
normalize_path
,
SOURCE_DIST
,
require
,
Environment
,
find_distributions
,
safe_name
,
safe_version
,
Environment
,
find_distributions
,
safe_name
,
safe_version
,
to_filename
,
Requirement
,
DEVELOP_DIST
,
)
from
setuptools
import
ssl_support
...
...
@@ -48,7 +48,7 @@ __all__ = [
_SOCKET_TIMEOUT = 15
_tmpl = "setuptools/{setuptools.__version__} Python-urllib/{py_major}"
user_agent = _tmpl.format(py_major=sys.version[:3],
**globals()
)
user_agent = _tmpl.format(py_major=sys.version[:3],
setuptools=setuptools
)
def parse_requirement_arg(spec):
...
...
setuptools/py33compat.py
View file @
c80f03be
import
dis
import
code
import
array
import
collections
...
...
setuptools/ssl_support.py
View file @
c80f03be
...
...
@@ -2,10 +2,10 @@ import os
import
socket
import
atexit
import
re
import
functools
from
six.moves
import
urllib
,
http_client
,
map
from
six.moves
import
urllib
,
http_client
,
map
,
filter
import
pkg_resources
from
pkg_resources
import
ResolutionError
,
ExtractionError
try
:
...
...
@@ -204,47 +204,52 @@ def opener_for(ca_bundle=None):
).open
_wincerts = None
# from jaraco.functools
def once(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
if not hasattr(func, '
always_returns
'):
func.always_returns = func(*args, **kwargs)
return func.always_returns
return wrapper
@once
def get_win_certfile():
global _wincerts
if _wincerts is not None:
return _wincerts.name
try:
from wincertstore import CertFil
e
import wincertstor
e
except ImportError:
return None
class MyCertFile(CertFile):
def __init__(self, stores=(), certs=()):
CertFile.__init__(self)
for store in stores:
self.addstore(store)
self.addcerts(certs)
class CertFile(wincertstore.CertFile):
def __init__(self):
super(CertFile, self).__init__()
atexit.register(self.close)
def close(self):
try:
super(
My
CertFile, self).close()
super(CertFile, self).close()
except OSError:
pass
_wincerts = MyCertFile(stores=['
CA
', '
ROOT
'])
_wincerts = CertFile()
_wincerts.addstore('
CA
')
_wincerts.addstore('
ROOT
')
return _wincerts.name
def find_ca_bundle():
"""Return an existing CA bundle path, or None"""
if os.name == '
nt
':
return get_win_certfile()
else:
for cert_path in cert_paths:
if os.path.isfile(cert_path):
return cert_path
extant_cert_paths = filter(os.path.isfile, cert_paths)
return (
get_win_certfile()
or next(extant_cert_paths, None)
or _certifi_where()
)
def _certifi_where():
try:
import certifi
return certifi.where()
return __import__('
certifi
').where()
except (ImportError, ResolutionError, ExtractionError):
return None
pass
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