Skip to content

Commit

Permalink
more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeAeich committed Jul 8, 2024
1 parent bd21c35 commit 8500a67
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/elixir-cloud-aai/cookiecutter-python",
"commit": "dc0f027857b60851e3cb40663f662add4343ef5a",
"commit": "5c50248527fc91252e31cb971aad02a455f64e1c",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--only=lint --no-root"
poetry-export-options: "--only=lint"
poetry-install-options: "--only=code_quality --no-root"
poetry-export-options: "--only=code_quality --no-root"

- name: Check code style
run: poetry run ruff format --check
Expand All @@ -40,8 +40,8 @@ jobs:
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--only=lint --no-root"
poetry-export-options: "--only=lint"
poetry-install-options: "--only=code_quality --no-root"
poetry-export-options: "--only=code_quality"

- name: Check code quality
run: poetry run ruff check .
Expand All @@ -58,8 +58,8 @@ jobs:
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--only=lint --no-root"
poetry-export-options: "--only=lint"
poetry-install-options: "--only=code_quality --no-root"
poetry-export-options: "--only=code_quality"

- name: Check spellings
run: poetry run typos .
Expand All @@ -76,8 +76,8 @@ jobs:
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--with=types --no-root"
poetry-export-options: "--with=types"
poetry-install-options: "--with=code_quality,types --no-root"
poetry-export-options: "--with=code_quality,types"

- name: Check types
run: poetry run mypy tus_storagehandler/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--with=docs"
poetry-export-options: "--with=docs"
poetry-install-options: "--with=docs,types --no-root"
poetry-export-options: "--with=docs,types"

- name: Generate API docs
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--with=misc --no-root"
poetry-export-options: "--with=misc"
poetry-install-options: "--only=misc --no-root"
poetry-export-options: "--only=misc"

- name: Update project structure
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/vulnerability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--only=security --no-root"
poetry-export-options: "--only=security"
poetry-install-options: "--only=vulnerability --no-root"
poetry-export-options: "--only=vulnerability"

- name: Check code vulnerabilities with bandit
run: poetry run bandit -c pyproject.toml -r tus_storagehandler/
Expand All @@ -40,8 +40,8 @@ jobs:
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--only=security --no-root"
poetry-export-options: "--only=security"
poetry-install-options: "--only=vulnerability --no-root"
poetry-export-options: "--only=vulnerability"

- name: Check dependency vulnerabilities with safety
run: poetry run safety check --full-report
Expand Down
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,31 @@ Here are certain commands that you might find useful:
make v
```

- Installing dependencies
- Installing all dependencies including optional dependencies

```sh
make i
```

> **Note**: This project uses optional dependency groups such as `types`,
> `code_quality`, `docs`, `vulnerability`, `test`, and `misc`. To install stubs
> or types for the dependencies, you **must** use the following command:
>
> ```sh
> poetry add types-foo --group types
> ```
>
> Replace `types-foo` with the name of the package for the types. All runtime
> dependencies should be added to the `default` group. For example, to install
> `requests` and its type stubs, run:
>
> ```sh
> poetry add requests
> poetry add types-requests --group types
> ```
>
> This ensures that the type checker functions correctly.
- Running tests
```sh
Expand Down
261 changes: 131 additions & 130 deletions poetry.lock

Large diffs are not rendered by default.

29 changes: 21 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ version = "0.1.0"
[tool.poetry.dependencies]
python = ">=3.11"

[tool.poetry.group.code_quality]
optional = true

[tool.poetry.group.code_quality.dependencies]
mypy = ">=1.10.0,<2.0.0"
ruff = ">=0.4.10,<1.0.0"
typos = ">=1.22.8,<2.0.0"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
added-value = ">=0.24.0,<1.0.0"
docutils = "0.20.1"
Expand All @@ -34,25 +45,27 @@ sphinx = "^7.3.7"
sphinx-autodoc-typehints = "^2.1.0"
tomli = ">=2.0.1,<3.0.0"

[tool.poetry.group.lint.dependencies]
ruff = ">=0.4.10,<1.0.0"
typos = ">=1.22.8,<2.0.0"
[tool.poetry.group.misc]
optional = true

[tool.poetry.group.misc.dependencies]
cruft = ">=2.15.0,<3.0.0"
jello = ">=1.6.0,<2.0.0"
pre-commit = ">=3.7.1,<4.0.0"

[tool.poetry.group.security.dependencies]
bandit = ">=1.7.8,<2.0.0"
safety = ">=3.2.0,<4.0.0"
[tool.poetry.group.test]
optional = true

[tool.poetry.group.test.dependencies]
pytest = ">=8.2.2,<9.0.0"
pytest-cov = ">=5.0.0,<=6.0.0"

[tool.poetry.group.types.dependencies]
mypy = ">=1.10.0,<2.0.0"
[tool.poetry.group.vulnerability]
optional = true

[tool.poetry.group.vulnerability.dependencies]
bandit = ">=1.7.8,<2.0.0"
safety = ">=3.2.0,<4.0.0"

[tool.ruff]
indent-width = 4
Expand Down

0 comments on commit 8500a67

Please sign in to comment.