Enhanced Python “Installfest”
Using Package Installers and Test Scripts
- Question: Can we use Python to help learners prepare for Python?
- Answer: Yes, we can!
Authors: Jeff Boykin, Sonyl Nagale
Manual "installfest" sessions can be a lengthy process for students and instructors. Unique hardware configurations, permissions issues, and lack of clear requirements can all cause problems.
We can't fix all of those things... but we can fix one of them!
By (a) defining clear tech requirements and (b) providing a test that confirms confirms student hardware against those requirements, while (c) flagging problems in an intuitive manner, we can make installfest dramatically more efficient for students and instructors alike.
- requirements.txt - currently configured for Python PT course materials
- config.ini - currently configured for Python PT course materials
- Note: These two items must be kept up to date and should list the same package versions in order to ensure that tests and installations run successfully.
- Students should first complete local Python set up as a prerequisite step. Instructions for this can be found here.
- Once local Python is installed, students should install Virtualenv to create a pythonic sandbox. Open a new terminal window and run the following command:
pip install virtualenv.
- Create a directory for coursework, e.g.
- Navigate into that directory:
- Set up a virtual environment in that directory:
- Activate the virtual environment:
- From this point forward, students are in a virtual environment!.
- Working in this environment during the course is more stable for students.
- N.b. time will have to be allotted for starting and stopping environments.
- Run the test script:
cd tests; python test_package_versions.py.
- Run the installation:
cd ..; pip install -r requirements.txt.
- Re-run the test script to ensure package cohesion.