README updates

This commit is contained in:
samathad2023
2024-03-19 09:18:46 -07:00
parent cf25933cd0
commit aa0b2e49e1

View File

@@ -41,7 +41,7 @@ You will need the following items:
This project currently works with these major versions of the following main
components:
- Python 3.9.x
- Python 3.12.x
- PostgreSQL 15.x (version 12.x is used in the hosted environments)
These instructions will walk you through how to set your machine up with all of
@@ -175,12 +175,12 @@ session to make the changes take effect.
Now we're ready to install the Python version we need with `pyenv`, like so:
```sh
pyenv install 3.9
pyenv install 3.12
```
This will install the latest version of Python 3.9.
This will install the latest version of Python 3.12.
_NOTE: This project currently runs on Python 3.9.x._
_NOTE: This project currently runs on Python 3.12.x._
#### Python Dependency Installation
@@ -261,16 +261,16 @@ git clone git@github.com:GSA/notifications-api.git
Now go into the project directory (`notifications-api` by default), create a
virtual environment, and set the local Python version to point to the virtual
environment (assumes version Python `3.9.18` is what is installed on your
environment (assumes version Python `3.12.2` is what is installed on your
machine):
```sh
cd notifications-api
pyenv virtualenv 3.9.18 notify-api
pyenv virtualenv 3.12.2 notify-api
pyenv local notify-api
```
_If you're not sure which version of Python was installed with `pyenv`, you can check by running `pyenv versions` and it'll list everything available currently._
_If you're not sure which version of Python was installed with `pyenv`, you can check by running `pyenv versions` and it'll list everything available currently.You should see the virtual environment name in terminal as 'notify-api'._
Now [log into cloud.gov](https://cloud.gov/docs/getting-started/setup/#set-up-the-command-line)
in the command line by using this command:
@@ -301,6 +301,31 @@ brew services start postgresql@15
brew services start redis
```
### Switching to different environment
Once all of pre-requisites for the project are installed and to switch to newer environment with newer python version follow the below steps to create new virtual environment.
First install the newer Python version we need with `pyenv`, (say the planned upgrade to 3.15) like so :
```sh
pyenv install 3.15
```
Now go into the project directory (`notifications-api` by default), create a
virtual environment, and set the local Python version to point to the virtual
environment (assumes version Python `3.15.2` is what is installed on your
machine):
```sh
cd notifications-api
pyenv virtualenv 3.15.2 notify-api-upgrade
pyenv local notify-api-upgrade
```
_If you're not sure which version of Python was installed with `pyenv`, you can check by running `pyenv versions` and it'll list everything available currently.you can deactivate the current environment by running `source deactivate` or `deactivate`.Close the terminal and reopen a new terminal should see the newer virtual environment name in terminal as 'notify-api-upgrade'. you can the get python version ,executable, and other details for this environment by running `poetry env info`._
### Final environment setup
There's one final thing to adjust in the newly created `.env` file. This