Skip to content

Commit db5927b

Browse files
authored
Merge pull request #1 from dapper91/dev
- first library version implemented - pre-commit hooks added - examples added - documentation added - github test workflow added - github release workflow added
2 parents 700227b + c2d2e8f commit db5927b

27 files changed

+3869
-1
lines changed

.flake8

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
max-line-length = 120
3+
exclude =
4+
tests/**
5+
per-file-ignores =
6+
*/__init__.py: F401

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: release
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: '3.x'
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip poetry
20+
poetry install
21+
- name: Build and publish
22+
run: |
23+
poetry build
24+
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- dev
7+
- master
8+
push:
9+
branches:
10+
- master
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ['3.8', '3.9', '3.10']
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install poetry
28+
poetry install --no-root -E lxml
29+
- name: Run pre-commit hooks
30+
run: poetry run pre-commit run --hook-stage merge-commit --all-files
31+
- name: Run tests (lxml)
32+
run: PYTHONPATH="$(pwd):$PYTHONPATH" poetry run py.test tests
33+
- name: Run tests (std)
34+
run: PYTHONPATH="$(pwd):$PYTHONPATH" FORCE_STD_XML=true poetry run py.test --cov=pydantic_xml --cov-report=xml tests
35+
- name: Upload coverage to Codecov
36+
uses: codecov/codecov-action@v1
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}
39+
files: ./coverage.xml
40+
flags: unittests
41+
fail_ci_if_error: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,6 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
# IDEs
132+
.idea

.pre-commit-config.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
default_stages:
2+
- commit
3+
- merge-commit
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.1.0
8+
hooks:
9+
- id: check-yaml
10+
- id: check-toml
11+
- id: trailing-whitespace
12+
- id: end-of-file-fixer
13+
stages:
14+
- commit
15+
- id: mixed-line-ending
16+
name: fix line ending
17+
stages:
18+
- commit
19+
args:
20+
- --fix=lf
21+
- id: mixed-line-ending
22+
name: check line ending
23+
stages:
24+
- merge-commit
25+
args:
26+
- --fix=no
27+
- repo: https://github.com/asottile/add-trailing-comma
28+
rev: v2.2.1
29+
hooks:
30+
- id: add-trailing-comma
31+
stages:
32+
- commit
33+
- repo: https://github.com/pre-commit/mirrors-autopep8
34+
rev: v1.6.0
35+
hooks:
36+
- id: autopep8
37+
stages:
38+
- commit
39+
args:
40+
- --diff
41+
- repo: https://gitlab.com/pycqa/flake8
42+
rev: 3.9.2
43+
hooks:
44+
- id: flake8
45+
- repo: https://github.com/pycqa/isort
46+
rev: 5.10.1
47+
hooks:
48+
- id: isort
49+
name: fix import order
50+
stages:
51+
- commit
52+
args:
53+
- --line-length=120
54+
- --multi-line=9
55+
- --project=pydantic_xml
56+
- id: isort
57+
name: check import order
58+
stages:
59+
- merge-commit
60+
args:
61+
- --check-only
62+
- --line-length=120
63+
- --multi-line=9
64+
- --project=pydantic_xml
65+
- repo: https://github.com/pre-commit/mirrors-mypy
66+
rev: v0.942
67+
hooks:
68+
- id: mypy
69+
stages:
70+
- commit
71+
name: mypy
72+
pass_filenames: false
73+
args: ["--package", "pydantic_xml"]
74+
additional_dependencies:
75+
- pydantic
76+
- lxml-stubs

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Changelog
2+
=========
3+
4+
5+
0.1.0 (2021-08-17)
6+
------------------
7+
8+
- Initial release

0 commit comments

Comments
 (0)