Skip to content

Adopt ua-parser-rs from uap-rust#297

Merged
masklinn merged 1 commit intoua-parser:masterfrom
masklinn:ua-parser-rs-adoption
Mar 28, 2026
Merged

Adopt ua-parser-rs from uap-rust#297
masklinn merged 1 commit intoua-parser:masterfrom
masklinn:ua-parser-rs-adoption

Conversation

@masklinn
Copy link
Copy Markdown
Contributor

As noted in ua-parser/uap-rust#54 (and the matching commit), putting ua-parser-rs in uap-rust initially made sense to me as it was entirely rust, and strongly dependent on the development of uap-rust, however the more time passes the less it does:

  • the testing is completely redundant with uap-python testing its regex resolver
  • the tooling is a lot more similar to uap-python's (notably the need for complicated matrices of test runtimes and platforms)
  • if ua-parser-rs breaks ua-parser somehow we probably want to know before cutting a release
  • releases go through pypi like uap-python not crates.io
  • if other maintainers get involved (mostly on the python side), it probably makes more sense for them to learn some modicum of rust than to have to beg the rust maintainers for a release if they need something changed (not that they should but still you never know)

@masklinn masklinn added the check-wheels Enables the native wheels workflow on the PR. Opt in because heinously expensive. label Mar 28, 2026
@masklinn masklinn force-pushed the ua-parser-rs-adoption branch from c1bcf2e to c38d86d Compare March 28, 2026 13:41
@masklinn masklinn force-pushed the ua-parser-rs-adoption branch from 35ca2e0 to 5bc406e Compare March 28, 2026 18:14
@masklinn masklinn force-pushed the ua-parser-rs-adoption branch from 5bc406e to 5613e80 Compare March 28, 2026 20:03
@masklinn masklinn marked this pull request as ready for review March 28, 2026 20:03
Originally, building ua-parser-rs alongside uap-rust seemed to make
sense, but over time I've soured on it: although it's largely Rust
code:

- The interface for python and (should) follow Python API design
  principles.
- It's bound much more to ua-parser/uap-python (as an implementation
  detail thereof) than to ua-parser/uap-rust (which is just a
  dependency).
- The tests are pure Python.
- The CI and release pipeline are completely pipeline coded (testing
  and releasing for various python runtimes).

And in case the Python and Rust teams split in the future, it probably
doesn't make sense for the python team to have to go through the rust
team to tune the extension, even if they may want / need counsel from
that team.

Adoption notes:

- Publishing via maturin dropped, as it's deprecated.
- Rust checks added to tox.
- Dropped explicitly building and installing the ua-parser-rs as
  that's what `pip install ./ua-parser-rs` should be doing.
- Because the wheels workflow is tricky, it can be run on a PR by
  tagging it allow running the wheels workflow in a PR. It's not
  enabled by default (or even when touching `ua-parser-rs`) as the
  cost of that job is enormous.
- During wheels build, *only* the `-regex` tests are run, with
  `pytest-error-for-skips` to make sure the tests are not skipped (aka
  `ua-parser-rs` is properly installed).
@masklinn masklinn force-pushed the ua-parser-rs-adoption branch from 5613e80 to c17d708 Compare March 28, 2026 20:14
@masklinn masklinn merged commit 4498915 into ua-parser:master Mar 28, 2026
108 checks passed
@masklinn masklinn deleted the ua-parser-rs-adoption branch March 28, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

check-wheels Enables the native wheels workflow on the PR. Opt in because heinously expensive.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant