prelude-parser 0.3.2__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/.github/workflows/pypi_publish.yml +21 -22
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/.github/workflows/release-drafter.yml +1 -1
- prelude_parser-0.5.0/.github/workflows/testing.yml +63 -0
- prelude_parser-0.5.0/.pre-commit-config.yaml +20 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/CONTRIBUTING.md +11 -11
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/Cargo.lock +253 -97
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/Cargo.toml +9 -4
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/PKG-INFO +2 -2
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/justfile +1 -6
- prelude_parser-0.5.0/prelude_parser/__init__.py +4 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/prelude_parser/_prelude_parser.pyi +6 -3
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/prelude_parser/pandas.py +5 -3
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/prelude_parser/parser.py +3 -4
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/prelude_parser/polars.py +4 -2
- prelude_parser-0.5.0/prelude_parser/types.py +5 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/pyproject.toml +22 -24
- prelude_parser-0.5.0/requirements-dev.txt +6 -0
- prelude_parser-0.5.0/src/errors.rs +18 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/src/lib.rs +80 -65
- prelude_parser-0.5.0/src/utils.rs +31 -0
- prelude_parser-0.5.0/tests/assets/subject_native.xml +88 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/tests/conftest.py +5 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/tests/test_parser.py +7 -1
- prelude_parser-0.3.2/.github/workflows/testing.yml +0 -63
- prelude_parser-0.3.2/.pre-commit-config.yaml +0 -25
- prelude_parser-0.3.2/prelude_parser/__init__.py +0 -3
- prelude_parser-0.3.2/requirements-dev.txt +0 -8
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/.github/dependabot.yml +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/.github/release-draft-template.yml +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/.gitignore +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/LICENSE +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/README.md +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/prelude_parser/py.typed +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/tests/__init__.py +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/tests/assets/test1.xml +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/tests/assets/test2.xml +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/tests/assets/test3.xml +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/tests/assets/test4.xml +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/tests/test_pandas.py +0 -0
- {prelude_parser-0.3.2 → prelude_parser-0.5.0}/tests/test_polars.py +0 -0
|
@@ -3,7 +3,7 @@ name: PyPi Publish
|
|
|
3
3
|
on:
|
|
4
4
|
release:
|
|
5
5
|
types:
|
|
6
|
-
|
|
6
|
+
- published
|
|
7
7
|
|
|
8
8
|
permissions:
|
|
9
9
|
contents: read
|
|
@@ -16,20 +16,20 @@ jobs:
|
|
|
16
16
|
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v4
|
|
19
|
-
- uses: actions/setup-python@
|
|
19
|
+
- uses: actions/setup-python@v5
|
|
20
20
|
with:
|
|
21
|
-
python-version:
|
|
21
|
+
python-version: "3.11"
|
|
22
22
|
- name: Build wheels
|
|
23
23
|
uses: PyO3/maturin-action@v1
|
|
24
24
|
with:
|
|
25
25
|
target: ${{ matrix.target }}
|
|
26
26
|
args: --release --out dist --find-interpreter
|
|
27
|
-
sccache:
|
|
27
|
+
sccache: "true"
|
|
28
28
|
manylinux: auto
|
|
29
29
|
- name: Upload wheels
|
|
30
|
-
uses: actions/upload-artifact@
|
|
30
|
+
uses: actions/upload-artifact@v4
|
|
31
31
|
with:
|
|
32
|
-
name: wheels
|
|
32
|
+
name: wheels-linux-${{ matrix.target }}
|
|
33
33
|
path: dist
|
|
34
34
|
|
|
35
35
|
windows:
|
|
@@ -39,20 +39,20 @@ jobs:
|
|
|
39
39
|
target: [x64, x86]
|
|
40
40
|
steps:
|
|
41
41
|
- uses: actions/checkout@v4
|
|
42
|
-
- uses: actions/setup-python@
|
|
42
|
+
- uses: actions/setup-python@v5
|
|
43
43
|
with:
|
|
44
|
-
python-version:
|
|
44
|
+
python-version: "3.11"
|
|
45
45
|
architecture: ${{ matrix.target }}
|
|
46
46
|
- name: Build wheels
|
|
47
47
|
uses: PyO3/maturin-action@v1
|
|
48
48
|
with:
|
|
49
49
|
target: ${{ matrix.target }}
|
|
50
50
|
args: --release --out dist --find-interpreter
|
|
51
|
-
sccache:
|
|
51
|
+
sccache: "true"
|
|
52
52
|
- name: Upload wheels
|
|
53
|
-
uses: actions/upload-artifact@
|
|
53
|
+
uses: actions/upload-artifact@v4
|
|
54
54
|
with:
|
|
55
|
-
name: wheels
|
|
55
|
+
name: wheels-windows-${{ matrix.target }}
|
|
56
56
|
path: dist
|
|
57
57
|
|
|
58
58
|
macos:
|
|
@@ -62,19 +62,19 @@ jobs:
|
|
|
62
62
|
target: [x86_64, aarch64]
|
|
63
63
|
steps:
|
|
64
64
|
- uses: actions/checkout@v4
|
|
65
|
-
- uses: actions/setup-python@
|
|
65
|
+
- uses: actions/setup-python@v5
|
|
66
66
|
with:
|
|
67
|
-
python-version:
|
|
67
|
+
python-version: "3.11"
|
|
68
68
|
- name: Build wheels
|
|
69
69
|
uses: PyO3/maturin-action@v1
|
|
70
70
|
with:
|
|
71
71
|
target: ${{ matrix.target }}
|
|
72
72
|
args: --release --out dist --find-interpreter
|
|
73
|
-
sccache:
|
|
73
|
+
sccache: "true"
|
|
74
74
|
- name: Upload wheels
|
|
75
|
-
uses: actions/upload-artifact@
|
|
75
|
+
uses: actions/upload-artifact@v4
|
|
76
76
|
with:
|
|
77
|
-
name: wheels
|
|
77
|
+
name: wheels-macos-${{ matrix.target }}
|
|
78
78
|
path: dist
|
|
79
79
|
|
|
80
80
|
sdist:
|
|
@@ -87,23 +87,22 @@ jobs:
|
|
|
87
87
|
command: sdist
|
|
88
88
|
args: --out dist
|
|
89
89
|
- name: Upload sdist
|
|
90
|
-
uses: actions/upload-artifact@
|
|
90
|
+
uses: actions/upload-artifact@v4
|
|
91
91
|
with:
|
|
92
|
-
name: wheels
|
|
92
|
+
name: wheels-sdist
|
|
93
93
|
path: dist
|
|
94
94
|
|
|
95
95
|
release:
|
|
96
96
|
name: Release
|
|
97
97
|
runs-on: ubuntu-latest
|
|
98
|
+
if: "startsWith(github.ref, 'refs/tags/')"
|
|
98
99
|
needs: [linux, windows, macos, sdist]
|
|
99
100
|
steps:
|
|
100
|
-
- uses: actions/download-artifact@
|
|
101
|
-
with:
|
|
102
|
-
name: wheels
|
|
101
|
+
- uses: actions/download-artifact@v4
|
|
103
102
|
- name: Publish to PyPI
|
|
104
103
|
uses: PyO3/maturin-action@v1
|
|
105
104
|
env:
|
|
106
105
|
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
107
106
|
with:
|
|
108
107
|
command: upload
|
|
109
|
-
args: --skip-existing
|
|
108
|
+
args: --non-interactive --skip-existing wheels-*/*
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Testing
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
pull_request:
|
|
7
|
+
env:
|
|
8
|
+
CARGO_TERM_COLOR: always
|
|
9
|
+
RUST_BACKTRACE: 1
|
|
10
|
+
RUSTFLAGS: "-D warnings"
|
|
11
|
+
jobs:
|
|
12
|
+
clippy:
|
|
13
|
+
name: Clippy
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- name: Install Rust
|
|
18
|
+
run: |
|
|
19
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
20
|
+
- name: Cache dependencies
|
|
21
|
+
uses: Swatinem/rust-cache@v2.7.3
|
|
22
|
+
- name: Run cargo clippy
|
|
23
|
+
run: cargo clippy --all-targets -- --deny warnings
|
|
24
|
+
fmt:
|
|
25
|
+
name: Rustfmt
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
- name: Install Rust
|
|
30
|
+
run: |
|
|
31
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
32
|
+
- name: Cache dependencies
|
|
33
|
+
uses: Swatinem/rust-cache@v2.7.3
|
|
34
|
+
- name: Run cargo fmt
|
|
35
|
+
run: cargo fmt --all -- --check
|
|
36
|
+
test:
|
|
37
|
+
strategy:
|
|
38
|
+
fail-fast: false
|
|
39
|
+
matrix:
|
|
40
|
+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
|
41
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
42
|
+
runs-on: ${{ matrix.os }}
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v4
|
|
45
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
46
|
+
uses: actions/setup-python@v5
|
|
47
|
+
with:
|
|
48
|
+
python-version: ${{ matrix.python-version }}
|
|
49
|
+
cache: "pip"
|
|
50
|
+
- name: Install dependencies
|
|
51
|
+
run: |
|
|
52
|
+
pip install -U pip
|
|
53
|
+
pip install -r requirements-dev.txt
|
|
54
|
+
pip install -e .[all]
|
|
55
|
+
maturin build --out dist
|
|
56
|
+
pip install --no-index --find-links=dist/ prelude-parser
|
|
57
|
+
- name: Run tests
|
|
58
|
+
run: pytest --cov=prelude_parser --cov-report=xml
|
|
59
|
+
- name: Upload coverage
|
|
60
|
+
uses: codecov/codecov-action@v4
|
|
61
|
+
with:
|
|
62
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
63
|
+
fail_ci_if_error: true
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v4.6.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-added-large-files
|
|
6
|
+
- id: check-toml
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: debug-statements
|
|
9
|
+
- id: end-of-file-fixer
|
|
10
|
+
- id: trailing-whitespace
|
|
11
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
12
|
+
rev: v1.10.0
|
|
13
|
+
hooks:
|
|
14
|
+
- id: mypy
|
|
15
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
16
|
+
rev: v0.4.5
|
|
17
|
+
hooks:
|
|
18
|
+
- id: ruff
|
|
19
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
20
|
+
- id: ruff-format
|
|
@@ -12,17 +12,17 @@ for something that interests you.
|
|
|
12
12
|
|
|
13
13
|
Please include:
|
|
14
14
|
|
|
15
|
-
1.
|
|
16
|
-
[GitHub markdown](https://docs.github.com/en/free-pro-team@latest/github/writing-on-github). For
|
|
17
|
-
example:
|
|
15
|
+
1. A short, self-contained Python snippet reproducing the problem. You can format the code by using
|
|
16
|
+
[GitHub markdown](https://docs.github.com/en/free-pro-team@latest/github/writing-on-github). For
|
|
17
|
+
example:
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
```py
|
|
20
|
+
from prelude_parser import parse_to_classes
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
data = parse_to_classes("my_file.xml")
|
|
23
|
+
```
|
|
24
24
|
|
|
25
|
-
2.
|
|
25
|
+
2. Explain what is currently happening and what you expect instead.
|
|
26
26
|
|
|
27
27
|
## Working on the code
|
|
28
28
|
|
|
@@ -86,10 +86,10 @@ git checkout main
|
|
|
86
86
|
git pull upstream main --ff-only
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
### Code Standards and tests (ruff,
|
|
89
|
+
### Code Standards and tests (ruff, mypy, pytest, clippy, rustfmt, and pre-commit)
|
|
90
90
|
|
|
91
|
-
prelude-parser uses [ruff](https://github.com/charliermarsh/ruff),
|
|
92
|
-
|
|
91
|
+
prelude-parser uses [ruff](https://github.com/charliermarsh/ruff), and
|
|
92
|
+
[mypy](https://mypy.readthedocs.io/en/stable/), [clippy](https://doc.rust-lang.org/clippy/), and
|
|
93
93
|
[rustfmt](https://rust-lang.github.io/rustfmt/?version=v1.5.1&search=) to ensure consistent code
|
|
94
94
|
formatting.
|
|
95
95
|
|