Skip to content

Commit

Permalink
feat: update Python dependencies and dev-docs for pre-commit hooks (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
WildfootW authored Apr 8, 2024
2 parents 84fccd5 + 4bc1e82 commit c89b7c8
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dev-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,20 @@ Some basic Python conventions:
- Indent and space your code properly for readability
- Add docstrings to document your code

#### Setup Pre-commit Hooks
1. **Virtual Environment**:
- Create: `python -m venv .venv`
- Activate:
- Windows: `.venv\Scripts\activate`
- macOS/Linux: `source .venv/bin/activate`

2. **Install Poetry** in the virtual environment: `pip install poetry`
- *Note*: While it's feasible to install Poetry within a `.venv` for project-specific usage, consider the [official installation method](https://python-poetry.org/docs/#installation) for managing multiple projects more effectively.

3. **Install Dependencies**: Execute `poetry install --no-root` to install dependencies specified in `pyproject.toml`, excluding the project package itself.

4. Initialize pre-commit hooks with `poetry run pre-commit install` to ensure code quality checks are performed before each commit.

### Standards for code commenting and documentation.
#### Docstrings
- All public functions, classes, and modules should have docstrings following the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings)
Expand Down
215 changes: 215 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ description = "Enhancing TWSE Investment Experience with a Python-based Chatbot,
authors = ["wildfootw <wildfootw@wildfoo.tw>", "soyccan <soyccan@gmail.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"

[tool.poetry.group.dev.dependencies]
isort = "^5.13.2"
pre-commit = "^3.6.0"

0 comments on commit c89b7c8

Please sign in to comment.