Skip to content

Crazy Idea: Rewrite virtualenv #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 66 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
5bf9237
Move the virtualenv.py to virtualenv-legacy.py
dstufft Dec 24, 2014
609f033
Create the click parser and command function
dstufft Dec 24, 2014
f9955bc
Lay down the begining of an API for building environments
dstufft Dec 24, 2014
0645cb0
Get the basic workings of creating a venv style virtual environment
dstufft Dec 24, 2014
4c4022e
Add a hook we'll eventually use to install the activate scripts
dstufft Dec 25, 2014
769acd7
Install pip and setuptools into the virtual environment
dstufft Dec 25, 2014
f2de8fc
Allow passing extra search directories to the tool installation
dstufft Dec 25, 2014
d35c1d4
Move the select_builder command to virtualenv.core
dstufft Dec 25, 2014
e590bb7
Make the builders responsible for checking their own availability
dstufft Dec 25, 2014
2179ebd
Move the wheels into virtualenv/_wheels instead
dstufft Dec 25, 2014
579119f
Move the script template to the module level
dstufft Dec 25, 2014
4d70ceb
Install our activate scripts into the virtual environments
dstufft Dec 25, 2014
513b2ca
switch the default prompt to "" from None
dstufft Dec 25, 2014
5b1fcf0
Start working on the isolation side of the LegacyBuilder
dstufft Dec 25, 2014
e2c9180
Rework the LegacyBuilder so it doesn't rely on sitecustomize
dstufft Dec 29, 2014
15b20bc
Enable the --system-site-packages flag in the LegacyBuilder
dstufft Dec 29, 2014
77da573
Remove the support for doing anything other than copying
dstufft Dec 29, 2014
ebe67b2
Handle clearing of an existing virtual environment ourselves
dstufft Dec 29, 2014
3985c6a
Use io.open so it works on Python 2 too.
ionelmc Dec 29, 2014
607355f
Move platform specifics into a "system" package. The builder now take…
ionelmc Dec 29, 2014
e02a8b5
Rename to flavours.
ionelmc Dec 29, 2014
2b3ebdd
Use objects so we can have properties or other nice stuff.
ionelmc Dec 29, 2014
ea50e17
Extend flavours and use them in the builders.
ionelmc Dec 29, 2014
966efe9
Escape the paths from the generated site.py (note that there's still …
ionelmc Dec 29, 2014
cb87335
Use the correct "lib" path on windows.
ionelmc Dec 29, 2014
da19f5a
Move the list of copied modules into the flavours.
ionelmc Dec 29, 2014
14486f4
Have name and destination as instance attributes. Make the destinatio…
ionelmc Dec 29, 2014
5c345c6
Refactor some of the subprocess stuff (maybe naming is not best). On …
ionelmc Dec 29, 2014
004f6f3
Fix the setup script to work with the new package layout.
ionelmc Dec 29, 2014
a5f6101
Disable this test (need to test new internals).
ionelmc Dec 29, 2014
04f087f
Remove bogus tox.ini
ionelmc Dec 29, 2014
d949658
Add initial test skel and tox configuration.
ionelmc Dec 29, 2014
c5098b8
Further fixes to get the integration test to run.
ionelmc Dec 29, 2014
8669117
Revert "Have name and destination as instance attributes. Make the de…
dstufft Jan 4, 2015
267b93e
This API should be symlinks not symlink
dstufft Jan 4, 2015
b66f2a8
Fix PEP8 and unused imports
dstufft Jan 4, 2015
d675384
Use Americanized spelling of Flavor
dstufft Jan 4, 2015
e873e96
Refactor flavors to not be singletons and slight refactor of selection
dstufft Jan 4, 2015
91808ea
Remove the leftover bits from virtualenv legacy
dstufft Jan 4, 2015
bc2166b
Small whitespace fix
dstufft Jan 4, 2015
83f39ee
classmethods should use cls not self
dstufft Jan 4, 2015
c79c932
Use an improved tox.ini pulled from the packaging lib
dstufft Jan 4, 2015
40ca93c
Rework the packaging to be more modern and easier to read
dstufft Jan 4, 2015
9e99110
Clear out the existing tests, they are not particularly great
dstufft Jan 4, 2015
4506b98
Fix up ignores and add a coveragerc
dstufft Jan 4, 2015
17a5c82
Refactor Posix behavior out of BaseFlavor into PosixFlavor
dstufft Jan 4, 2015
598494b
Test the virtualenv.flavors support
dstufft Jan 4, 2015
38749a0
Add virtualenv.create function to enable easy virtualenv creation
dstufft Jan 4, 2015
f8a7bd8
Add from __future__ imports to all files
dstufft Jan 4, 2015
93e5564
Fix Python 2.6 compatability
dstufft Jan 4, 2015
76d40a9
Fixup the documentation building
dstufft Jan 4, 2015
562a332
A few style fixes to make flake8 happy
dstufft Jan 4, 2015
f729a77
Test the virtualenv._utils module
dstufft Jan 4, 2015
a3b3d9c
Compatability only code doesn't need covered
dstufft Jan 4, 2015
464187b
Move the CLI integration into it's own module
dstufft Jan 4, 2015
2d60935
Test the core API
dstufft Jan 4, 2015
937ee6c
Move the unit tests down one level into a tests/unit directory
dstufft Jan 4, 2015
112a954
Differentiate between unit and functional tests
dstufft Jan 4, 2015
e019e1e
Test the BaseBuilder
dstufft Jan 5, 2015
7d82493
Test multiple extra search dirs as well
dstufft Jan 5, 2015
82d4bdb
Backport subprocess.check_output to Pytohn 2.6
dstufft Jan 5, 2015
c6f16d7
Add the missing environments
dstufft Jan 5, 2015
05c93c7
Fix up the packaging to include everything
dstufft Jan 5, 2015
00a0062
Test the VenvBuilder
dstufft Jan 5, 2015
6421ffe
We don't need sudo so set sudo: false to get Docker build env
dstufft Jan 5, 2015
0a50327
Fix legacy builder on OS X
dstufft Jan 5, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
branch = True
source = virtualenv
23 changes: 13 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
virtualenv.egg-info
build
dist
docs/_build
.DS_Store
*.pyc
mock-*.egg
nose-*.egg
.tox
tests/test_activate_actual.output
*.egg-info/
*.egg
*.py[co]

.tox/
.cache/
.coverage

__pycache__/
_build/
build/
dist/
htmlcov/
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: python

sudo: false

env:
- TOXENV=py26
- TOXENV=py27
Expand All @@ -9,6 +11,9 @@ env:
- TOXENV=pypy
- TOXENV=pypy3
- TOXENV=docs
- TOXENV=pep8
- TOXENV=py2pep8
- TOXENV=packaging

install: pip install tox

Expand Down
16 changes: 7 additions & 9 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
recursive-include bin *
recursive-include docs *
recursive-include scripts *
recursive-include virtualenv_support *.whl
recursive-include virtualenv_embedded *
recursive-exclude docs/_templates *
recursive-exclude docs/_build *
include virtualenv_support/__init__.py
include *.py
include AUTHORS.txt
include CONTRIBUTING.rst
include LICENSE.txt

include .coveragerc
include tox.ini

recursive-include docs Makefile make.bat *.py *.rst *.empty
recursive-include tests *.py
71 changes: 0 additions & 71 deletions bin/rebuild-script.py

This file was deleted.

File renamed without changes.
177 changes: 62 additions & 115 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,149 +1,96 @@
# -*- coding: utf-8 -*-
#
# Paste documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 22 22:08:49 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
#
# All configuration values have a default value; values that are commented out
# serve to show the default value.
from __future__ import absolute_import, division, print_function

import os
import sys

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
try:
import sphinx_rtd_theme
except ImportError:
sphinx_rtd_theme = None


base_dir = os.path.join(os.path.dirname(__file__), os.pardir)
about = {}
with open(os.path.join(base_dir, "virtualenv", "__about__.py")) as f:
exec(f.read(), about)

# If your extensions are in another directory, add it here.
sys.path.insert(0, os.path.abspath(os.pardir))

# General configuration
# ---------------------
# -- General configuration ----------------------------------------------------

# 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']
# 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",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
]

# 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']
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'

# General substitutions.
project = 'virtualenv'
copyright = '2007-2014, Ian Bicking, The Open Planning Project, PyPA'

# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
try:
from virtualenv import __version__
# The short X.Y version.
version = '.'.join(__version__.split('.')[:2])
# The full version, including alpha/beta/rc tags.
release = __version__
except ImportError:
version = release = 'dev'
master_doc = "index"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'
# General information about the project.
project = about["__title__"]
copyright = about["__copyright__"]

# List of documents that shouldn't be included in the build.
unused_docs = []

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
version = release = about["__version__"]

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"


# Options for HTML output
# -----------------------
# -- Options for HTML output --------------------------------------------------

# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
#html_style = 'default.css'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

html_theme = 'default'
if not on_rtd:
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
except ImportError:
pass
if sphinx_rtd_theme:
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
else:
html_theme = "default"


# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

# Content template for the index page.
#html_index = ''

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}

# If false, no module index is generated.
#html_use_modindex = True

# If true, the reST sources are included in the HTML build as _sources/<name>.
#html_copy_source = True
html_static_path = ["_static"]

# Output file base name for HTML help builder.
htmlhelp_basename = 'Pastedoc'


# Options for LaTeX output
# ------------------------

# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
htmlhelp_basename = "virtualenvdoc"

# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
#latex_documents = []
# -- Options for manual page output -------------------------------------------

# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(
"index",
"virtualenv",
"virtualenv Documentation",
about["__author__"],
1,
),
]

# Documents to append as an appendix to all manuals.
#latex_appendices = []
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"https://docs.python.org/": None,
}

# If false, no module index is generated.
#latex_use_modindex = True
epub_theme = "epub"
3 changes: 0 additions & 3 deletions scripts/virtualenv

This file was deleted.

Loading