Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dstufft committed Jan 20, 2016
2 parents 134c9a6 + 130399f commit 4ac44d2
Show file tree
Hide file tree
Showing 30 changed files with 618 additions and 546 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
virtualenv_embedded/*.bat text eol=crlf
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ build
dist
docs/_build
.DS_Store
*.pyc
mock-*.egg
nose-*.egg
*.py[cod]
*.egg
.eggs
.tox
tests/test_activate_actual.output
29 changes: 20 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
language: python

env:
- TOXENV=py26
- TOXENV=py27
- TOXENV=py32
- TOXENV=py33
- TOXENV=py34
- TOXENV=pypy
- TOXENV=pypy3
- TOXENV=docs
matrix:
include:
- python: 2.6
env: TOXENV=py26
- python: 2.7
env: TOXENV=py27
- python: 3.3
env: TOXENV=py33
- python: 3.4
env: TOXENV=py34
- python: 3.5
env: TOXENV=py35
- python: pypy
env: TOXENV=pypy
- python: pypy3
env: TOXENV=pypy3
- python: 2.7
env: TOXENV=docs

install: pip install tox

script: tox

sudo: false # Use container based builds

branches:
only:
- master
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright (c) 2007 Ian Bicking and Contributors
Copyright (c) 2009 Ian Bicking, The Open Planning Project
Copyright (c) 2011-2014 The virtualenv developers
Copyright (c) 2011-2015 The virtualenv developers

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
5 changes: 3 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
recursive-include bin *
recursive-include docs *
recursive-include scripts *
recursive-include tests *.py *.sh *.expected
recursive-include virtualenv_support *.whl
recursive-include virtualenv_embedded *
recursive-exclude docs/_templates *
recursive-exclude docs/_build *
include virtualenv_support/__init__.py
include bin/*
include scripts/*
include *.py
include AUTHORS.txt
include LICENSE.txt
14 changes: 12 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
virtualenv
==========

.. image:: https://pypip.in/v/virtualenv/badge.png
.. image:: https://img.shields.io/pypi/v/virtualenv.svg
:target: https://pypi.python.org/pypi/virtualenv

.. image:: https://secure.travis-ci.org/pypa/virtualenv.png?branch=develop
.. image:: https://img.shields.io/travis/pypa/virtualenv/develop.svg
:target: http://travis-ci.org/pypa/virtualenv

For documentation, see https://virtualenv.pypa.io/


Code of Conduct
---------------

Everyone interacting in the virtualenv 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/
88 changes: 45 additions & 43 deletions bin/rebuild-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,72 @@
"""
Helper script to rebuild virtualenv.py from virtualenv_support
"""
from __future__ import print_function

import re
import os
import sys
import re
import codecs
from zlib import crc32

here = os.path.dirname(__file__)
script = os.path.join(here, '..', 'virtualenv.py')

gzip = codecs.lookup('zlib')
b64 = codecs.lookup('base64')

file_regex = re.compile(
r'##file (.*?)\n([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*convert\("""(.*?)"""\)',
br'##file (.*?)\n([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*convert\("""\n(.*?)"""\)',
re.S)
file_template = '##file %(filename)s\n%(varname)s = convert("""\n%(data)s""")'
file_template = b'##file %(filename)s\n%(varname)s = convert("""\n%(data)s""")'

def rebuild():
f = open(script, 'rb')
content = f.read()
f.close()
def rebuild(script_path):
with open(script_path, 'rb') as f:
script_content = f.read()
parts = []
last_pos = 0
match = None
for match in file_regex.finditer(content):
parts.append(content[last_pos:match.start()])
for match in file_regex.finditer(script_content):
parts += [script_content[last_pos:match.start()]]
last_pos = match.end()
filename = match.group(1)
filename, fn_decoded = match.group(1), match.group(1).decode()
varname = match.group(2)
data = match.group(3)
print('Found reference to file %s' % filename)
pathname = os.path.join(here, '..', 'virtualenv_embedded', filename)
f = open(pathname, 'rb')
c = f.read()
f.close()
new_data = c.encode('zlib').encode('base64')

print('Found file %s' % fn_decoded)
pathname = os.path.join(here, '..', 'virtualenv_embedded', fn_decoded)

with open(pathname, 'rb') as f:
embedded = f.read()
new_crc = crc32(embedded)
new_data = b64.encode(gzip.encode(embedded)[0])[0]

if new_data == data:
print(' Reference up to date (%s bytes)' % len(c))
parts.append(match.group(0))
print(' File up to date (crc: %s)' % new_crc)
parts += [match.group(0)]
continue
print(' Content changed (%s bytes -> %s bytes)' % (
zipped_len(data), len(c)))
new_match = file_template % dict(
filename=filename,
varname=varname,
data=new_data)
parts.append(new_match)
parts.append(content[last_pos:])
new_content = ''.join(parts)
if new_content != content:
sys.stdout.write('Content updated; overwriting... ')
f = open(script, 'wb')
f.write(new_content)
f.close()
# Else: content has changed
crc = crc32(gzip.decode(b64.decode(data)[0])[0])
print(' Content changed (crc: %s -> %s)' %
(crc, new_crc))
new_match = file_template % {
b'filename': filename,
b'varname': varname,
b'data': new_data
}
parts += [new_match]

parts += [script_content[last_pos:]]
new_content = b''.join(parts)

if new_content != script_content:
print('Content updated; overwriting... ', end='')
with open(script_path, 'wb') as f:
f.write(new_content)
print('done.')
else:
print('No changes in content')
if match is None:
print('No variables were matched/found')

def zipped_len(data):
if not data:
return 'no data'
try:
return len(data.decode('base64').decode('zlib'))
except:
return 'unknown'

if __name__ == '__main__':
rebuild()

rebuild(script)
60 changes: 51 additions & 9 deletions docs/changes.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,55 @@
Release History
===============

14.0.0 (2016-01-19)
-------------------

* **BACKWARDS INCOMPATIBLE** Drop support for Python 3.2.

* Upgrade setuptools to 19.4

* Upgrade wheel to 0.26.0

* Upgrade pip to 8.0.0

* Upgrade argparse to 1.4.0

* Added support for ``python-config`` script (:pull:`798`)

* Updated activate.fish (:pull:`589`) (:pull:`799`)

* Account for a ``site.pyo`` correctly in some python implementations (:pull:`759`)

* Properly restore an empty PS1 (:issue:`407`)

* Properly remove ``pydoc`` when deactivating

* Remove workaround for very old Mageia / Mandriva linuxes (:pull:`472`)

* Added a space after virtualenv name in the prompt: ``(env) $PS1``

* Make sure not to run a --user install when creating the virtualenv (:pull:`803`)

* Remove virtualenv file's path from directory when executing with a new
python. Fixes issue :issue:`779`, :issue:`763` (:pull:`805`)

* Remove use of () in .bat files so ``Program Files (x86)`` works :issue:`35`

* Download new releases of the preinstalled software from PyPI when there are
new releases available. This behavior can be disabled using
``--no-download``.

* Make ``--no-setuptools``, ``--no-pip``, and ``--no-wheel`` independent of
each other.


13.1.2 (2015-08-23)
~~~~~~~~~~~~~~~~~~~
-------------------

* Upgrade pip to 7.1.2.

13.1.1 (2015-08-20)
~~~~~~~~~~~~~~~~~~~
-------------------

* Upgrade pip to 7.1.1.

Expand All @@ -16,35 +58,35 @@ Release History
* Make the activate script safe to use when bash is running with ``-u``.

13.1.0 (2015-06-30)
~~~~~~~~~~~~~~~~~~~
-------------------

* Upgrade pip to 7.1.0

* Upgrade setuptools to 18.0.1


13.0.3 (2015-06-01)
~~~~~~~~~~~~~~~~~~~
-------------------

* Upgrade pip to 7.0.3


13.0.2 (2015-06-01)
~~~~~~~~~~~~~~~~~~~
-------------------

* Upgrade pip to 7.0.2

* Upgrade setuptools to 17.0


13.0.1 (2015-05-22)
~~~~~~~~~~~~~~~~~~~
-------------------

* Upgrade pip to 7.0.1


13.0.0 (2015-05-21)
~~~~~~~~~~~~~~~~~~~
-------------------

* Automatically install wheel when creating a new virutalenv. This can be
disabled by using the ``--no-wheel`` option.
Expand All @@ -58,13 +100,13 @@ Release History


12.1.1 (2015-04-07)
~~~~~~~~~~~~~~~~~~~
-------------------

* Upgrade pip to 6.1.1


12.1.0 (2015-04-07)
~~~~~~~~~~~~~~~~~~~
-------------------

* Upgrade setuptools to 15.0

Expand Down
8 changes: 6 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.extlinks']

# Add any paths that contain templates here, relative to this directory.
## FIXME: disabled for now because I haven't figured out how to use this:
#templates_path = ['_templates']

# The suffix of source filenames.
Expand Down Expand Up @@ -74,6 +73,11 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

extlinks = {
'issue': ('https://github.com/pypa/virtualenv/issues/%s', '#'),
'pull': ('https://github.com/pypa/virtualenv/pull/%s', 'PR #'),
}


# Options for HTML output
# -----------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ Other Documentation and Links
He also wrote `an example of using virtualenv to try IPython`__.

.. _virtualenvwrapper: https://pypi.python.org/pypi/virtualenvwrapper/
.. __: http://www.doughellmann.com/articles/CompletelyDifferent-2008-05-virtualenvwrapper/index.html
.. __: http://www.doughellmann.com/articles/CompletelyDifferent-2008-02-ipython-and-virtualenv/index.html
.. __: https://doughellmann.com/blog/2008/05/01/virtualenvwrapper/
.. __: https://doughellmann.com/blog/2008/02/01/ipython-and-virtualenv/

* `Pew`_ is another wrapper for virtualenv that makes use of a different
activation technique.
Expand Down
13 changes: 7 additions & 6 deletions docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ Options

.. option:: --no-setuptools

Do not install setuptools (or pip) in the new
virtualenv.
Do not install setuptools in the new virtualenv.

.. option:: --no-pip

Expand All @@ -90,11 +89,13 @@ Options
Provides an alternative prompt prefix for this
environment.

.. option:: --never-download
.. option:: --download

DEPRECATED. Retained only for backward compatibility.
This option has no effect. Virtualenv never downloads
pip or setuptools.
Download preinstalled packages from PyPI.

.. option:: --no-download

Do not download preinstalled packages from PyPI.

.. option:: --no-site-packages

Expand Down

0 comments on commit 4ac44d2

Please sign in to comment.