Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split codegen into a sub-project #232

Merged
merged 2 commits into from
Nov 23, 2024
Merged

Conversation

masklinn
Copy link
Contributor

@masklinn masklinn commented Nov 18, 2024

  • add release action (create a new release when upstream creates a new tag) for the prebuilt
  • add a monthly action doing a prerelease of the prebuilt

The core would likely be shared e.g. run tests, build wheel, push, however the second one needs to update the submodule to the current master of uap-core first.

If there has been no update to uap-core, it should generate the same .devN version number, and thus pushing the wheel should fail with an "already exists". Need to find what the code is for that and ignore this error specifically. Once I get to that.

This can be a completely automated process using trusted publishing though.

The goal of this is the ability to generate wheels for precompiled
instances of uap-core, at whatever version we want.

1. It resolves ua-parser#146 by splitting the versioning of the API and that of
   the (pre-compiled) data, this is an issue for 1.0 as that detaches
   uap-python's versioning from uap-core's.
2. It allows users to update the API and the precompiled dataset
   separately, something they would otherwise need to do via yaml.
3. It fixes ua-parser#221 by allowing the regular release of "preview"
   precompiled regexes from uap-core snapshots e.g. we could release
   0.19.dev202412 at the start of december with whatever uap-core
   merged between the previous prerelease and then. This should not be
   picked up by pip by default, but would allow users to access those
   prerelases via `pip install --pre`.
4. If done well enough, it might allow users to build bespoke
   precompiled datasets so they don't have to pick between custom
   rules and precompiled (not sure there's any demand for this but it
   seems like it might be useful).
5. If it works well enough it might actually be possible to have 0.x
   use the legacy codegen package meaning it should not need to be
   updated anymore.

This is implemented via hatch build hooks (which seem seem simpler
than doing it via setuptools in the end).

Adding `regexes.yaml` to the sdist via artifacts is a bit strange but
necessary in order to generate a complete sdist which a wheel can be
built from (even though the release script will likely only push the
wheel).
- The workflow does no release if a valid environment is not selected.
- By default, the workflow will create a .devN release using the
  current uap-core master.
@masklinn masklinn merged commit 3d5afdb into ua-parser:master Nov 23, 2024
23 checks passed
@masklinn masklinn deleted the split-codegen branch November 23, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant