Skip to content

Commit

Permalink
Use common config
Browse files Browse the repository at this point in the history
  • Loading branch information
spapanik committed Jul 14, 2023
1 parent b3b8bc3 commit f29afb4
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 68 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/lint.yml

This file was deleted.

91 changes: 66 additions & 25 deletions .github/workflows/tests.yml
@@ -1,36 +1,77 @@
name: tests

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]

branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: Gr1N/setup-poetry@v8
- name: Use cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel yamk
. $(poetry env use python | tail -n 1 | cut -d' ' -f3-)/bin/activate
python -m pip install --upgrade pip wheel
yam install
- name: Lint the project
run: |
. $(poetry env use python | tail -n 1 | cut -d' ' -f3-)/bin/activate
yam lint
run-unittests:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: Gr1N/setup-poetry@v8
- uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install yamk
yam install
- name: Run unittests
run: |
yam tests
- name: Checkout the repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: Gr1N/setup-poetry@v8
- name: Use cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel yamk
. $(poetry env use python | tail -n 1 | cut -d' ' -f3-)/bin/activate
python -m pip install --upgrade pip wheel
yam install
- name: Lint the project
run: |
. $(poetry env use python | tail -n 1 | cut -d' ' -f3-)/bin/activate
yam tests
33 changes: 26 additions & 7 deletions pyproject.toml
Expand Up @@ -3,14 +3,21 @@ requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
target-version = ["py38", "py39", "py310", "py311"]
target-version = ["py38"]

[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_reexport = true
show_error_codes = true
strict_concatenate = true
strict_equality = true
warn_return_any = true
warn_redundant_casts = true
warn_unused_ignores = true
Expand Down Expand Up @@ -63,6 +70,8 @@ target-version = "py38"

[tool.ruff.per-file-ignores]
"tests/**" = [
"FBT001",
"PT011",
"S101",
"S105",
]
Expand All @@ -74,14 +83,24 @@ ban-relative-imports = "all"
"mock".msg = "Use unittest.mock"
"pytz".msg = "Use zoneinfo"

[tool.ruff.isort]
combine-as-imports = true
forced-separate = ["tests"]
split-on-trailing-comma = false

[tool.pytest.ini_options]
addopts = "-vv --cov --cov-report=term-missing:skip-covered"
addopts = "-vv"
testpaths = "tests"

[tool.coverage.run]
source = ["src/"]
data_file = ".cov_cache/coverage.dat"

[tool.coverage.report]
show_missing = true
skip_covered = true
skip_empty = true

[tool.poetry]
name = "pickle_secure"
version = "0.99.9"
Expand Down Expand Up @@ -112,16 +131,16 @@ cryptography = ">=39.0.1"

[tool.poetry.group.dev.dependencies]
ipdb = {version = "^0.13", python = "^3.9"}
ipython = {version = "^8.11", python = "^3.9"}
pipdeptree = "^2.5"
ipython = {version = "^8.12", python = "^3.9"}
pipdeptree = "^2.7"

[tool.poetry.group.lint.dependencies]
black = "^23.1"
mypy = "^1.0"
black = "^23.3"
mypy = "^1.4"
ruff = "^0.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.1"
pytest = "^7.4"
pytest-cov = "^4.0"

[tool.poetry.group.docs.dependencies]
Expand Down

0 comments on commit f29afb4

Please sign in to comment.