managing project source

112 views
Skip to first unread message

Brian Craft

unread,
Nov 25, 2015, 1:43:41 PM11/25/15
to web2py-users
Just looking at web2py for the first time, and I'm not sure what to do with it: can't manage it with pip, and app code is edited in-place with the web2py code? I was expecting to be able to install & manage web2py with standard python tools & manage my app code separately, in its own repo.

How do you do it? Commit all the web2py code to your repo? Write ad hoc scripts to merge your code with the web2py code? And if the latter, what is the workflow? E.g. how do you develop & then commit your changes & deploy?

Niphlod

unread,
Nov 25, 2015, 2:52:54 PM11/25/15
to web2py-users
You're right, web2py **should** at some point provide pypi packages. Bonus points to niphlod being the first one who asked years ago :P

For the time being, I really don't see the issue: either you want to help with web2py development OR you want to develop your app.
In the former case, you use web2py and commit to your repo (forked from web2py's master), and then do a simple PR.

In the latter (which it seems your case), you have only your application's code in source control.

If you want to deploy a given release of your app, all you need is to pull your newly changed code into your application's directory, which happens to be inside web2py's folder. First step aside (installing web2py), it's really a non-issue.
First step being: "I download the web2py source and put under a directory" rather than "I install it using pip".
Upgrading web2py couldn't be easier: delete everything BUT your app's code, take the new archive and decompress where it was.

Upgrading your apps too doesn't differ: simplest way is pull directly new code from source control to the production dir.

More "finer" (and a bit more complicated) workflows, such as:
- pulling the code in another dir (working)
- put the app in maintenance (place a file called DISABLED in the app's root)
- rename working dir to production dir
- remove the DISABLED file
- compile the app 

are equally easy to implement.

Unzipping vs pip-installing is really a matter of yourself figuring out the destination dirs instead of letting pip (or your virtualenv) choosing where to put stuff into.

Dave S

unread,
Nov 25, 2015, 2:56:57 PM11/25/15
to web2py-users


On Wednesday, November 25, 2015 at 10:43:41 AM UTC-8, Brian Craft wrote:
Just looking at web2py for the first time, and I'm not sure what to do with it: can't manage it with pip, and app code is edited in-place with the web2py code? I was expecting to be able to install & manage web2py with standard python tools & manage my app code separately, in its own repo.

How do you do it? Commit all the web2py code to your repo? Write ad hoc scripts to merge your code with the web2py code? And if the latter, what is the workflow? E.g. how do you develop & then commit your changes & deploy?


The app code is self-contained in a sub-directory of web2py.  As I'm a Mercurial geek, I maintain an hg repo in that subdirectory, and clone the repo to a backup machine.  I do some editing with the appadmin editor, and some with emacs (as suits the moment).   I have a development machine and a "production" machine (both are machines are for lab use, hence the quote-marks), and have been using Fabric (www.fabfile.org) as a deployment tool.  (Grownups might prefer Chef or Salt or ....)

/dps

Ron McOuat

unread,
Nov 29, 2015, 1:20:12 AM11/29/15
to web2py-users
If you are on a Linux or OS X system then I put the application code in another area of the file system and use a symlink from the web2py applications direcory to the directory where the application code is located. When a web2py update is unpacked I copy the symlinks from theaplications directory of the older web2py version to the new version.
Reply all
Reply to author
Forward
0 new messages