简体   繁体   中英

Deploy python app and as part of process install python, git, virtualenv on windows

How would i have a self contained setup file that would do the following processes...

  1. Install python 2.7 (it just download/launch the python installer doesn't have to automate it just get and launch it)
  2. Install Git (same as above)
  3. Install PiP
  4. Install Python Virtualenv
  5. Clone a repo
  6. create virtualenv
  7. Activate the virtualenv
  8. pip install the requirements folder
  9. create a desktop shortcut

I am not looking for a how to i am just trying to save myself 100 steps when i deploy the app i have just finished. Before i write any custom scripts i wanted to make sure there wasn't already a good tool or best practice to handle this kind of setup process.

In the past i have just frozen my apps and deployed them as an exe using a setup wizard like INNO but i really like the idea of just dropping the repo on the users machine and then letting the app pull from master when a new release comes out without having to repackage and distribute an exe each time.

My other thought was maybe just turn the entire thing into an egg and just deploy it as a python package that is installed from pip using a git repo. This seems like the best bet but still leaves me installing all the requirements. The other downside is i lose the virtualenv so updating the app as an egg would also update requirements in the users main python lib and that just doesn't sit well with me.

The app actually updates itself based by comparing the local version number and the corresponding database version number. If they don't match it git pulls the changes and then runs pip install -r requirements.txt to catch any new packages that may be needed.

We done something very similar to this. Here's what we did. Create an installer (we used NSIS http://nsis.sourceforge.net/Main_Page ) that installs python. After python is installed, we then run a python script that performs the rest of the steps.

Once you have python on your target, the rest of the steps are a piece of cake.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM