Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Aug 13, 2024
1 parent 441e667 commit cbb74f3
Show file tree
Hide file tree
Showing 60 changed files with 3,495 additions and 0 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: github-actions
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GITHUB_TOKEN
COVERALLS_REPO_TOKEN
104 changes: 104 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: test

on:
push:
pull_request:
types: [review_requested, ready_for_review]

jobs:
# *************************************
# ************* Pre-commit ************
# *************************************
pre-commit:
name: pre-commit ${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
max-parallel: 5
matrix:
os:
- ubuntu-22.04
python-version:
- "3.11"
# - "3.10"
# - "3.9"
# - "3.8"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install detect-secrets
run: pip install --no-cache-dir detect-secrets doc8 isort==5.11.5
- name: Run pre-commit
uses: pre-commit/action@v3.0.0

# *************************************
# **************** Tests **************
# *************************************
test:
needs: pre-commit
name: test ${{ matrix.python-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 5
matrix:
os:
- ubuntu-22.04
# - Windows
# - MacOs
python-version:
# - "3.12"
- "3.11"
- "3.10"
- "3.9"
steps:
- name: Clean-up
run: sudo apt clean && sudo apt autoclean && sudo rm -rf /tmp/* && sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
- name: Install package
run: |
pip install -e .[all]
- name: Run test suite
run: pytest -vrx
env:
PYTEST_ADDOPTS: "-vv --durations=10"
- name: Coveralls
id: coveralls-setup
continue-on-error: true
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: Run Tests

# *************************************
# ************** Coveralls ************
# *************************************
coveralls_finish:
name: coveralls_finish
needs: test
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
python -m pip install pyyaml
- name: Coveralls Finished
id: coveralls-finish
continue-on-error: true
# if: steps.coveralls-setup.outcome == 'success'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
debug: true
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
*.py[cod]
.hgignore~
.gitignore~
.hg/
.hgtags
.tox/
.cache/
.coverage*
!.coveragerc
/htmlcov/
*.py,cover
.idea/
.vscode/
.pytest_cache/
/coverage.xml
.eggs/

MANIFEST.in~
codebin/
/tmp/
.zip
/examples/db/
/var/
/examples/tmp/
/examples/logs/
/builddocs/
/docs/_build/
/builddocs.zip
/build/
/dist/
fake_py_django_storage.egg-info
matyan.log*
db.sqlite3
sample_db.sqlite
test_database.db
local_settings.py
/prof/
*.cast
.ipynb_checkpoints/
.scannerwork/
*db.sqlite3*
examples/pydantic/media/
examples/tortoise/media/
examples/django/media/
examples/dataclasses/media/
examples/sqlalchemy/media/
examples/sqlmodel/media/
examples/hypothesis/.hypothesis/
.mypy_cache/
68 changes: 68 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
exclude: "^docs/|/migrations/"
default_stages: [ commit, push ]
default_language_version:
python: python3

repos:

- repo: local
hooks:
- id: detect-secrets
name: Detect secrets
language: python
entry: detect-secrets-hook
args: ['--baseline', '.secrets.baseline']

- id: doc8
name: Doc8 linter
language: python
entry: doc8
args: []

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
exclude: "data/"

- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- id: debug-statements
- id: check-merge-conflict

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
name: black
files: .
args: [ "--config", "pyproject.toml" ]

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort
files: .
args: [ "--settings-path", "pyproject.toml", "--profile=black" ]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.4.8
hooks:
- id: ruff
name: lint
files: .
args: [ "--config", "pyproject.toml" ]

- repo: https://github.com/jsh9/pydoclint
rev: 0.4.2
hooks:
- id: pydoclint

# - repo: https://github.com/asottile/pyupgrade
# rev: v3.2.0
# hooks:
# - id: pyupgrade
# args: [ --py310-plus ]
15 changes: 15 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- id: detect-secrets
name: Detect secrets
description: Detects high entropy strings that are likely to be passwords.
entry: detect-secrets-hook
language: python
# for backward compatibility
files: .*

- id: doc8
name: doc8
description: This hook runs doc8 for linting docs
entry: doc8
language: python
files: \.rst$
require_serial: true
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
- epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
Loading

0 comments on commit cbb74f3

Please sign in to comment.