Skip to content

Commit 5de482e

Browse files
authored
Merge pull request #23 from vduseev/main
Merging rewrite changes from web2preview
2 parents 1229687 + ec11e96 commit 5de482e

Some content is hidden

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

55 files changed

+2430
-622
lines changed

.brotasks/default.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

.bumpversion.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[bumpversion]
2+
current_version = 1.7.0
3+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
4+
serialize =
5+
{major}.{minor}.{patch}
6+
tag_name = v{new_version}
7+
commit = True
8+
tag = True
9+
10+
[bumpversion:file:pyproject.toml]
11+
12+
[bumpversion:file:webpreview/version.py]

.coveragerc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[run]
2+
branch = True
3+
source = webpreview
4+
5+
omit =
6+
# Omit test files
7+
webpreview/tests/*
8+
9+
[report]
10+
exclude_lines =
11+
pragma: no cover
12+
def __repr__
13+
if self.debug:
14+
if settings.DEBUG
15+
raise AssertionError
16+
raise NotImplementedError
17+
if 0:
18+
if __name__ == .__main__.:
19+
20+
fail_under = 80

.dockerignore

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
.git
2+
.gitignore
3+
.dockerignore
4+
tests/
5+
6+
# IDE
7+
.vscode/
8+
.idea/
9+
10+
# Byte-compiled / optimized / DLL files
11+
__pycache__/
12+
*.py[cod]
13+
*$py.class
14+
15+
# C extensions
16+
*.so
17+
18+
# Distribution / packaging
19+
.Python
20+
build/
21+
develop-eggs/
22+
dist/
23+
downloads/
24+
eggs/
25+
.eggs/
26+
lib/
27+
lib64/
28+
parts/
29+
sdist/
30+
var/
31+
wheels/
32+
share/python-wheels/
33+
*.egg-info/
34+
.installed.cfg
35+
*.egg
36+
MANIFEST
37+
38+
# PyInstaller
39+
# Usually these files are written by a python script from a template
40+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
41+
*.manifest
42+
*.spec
43+
44+
# Installer logs
45+
pip-log.txt
46+
pip-delete-this-directory.txt
47+
48+
# Unit test / coverage reports
49+
htmlcov/
50+
.tox/
51+
.nox/
52+
.coverage
53+
.coverage.*
54+
.cache
55+
nosetests.xml
56+
coverage.xml
57+
*.cover
58+
*.py,cover
59+
.hypothesis/
60+
.pytest_cache/
61+
cover/
62+
63+
# Translations
64+
*.mo
65+
*.pot
66+
67+
# Django stuff:
68+
*.log
69+
local_settings.py
70+
db.sqlite3
71+
db.sqlite3-journal
72+
73+
# Flask stuff:
74+
instance/
75+
.webassets-cache
76+
77+
# Scrapy stuff:
78+
.scrapy
79+
80+
# Sphinx documentation
81+
docs/_build/
82+
83+
# PyBuilder
84+
.pybuilder/
85+
target/
86+
87+
# Jupyter Notebook
88+
.ipynb_checkpoints
89+
90+
# IPython
91+
profile_default/
92+
ipython_config.py
93+
94+
# pyenv
95+
# For a library or package, you might want to ignore these files since the code is
96+
# intended to run in multiple environments; otherwise, check them in:
97+
# .python-version
98+
99+
# pipenv
100+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
101+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
102+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
103+
# install all needed dependencies.
104+
#Pipfile.lock
105+
106+
# poetry
107+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
108+
# This is especially recommended for binary packages to ensure reproducibility, and is more
109+
# commonly ignored for libraries.
110+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
111+
#poetry.lock
112+
113+
# pdm
114+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
115+
#pdm.lock
116+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
117+
# in version control.
118+
# https://pdm.fming.dev/#use-with-ide
119+
.pdm.toml
120+
121+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
122+
__pypackages__/
123+
124+
# Celery stuff
125+
celerybeat-schedule
126+
celerybeat.pid
127+
128+
# SageMath parsed files
129+
*.sage.py
130+
131+
# Environments
132+
.env
133+
.venv
134+
env/
135+
venv/
136+
ENV/
137+
env.bak/
138+
venv.bak/
139+
140+
# Spyder project settings
141+
.spyderproject
142+
.spyproject
143+
144+
# Rope project settings
145+
.ropeproject
146+
147+
# mkdocs documentation
148+
/site
149+
150+
# mypy
151+
.mypy_cache/
152+
.dmypy.json
153+
dmypy.json
154+
155+
# Pyre type checker
156+
.pyre/
157+
158+
# pytype static type analyzer
159+
.pytype/
160+
161+
# Cython debug symbols
162+
cython_debug/

.github/actions/setup/action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Setup package
2+
runs:
3+
using: "composite"
4+
steps:
5+
- name: Install poetry
6+
run: pip install poetry
7+
shell: bash
8+
- name: Install dependencies
9+
run: poetry install
10+
shell: bash

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: test
2+
3+
on:
4+
# Pull request trigger works only for PRs into main branch
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
# Push only works for tags.
10+
# Will be executed on push or successful merge into main.
11+
tags:
12+
- "v*"
13+
workflow_dispatch:
14+
15+
jobs:
16+
tests:
17+
strategy:
18+
matrix:
19+
python-version: ["3.7", "3.8", "3.9", "3.10"]
20+
os: [ubuntu-latest, windows-latest, macos-latest]
21+
runs-on: ${{ matrix.os }}
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- uses: ./.github/actions/setup
28+
- name: Tests
29+
run: |
30+
# Run tests
31+
poetry run pytest
32+
33+
coverage:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v3
37+
- uses: actions/setup-python@v3
38+
with:
39+
python-version: "3.9"
40+
- uses: ./.github/actions/setup
41+
- name: Coverage
42+
env:
43+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
44+
run: |
45+
# Run tests
46+
poetry run pytest --cov --cov-report=xml
47+
# Send results to codecov
48+
bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)