Skip to content

Commit 3547c2e

Browse files
authored
Merge pull request #1 from python-ellar/master
Master
2 parents 2636fb6 + 0e01c85 commit 3547c2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3834
-0
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.pyc
2+
.venv*
3+
.vscode
4+
.mypy_cache
5+
.coverage
6+
htmlcov
7+
8+
dist
9+
test.py

.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
max-line-length = 88
3+
ignore = E203, E241, E501, W503, F811
4+
exclude =
5+
.git,
6+
__pycache__
7+
.history
8+
tests/demo_project

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: monthly

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: 3.8
17+
- name: Install Flit
18+
run: pip install flit
19+
- name: Install Dependencies
20+
run: flit install --symlink
21+
- name: Publish
22+
env:
23+
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
24+
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
25+
run: flit publish

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [assigned, opened, synchronize, reopened]
7+
8+
jobs:
9+
test_coverage:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: 3.8
18+
- name: Install Flit
19+
run: pip install flit
20+
- name: Install Dependencies
21+
run: flit install --symlink
22+
- name: Test
23+
run: make test-cov
24+
- name: Coverage
25+
uses: codecov/[email protected]

.github/workflows/test_full.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Full Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [assigned, opened, synchronize, reopened]
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install Flit
22+
run: pip install flit
23+
- name: Install Dependencies
24+
run: flit install --symlink
25+
- name: Test
26+
run: pytest tests
27+
28+
codestyle:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Set up Python
33+
uses: actions/setup-python@v4
34+
with:
35+
python-version: 3.8
36+
- name: Install Flit
37+
run: pip install flit
38+
- name: Install Dependencies
39+
run: flit install --symlink
40+
- name: Linting check
41+
run: ruff check ellar_sqlalchemy tests
42+
- name: mypy
43+
run: mypy ellar_sqlalchemy

.gitignore

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
*.pyc
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__
5+
*.py[cod]
6+
*$py.class
7+
8+
# C extensions
9+
*.so
10+
11+
# Distribution / packaging
12+
.Python
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
wheels/
25+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
MANIFEST
30+
31+
# PyInstaller
32+
# Usually these files are written by a python script from a template
33+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34+
*.manifest
35+
*.spec
36+
37+
# Installer logs
38+
pip-log.txt
39+
pip-delete-this-directory.txt
40+
41+
# Unit test / coverage reports
42+
htmlcov/
43+
.tox/
44+
.nox/
45+
.coverage
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*.cover
51+
*.py,cover
52+
.hypothesis/
53+
.pytest_cache/
54+
cover/
55+
56+
# Translations
57+
# *.mo Needs to come with the package
58+
*.pot
59+
60+
# Django stuff:
61+
*.log
62+
local_settings.py
63+
db.sqlite3
64+
db.sqlite3-journal
65+
66+
# Flask stuff:
67+
instance/
68+
.webassets-cache
69+
70+
# Scrapy stuff:
71+
.scrapy
72+
73+
# Sphinx documentation
74+
docs/_build/
75+
76+
# PyBuilder
77+
.pybuilder/
78+
target/
79+
80+
# Jupyter Notebook
81+
.ipynb_checkpoints
82+
83+
# IPython
84+
profile_default/
85+
ipython_config.py
86+
87+
# pyenv
88+
# For a library or package, you might want to ignore these files since the code is
89+
# intended to run in multiple environments; otherwise, check them in:
90+
.python-version
91+
92+
# pipenv
93+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96+
# install all needed dependencies.
97+
#Pipfile.lock
98+
99+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
100+
__pypackages__/
101+
102+
# Celery stuff
103+
celerybeat-schedule
104+
celerybeat.pid
105+
106+
# SageMath parsed files
107+
*.sage.py
108+
109+
# Environments
110+
.env
111+
.venv
112+
.vscode
113+
.mypy_cache
114+
.coverage
115+
htmlcov
116+
117+
dist
118+
test.py
119+
120+
docs/site
121+
122+
.DS_Store
123+
.idea
124+
local_install.sh
125+
dist
126+
test.py
127+
128+
docs/site
129+
site/

.isort.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[settings]
2+
profile = black
3+
combine_as_imports = true

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- repo: https://github.com/asottile/yesqa
7+
rev: v1.3.0
8+
hooks:
9+
- id: yesqa
10+
- repo: local
11+
hooks:
12+
- id: code_formatting
13+
args: []
14+
name: Code Formatting
15+
entry: "make fmt"
16+
types: [python]
17+
language_version: python3.8
18+
language: python
19+
- id: code_linting
20+
args: [ ]
21+
name: Code Linting
22+
entry: "make lint"
23+
types: [ python ]
24+
language_version: python3.8
25+
language: python
26+
- repo: https://github.com/pre-commit/pre-commit-hooks
27+
rev: v2.3.0
28+
hooks:
29+
- id: end-of-file-fixer
30+
exclude: >-
31+
^examples/[^/]*\.svg$
32+
- id: requirements-txt-fixer
33+
- id: trailing-whitespace
34+
types: [python]
35+
- id: check-case-conflict
36+
- id: check-json
37+
- id: check-xml
38+
- id: check-executables-have-shebangs
39+
- id: check-toml
40+
- id: check-xml
41+
- id: check-yaml
42+
- id: debug-statements
43+
- id: check-added-large-files
44+
- id: check-symlinks
45+
- id: debug-statements
46+
exclude: ^tests/

Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.PHONY: help docs
2+
.DEFAULT_GOAL := help
3+
4+
help:
5+
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6+
7+
clean: ## Removing cached python compiled files
8+
find . -name \*pyc | xargs rm -fv
9+
find . -name \*pyo | xargs rm -fv
10+
find . -name \*~ | xargs rm -fv
11+
find . -name __pycache__ | xargs rm -rfv
12+
find . -name .ruff_cache | xargs rm -rfv
13+
14+
install: ## Install dependencies
15+
flit install --deps develop --symlink
16+
17+
install-full: ## Install dependencies
18+
make install
19+
pre-commit install -f
20+
21+
lint:fmt ## Run code linters
22+
ruff check ellar_sqlalchemy tests
23+
mypy ellar_sqlalchemy
24+
25+
fmt format:clean ## Run code formatters
26+
ruff format ellar_sqlalchemy tests
27+
ruff check --fix ellar_sqlalchemy tests
28+
29+
test: ## Run tests
30+
pytest tests
31+
32+
test-cov: ## Run tests with coverage
33+
pytest --cov=ellar_sqlalchemy --cov-report term-missing tests
34+
35+
pre-commit-lint: ## Runs Requires commands during pre-commit
36+
make clean
37+
make fmt
38+
make lint

0 commit comments

Comments
 (0)