pip install web2py

738 views
Skip to first unread message

Chris Steel

unread,
Aug 10, 2011, 4:07:54 PM8/10/11
to web2py-users

Users of pip and virtual environments (virtualenv) can now make user of the latest version of Web2py when installing from Pypi  and have the options of a "standard" Web2py setup available via a new command called web2py_clone.

This is only available to users making use of:

pip install web2py


about web2py_clone


web2py_clone was designed for folks who might be new to one or more of the following; Web2py, pip, virtual environments, mercurial, python...

web2py_clone uses (and requires) mercurial (pip install mercurial) to create a clone from the Web2py project on Google Code in a directory called "web2py" that gets place in the virtualenv in a relatively "fixed" location that most people will be able to find and understand quickly and easily:

So activating a virtual environment with:

source ./bin/activate

and then running:

web2py_clone

creates a "standard" local clone of Web2py in:

./web2py

Everything should look and act like plain old Web2py cause that is what it is, plain old Web2py. So running ./bin/python ./web2py/web2py.py will start it up.

Advance pip / Virtualenv Stuff

If you have been around the block a few times or are looking for the "old" "advanced" features as outlined in that cool video you saw a while back you are going to want to look into the original commands, mkweb2pyenv and runweb2py. It would be a good idea to examine each command and each commands doc string, but we are assuming you will have no problem with this since you are going for the option clearly marked as "advanced" right ; )

I would like to rename or combine these commands are some point in time for various reasons, some outline in the commands docstrings. Comments welcomed.

Enjoy,

Chris

nekrox

unread,
Aug 27, 2011, 10:16:33 AM8/27/11
to web2py-users
Hi de packages has a bug, when i exec mkweb2pyenv the script dont
found env.tar and the web2pyenv dont create.


On 10 ago, 15:07, Chris Steel <chris.st...@gmail.com> wrote:
> Users of pip and virtual environments (virtualenv) can now make user of the
> latest version of Web2py when installing from Pypi  and have the options of
> a "standard" Web2py setup available via a new command called web2py_clone.
>
> This is only available to users making use of:
>
> *pip install web2py*
>
> *
> about web2py_clone*
>
> web2py_clone was designed for folks who might be new to one or more of the
> following; Web2py, pip, virtual environments, mercurial, python...
>
> web2py_clone uses (and requires) mercurial (pip install mercurial) to create
> a clone from the Web2py project on Google Code in a directory called
> "web2py" that gets place in the virtualenv in a relatively "fixed" location
> that most people will be able to find and understand quickly and easily:
>
> So activating a virtual environment with:
>
> source ./bin/activate
>
> and then running:
>
> web2py_clone
>
> creates a "standard" local clone of Web2py in:
>
> ./web2py
>
> Everything should look and act like plain old Web2py cause that is what it
> is, plain old Web2py. So running ./bin/python ./web2py/web2py.py will start
> it up.
>
> *Advance pip / Virtualenv Stuff*

Christopher Steel

unread,
Aug 28, 2011, 2:17:39 PM8/28/11
to web...@googlegroups.com
You found a glitch, good call nekrox.

The updated version does not include env.tar for some reason, I will check it out.

In the mean tine here a link to the old version which does include env.tar (it is also included in Web2py)

    http://pypi.python.org/packages/source/w/web2py/web2py-1.96.4.tar.gz

Chris

Christopher Steel

unread,
Aug 28, 2011, 2:30:21 PM8/28/11
to web...@googlegroups.com
Note: We ( I? ) could get a mercurial repo going for this in order to make it easier to maintain. Now it is a scattered collection of files. In the mean time here is a rough how to for anyone that needs it...

Creating your own pip installable pypi dstribution of Web2py

If you have the latest version of Web2py it is easy to create your own custom pip installable Web2py package.

Option 1

For testing you can create the pypi package (pypi refers to them as distributions) by running the following command in the targeted version of Web2py::

    cd web2py
    rm ./dist/web2py-1.98.2.tar.gz
    python setup.py sdist

Running the command in web2py directory of Web2py version 1.98.2 will result in the creation of a new pip installable distribution in ./web2py/dist::

    ./web2py/dist/web2py-1.98.2.tar.gz

Installing via pip

You can then install the new package via pip by running something like the following::

    pip install ./dist/web2py-1.98.2.tar.gz

and you will

Option 2 -  Automation

You can create the pypi package from any up to date installation of web2py manually doing something like this::

    cd web2py
    make pip

If run from Web2py version 1.98.2 will result in::

    ./web2py/dist/web2py-1.98.2.tar.gz


BUG as of 2011-08-28

env.tar

env.tar is suppose to be automatically created and copied to the resulting tar.gz's gluon directory. This is not working at the moment so you will need to do this manually.


Christopher Steel

unread,
Aug 28, 2011, 6:27:56 PM8/28/11
to web...@googlegroups.com

Fix is posted here

    http://code.google.com/p/web2pypi/

basically copy everything into web2py's main directory and then from the terminal run:

    python setup sdist

This will create an updated package in web2py/dist that you can install using similar to:

    pip install web2py-1.98.2.tar.gz

I will get these out to Massimo and update pypi as well...

Cheers

Chris

Christopher Steel

unread,
Aug 28, 2011, 8:45:16 PM8/28/11
to web...@googlegroups.com
Done, now in trunk and in Pypi.

See http://code.google.com/p/web2pypi/ for details

Running:

pip install web2py

now gives you

    w2p_clone - replaces web2py_clone

    w2p_apps - replaces mkweb2pyenv

    w2p_run - replaces runweb2py

Cheers,

Chris
Reply all
Reply to author
Forward
0 new messages