Skip to content

Commit

Permalink
Run tests in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Hjertholm authored and danhje committed Jun 1, 2024
1 parent eb74a28 commit 5f10707
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 91 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,29 @@ permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade poetry
poetry install
poetry run maturin develop
- name: Run tests
run: |
poetry run pytest
linux:
runs-on: ubuntu-latest
needs: [test]
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
Expand All @@ -44,6 +65,7 @@ jobs:

windows:
runs-on: windows-latest
needs: [test]
strategy:
matrix:
target: [x64, x86]
Expand All @@ -67,6 +89,7 @@ jobs:

macos:
runs-on: macos-latest
needs: [test]
strategy:
matrix:
target: [x86_64, aarch64]
Expand All @@ -89,6 +112,7 @@ jobs:

sdist:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- name: Build sdist
Expand Down
87 changes: 47 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quick-xmltodict"
version = "0.1.1"
version = "0.1.2"
edition = "2021"

[lib]
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Efficient XML-to-dict conversion backed by Rust.

## Features

`quick-xmltodict` is a Rust-backed XML-to-dict conversion package that is designed to be fast and efficient.
`quick-xmltodict` is a Rust-backed XML-to-dict conversion package designed to be fast and efficient.
It has a single function, `parse`, that takes an XML string and returns a Python dictionary.
You should be able to use this function as a drop-in replacement for the `xmltodict.parse` function from the original `xmltodict` package (used without any extra arguments).
Like `xmltodict`, `quick-xmltodict` follows [this](https://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html) schema for converting XML to JSON.
Expand All @@ -45,8 +45,8 @@ Like `xmltodict`, `quick-xmltodict` follows [this](https://www.xml.com/pub/a/200

## Performance

`quick-xmltodict` is currently about 2-5 times faster than `xmltodict`.
There are performance improvements to be made, so this difference is expected to increase.
Since `xmltodict` uses the non-validating C-based [expat](https://docs.python.org/3/library/pyexpat.html) parser from Python's standard library, it is already very fast.
`quick-xmltodict` is nonetheless about 2-5 times faster than `xmltodict`.

## Contributing

Expand All @@ -65,11 +65,11 @@ poetry run pytest
```

Be sure to run `poetry run maturin develop` after making changes to the Rust code.
Add the `-r` flag for a release build (for example if you want to run benchmarks).
Add the `-r` flag for a release build (for example, if you want to run benchmarks).

It's recommended to install the pre-commit hooks:
```bash
poetry run pre-commit install
```

This ensures that linting and formatting is run automatically on every commit.
This ensures that linting and formatting are run automatically on every commit.
Loading

0 comments on commit 5f10707

Please sign in to comment.