To get started with this project, follow these steps:
-
Create a Virtual Environment:
python3.11 -m venv .venv
This command creates a virtual environment named
.venvin your project directory. -
Activate the Virtual Environment:
-
On macOS and Linux:
source .venv/bin/activateOnce activated, you should see
(.venv)at the beginning of your terminal prompt.
-
-
Install Poetry:
pip install poetry
-
Install Project Dependencies:
poetry install
Poetry will read the
pyproject.tomlandpoetry.lockfiles to install the exact versions of the dependencies required for this project within your active virtual environment.
This project uses Poetry to manage its dependencies. Here's how to handle common dependency-related tasks:
If you need to add a new dependency to the project:
-
Use the
poetry addcommand: Open your terminal, ensure your virtual environment is activated, and navigate to the project's root directory. Then, run the following command, replacing<package-name>with the name of the package you want to add:poetry add <package-name>
You can also specify a version constraint if needed:
poetry add <package-name>@^1.2.3
-
Poetry will update
pyproject.tomlandpoetry.lock: After successfully adding the dependency, Poetry will automatically update thepyproject.tomlfile with the new dependency and its version constraint. It will also update thepoetry.lockfile to reflect the exact versions of all dependencies, including the newly added one and its transitive dependencies.
To update dependencies to their latest compatible versions:
-
Use the
poetry updatecommand: In your terminal, with the virtual environment activated and in the project's root directory, run:poetry update
This command will look for newer compatible versions of your dependencies as specified in
pyproject.tomland updatepoetry.lockaccordingly. -
Update specific dependencies: To update specific packages, you can name them:
poetry update <package-name1> <package-name2>
If you've manually edited the pyproject.toml file (e.g., changed version constraints), you should run the poetry lock command to update the poetry.lock file to reflect these changes:
poetry lock