-
-
Couldn't load subscription status.
- Fork 1.1k
[WIP] Docs refactor #562
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
Closed
[WIP] Docs refactor #562
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8ea806d
Move news to be a changelog
Ivoz ee63fa8
Move news to index.rst
Ivoz 527b699
Add intro, toctree, docs / links, contrast
Ivoz 6b1411a
Move development sections to this page
Ivoz f0377b1
Installation instructions
Ivoz 9622d1b
Guide on virtualenv's major parts
Ivoz 5848d96
Usage, options, config, extending
Ivoz 685b521
Remove all-in-one page
Ivoz d733193
Allow virtualenv to build again! Yay!
Ivoz 8a7364c
Allow local use of rtd theme alla pip
Ivoz 6b092ce
Capitalization Is Awesome
Ivoz 2a2cca9
Fix docs typos, thanks @alex
Ivoz 5a698d9
Move changelog entries to be 3rd level
Ivoz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| Development | ||
| =========== | ||
|
|
||
| Contributing | ||
| ------------ | ||
|
|
||
| Refer to the `pip development`_ documentation - it applies equally to | ||
| virtualenv, except that virtualenv issues should filed on the `virtualenv | ||
| repo`_ at GitHub. | ||
|
|
||
| Virtualenv's release schedule is tied to pip's -- each time there's a new pip | ||
| release, there will be a new virtualenv release that bundles the new version of | ||
| pip. | ||
|
|
||
| Files in the `virtualenv_embedded/` subdirectory are embedded into | ||
| `virtualenv.py` itself as base64-encoded strings (in order to support | ||
| single-file use of `virtualenv.py` without installing it). If your patch | ||
| changes any file in `virtualenv_embedded/`, run `bin/rebuild-script.py` to | ||
| update the embedded version of that file in `virtualenv.py`; commit that and | ||
| submit it as part of your patch / pull request. | ||
|
|
||
| .. _pip development: http://www.pip-installer.org/en/latest/development.html | ||
| .. _virtualenv repo: https://github.com/pypa/virtualenv/ | ||
|
|
||
| Running the tests | ||
| ----------------- | ||
|
|
||
| Virtualenv's test suite is small and not yet at all comprehensive, but we aim | ||
| to grow it. | ||
|
|
||
| The easy way to run tests (handles test dependencies automatically):: | ||
|
|
||
| $ python setup.py test | ||
|
|
||
| If you want to run only a selection of the tests, you'll need to run them | ||
| directly with nose instead. Create a virtualenv, and install required | ||
| packages:: | ||
|
|
||
| $ pip install nose mock | ||
|
|
||
| Run nosetests:: | ||
|
|
||
| $ nosetests | ||
|
|
||
| Or select just a single test file to run:: | ||
|
|
||
| $ nosetests tests.test_virtualenv | ||
|
|
||
| Status and License | ||
| ------------------ | ||
|
|
||
| ``virtualenv`` is a successor to `workingenv | ||
| <http://cheeseshop.python.org/pypi/workingenv.py>`_, and an extension | ||
| of `virtual-python | ||
| <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_. | ||
|
|
||
| It was written by Ian Bicking, sponsored by the `Open Planning | ||
| Project <http://openplans.org>`_ and is now maintained by a | ||
| `group of developers <https://github.com/pypa/virtualenv/raw/master/AUTHORS.txt>`_. | ||
| It is licensed under an | ||
| `MIT-style permissive license <https://github.com/pypa/virtualenv/raw/master/LICENSE.txt>`_. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,131 @@ | ||
|
|
||
| virtualenv | ||
| Virtualenv | ||
| ========== | ||
|
|
||
| `Changes & News <news.html>`_ | | ||
| `Mailing list <http://groups.google.com/group/python-virtualenv>`_ | | ||
| `Issues <https://github.com/pypa/virtualenv/issues>`_ | | ||
| `Github <https://github.com/pypa/virtualenv>`_ | | ||
| `PyPI <https://pypi.python.org/pypi/virtualenv/>`_ | | ||
| User IRC: #pypa | ||
| Dev IRC: #pypa-dev | ||
|
|
||
| .. comment: split here | ||
| Introduction | ||
| ------------ | ||
|
|
||
| ``virtualenv`` is a tool to create isolated Python environments. | ||
|
|
||
| The basic problem being addressed is one of dependencies and versions, | ||
| and indirectly permissions. Imagine you have an application that | ||
| needs version 1 of LibFoo, but another application requires version | ||
| 2. How can you use both these applications? If you install | ||
| everything into ``/usr/lib/python2.7/site-packages`` (or whatever your | ||
| platform's standard location is), it's easy to end up in a situation | ||
| where you unintentionally upgrade an application that shouldn't be | ||
| upgraded. | ||
|
|
||
| Or more generally, what if you want to install an application *and | ||
| leave it be*? If an application works, any change in its libraries or | ||
| the versions of those libraries can break the application. | ||
|
|
||
| Also, what if you can't install packages into the global | ||
| ``site-packages`` directory? For instance, on a shared host. | ||
|
|
||
| In all these cases, ``virtualenv`` can help you. It creates an | ||
| environment that has its own installation directories, that doesn't | ||
| share libraries with other virtualenv environments (and optionally | ||
| doesn't access the globally installed libraries either). | ||
|
|
||
| .. comment: split here | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
|
|
||
| virtualenv | ||
| installation | ||
| userguide | ||
| reference | ||
| development | ||
| changes | ||
|
|
||
| .. warning:: | ||
|
|
||
| Python bugfix releases 2.6.8, 2.7.3, 3.1.5 and 3.2.3 include a change that | ||
| will cause "import random" to fail with "cannot import name urandom" on any | ||
| virtualenv created on a Unix host with an earlier release of Python | ||
| 2.6/2.7/3.1/3.2, if the underlying system Python is upgraded. This is due to | ||
| the fact that a virtualenv uses the system Python's standard library but | ||
| contains its own copy of the Python interpreter, so an upgrade to the system | ||
| Python results in a mismatch between the version of the Python interpreter | ||
| and the version of the standard library. It can be fixed by removing | ||
| ``$ENV/bin/python`` and re-running virtualenv on the same target directory | ||
| with the upgraded Python. | ||
|
|
||
| Other Documentation and Links | ||
| ----------------------------- | ||
|
|
||
| * `Blog announcement of virtualenv`__. | ||
|
|
||
| .. __: http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/ | ||
|
|
||
| * James Gardner has written a tutorial on using `virtualenv with | ||
| Pylons | ||
| <http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox>`_. | ||
|
|
||
| * Chris Perkins created a `showmedo video including virtualenv | ||
| <http://showmedo.com/videos/video?name=2910000&fromSeriesID=291>`_. | ||
|
|
||
| * Doug Hellmann's `virtualenvwrapper`_ is a useful set of scripts to make | ||
| your workflow with many virtualenvs even easier. `His initial blog post on it`__. | ||
| 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 | ||
|
|
||
| * `Pew`_ is another wrapper for virtualenv that makes use of a different | ||
| activation technique. | ||
|
|
||
| .. _Pew: https://pypi.python.org/pypi/pew/ | ||
|
|
||
| * `Using virtualenv with mod_wsgi | ||
| <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_. | ||
|
|
||
| * `virtualenv commands | ||
| <https://github.com/thisismedium/virtualenv-commands>`_ for some more | ||
| workflow-related tools around virtualenv. | ||
|
|
||
| Compare & Contrast with Alternatives | ||
| ------------------------------------ | ||
|
|
||
| There are several alternatives that create isolated environments: | ||
|
|
||
| * ``workingenv`` (which I do not suggest you use anymore) is the | ||
| predecessor to this library. It used the main Python interpreter, | ||
| but relied on setting ``$PYTHONPATH`` to activate the environment. | ||
| This causes problems when running Python scripts that aren't part of | ||
| the environment (e.g., a globally installed ``hg`` or ``bzr``). It | ||
| also conflicted a lot with Setuptools. | ||
|
|
||
| * `virtual-python | ||
| <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_ | ||
| is also a predecessor to this library. It uses only symlinks, so it | ||
| couldn't work on Windows. It also symlinks over the *entire* | ||
| standard library and global ``site-packages``. As a result, it | ||
| won't see new additions to the global ``site-packages``. | ||
|
|
||
| This script only symlinks a small portion of the standard library | ||
| into the environment, and so on Windows it is feasible to simply | ||
| copy these files over. Also, it creates a new/empty | ||
| ``site-packages`` and also adds the global ``site-packages`` to the | ||
| path, so updates are tracked separately. This script also installs | ||
| Setuptools automatically, saving a step and avoiding the need for | ||
| network access. | ||
|
|
||
| * `zc.buildout <http://pypi.python.org/pypi/zc.buildout>`_ doesn't | ||
| create an isolated Python environment in the same style, but | ||
| achieves similar results through a declarative config file that sets | ||
| up scripts with very particular packages. As a declarative system, | ||
| it is somewhat easier to repeat and manage, but more difficult to | ||
| experiment with. ``zc.buildout`` includes the ability to setup | ||
| non-Python systems (e.g., a database server or an Apache instance). | ||
|
|
||
| I *strongly* recommend anyone doing application development or | ||
| deployment use one of these tools. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| Installation | ||
| ============ | ||
|
|
||
| .. warning:: | ||
|
|
||
| We advise installing virtualenv-1.9 or greater. Prior to version 1.9, the | ||
| pip included in virtualenv did not not download from PyPI over SSL. | ||
|
|
||
| .. warning:: | ||
|
|
||
| When using pip to install virtualenv, we advise using pip 1.3 or greater. | ||
| Prior to version 1.3, pip did not download from PyPI over SSL. | ||
|
|
||
| .. warning:: | ||
|
|
||
| We advise against using easy_install to install virtualenv when using | ||
| setuptools < 0.9.7, because easy_install didn't download from PyPI over SSL | ||
| and was broken in some subtle ways. | ||
|
|
||
| To install globally with `pip` (if you have pip 1.3 or greater installed globally): | ||
|
|
||
| :: | ||
|
|
||
| $ [sudo] pip install virtualenv | ||
|
|
||
| Or to get the latest unreleased dev version: | ||
|
|
||
| :: | ||
|
|
||
| $ [sudo] pip install https://github.com/pypa/virtualenv/tarball/develop | ||
|
|
||
|
|
||
| To install version X.X globally from source: | ||
|
|
||
| :: | ||
|
|
||
| $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz | ||
| $ tar xvfz virtualenv-X.X.tar.gz | ||
| $ cd virtualenv-X.X | ||
| $ [sudo] python setup.py install | ||
|
|
||
|
|
||
| To *use* locally from source: | ||
|
|
||
| :: | ||
|
|
||
| $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz | ||
| $ tar xvfz virtualenv-X.X.tar.gz | ||
| $ cd virtualenv-X.X | ||
| $ python virtualenv.py myVE | ||
|
|
||
| .. note:: | ||
|
|
||
| The ``virtualenv.py`` script is *not* supported if run without the | ||
| necessary pip/setuptools/virtualenv distributions available locally. All | ||
| of the installation methods above include a ``virtualenv_support`` | ||
| directory alongside ``virtualenv.py`` which contains a complete set of | ||
| pip and setuptools distributions, and so are fully supported. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like all this showing up at the bottom of the index page below the TOC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"all this" being everything below this mark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually looking for a way to stop the TOCTree from showing the huge number of Changelog headings; then the index would not be a massive page break between the top and bottom of the page.
But I agree something should be done about the reach-ability of that content; I just wasn't quite sure how to do so yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the "trick" for not showing the Changelog sections has always been to embed it below the first level. that's why I was thinking to put it under development, but if you can come up with something better, go for it. I like the idea of the Changelog or "Release History" being a top-level TOC entry.