Skip to content

Update pre commit #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/python-poetry/poetry
rev: '1.2.2'
rev: '1.8.2'
hooks:
- id: poetry-check
- id: poetry-lock
- id: poetry-export
args: ["-f", "requirements.txt", "-o", "requirements.txt"]
args: [ "-o", "requirements.txt" ]
- repo: https://github.com/pycqa/isort
rev: '5.13.2'
hooks:
Expand All @@ -14,7 +14,3 @@ repos:
rev: '22.12.0'
hooks:
- id: black
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: 'v0.991'
# hooks:
# - id: mypy
38 changes: 29 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,65 @@ This project aims to help the video upload process.
It will create folders for each member and video
based on their uuid.

## Run server
## Development

### Pre-requisites

1. Install python (see version in pyproject.toml)
2. Install poetry
Comment on lines +9 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a list of pre-requisites is helpful for new contributors. However, it would be beneficial to include specific version requirements for Python and Poetry, or at least mention where these can be found (e.g., pyproject.toml for Python).


```shell
uvicorn src.bss_web_file_server.main:app
poetry install
```

## Development
### Set up commit hooks

```shell
uvicorn src.bss_web_file_server.main:app --reload
pre-commit install
```

## Lint
## Run server

```shell
uvicorn src.bss_web_file_server.main:app
```

### Lint

```shell
poetry run isort . --check
poetry run black . --check
poetry run mypy -p src.bss_web_file_server
```

Apply lint
#### Apply lint

```shell
poetry run isort .
poetry run black .
```

## Test
### Run development server

```shell
uvicorn src.bss_web_file_server.main:app --reload
```


### Test

```shell
poetry run pytest
```

## Build docker image
### Build docker image

```shell
docker build -t bss_web_file_server .
```

## Run docker compose
### Run docker compose

```shell
docker-compose up
```
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ mypy = "1.9.0"
[tool.isort]
profile = "black"

[tool.mypy]
packages= "src"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"