Before you begin, ensure you have met the following requirements:
- Python (>= 3.11)
- Poetry (for managing dependencies and building the project)
To install the project and its dependencies, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/your-project.git cd your-project -
Install Poetry (if not already installed):
pip install poetry
Set up the project using Poetry:
poetry install
This will install all the required dependencies.
-
Install pre-commit
poetry run pre-commit install
This will install pre-commit hooks to run before each commit. If any of the hooks fail, the commit will be aborted.
- Open a terminal and navigate to your project's root directory, where your pyproject.toml file is located.
- Use Poetry's add command to add a new package as a runtime dependency. Replace package-name with the name of the package you want to add:
poetry add package-name
Development packages are dependencies that are only required during development, such as testing libraries or code formatting tools. Here's how to add a development package:
- Open a terminal and navigate to your project's root directory, where your pyproject.toml file is located.
- Use Poetry's add command with the --dev flag to add a package as a development dependency. Replace dev-package-name with the name of the development package you want to add:
poetry add --group dev dev-package-name
- To install all development dependencies (useful for continuous integration or other developers working on your project), you can run:
poetry install --no-root