Eve: Building RESTful APIs with MongoDB and Flask Transcripts
Chapter: Setup and tools
Lecture: Working with different versions of Eve
0:01 Now we are all set, Eve is installed within its own isolated virtual environment
0:05 and we are ready to start coding and build our powerful RESTful API.
0:10 But, what if we want to play and experiment
0:13 with different versions of the framework?
0:16 Let's say that we want to use the development version of the framework
0:20 which is available on github but not on PyPi.
0:23 This might actually make sense
0:26 because by design Eve has a very slow release cycle
0:30 if we go a look at the website
0:32 we see that right now we are working on 0.8 version,
0:38 which has a lot of stuff, new stuff, fixes, new features
0:42 and even some breaking changes as you can see.
0:46 While the latest table version the one we just installed is the 0.7.5
0:51 which has been released almost one year ago.
0:54 So, it might make sense to switch to a different version of Eve
0:59 and see if our framework and our API needs some work.
1:04 This is where virtual environments really shine
1:07 because what we need to do is just create a new virtual environment
1:12 and install the new version, the different version of Eve
1:15 in its own virtual environment, let's try that.
1:26 So as you can see, I am trying to create a new virtual environment,
1:29 this time it will be called eve-course-dev,
1:36 and now I can switch to it,
1:50 and bam, as you can see, the prompt has changed,
1:52 we are now in a new virtual environment,
1:54 we left the previous one, and we switched to the new one.
1:57 In fact, if we go with pip freeze,
2:00 we don't have anything installed here.
2:03 I can go and install Eve, but if I just go with pip install Eve,
2:08 I will install the stable version again,
2:10 so how do I install the version which is available on github?
2:13 I just use the github url here,
2:16 and as you can see, pip will go and collect from github
2:22 it will first go in the repo then collect all the information,
2:26 run all the setup scripts,
2:27 and finally, we get the success message as before.
2:31 Now, let me see with pip freeze what we got here,
2:38 as you can see, we have Eve 0.8 development version
2:43 and if I switch back to the previous environment
3:00 there we go, we are back to the stable version.
3:06 And there are other differences,
3:08 for example, you see that in the stable environment,
3:10 we have this dependency here
3:13 Flask-PyMmongo, which is not available.
3:15 On the development version, as you can see,
3:18 we don't have Flask-PyMongo here,
3:20 this is because in the new version of Eve,
3:22 we dropped that dependency and we wrote our own code,
3:25 so we don't have that one anymore.
3:28 So as you can see, I can switch back and forth
3:30 between two totally different versions of Eve
3:33 and possibly other dependencies are different as well,
3:36 and I can test whatever I want
3:38 by simply switching back and forth between virtual environments.