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

Merge all script thingies at the package toplevel #196

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

masklinn
Copy link
Contributor

Using subcommands at the top of the package is simpler and easier than using individual script submodules.

Merger is mostly direct and ad-hoc, there was a minor amount of deduplication (imports and the file argument, via parent parsers) but that's about it so there may be opportunities for reducing the size of the runner if someone bothers looking into it.

Using subcommands at the top of the package is simpler and easier than
using individual script submodules.

Merger is mostly direct and ad-hoc, there was a minor amount of
deduplication (imports and the `file` argument, via parent parsers)
but that's about it so there may be opportunities for reducing the
size of the runner if someone bothers looking into it.
@masklinn masklinn enabled auto-merge (rebase) February 28, 2024 20:57
Doesn't seem super useful, as the GIL means a cache lock might not get
to contend that much. However it might find utility with the free
threaded interpreter eventually. Anyway it's not huge and it's not
very complex, although the contextvars API is not great for lazy
initialisation.

Still even though the initialisation looks like it could lead to
redundant inits (similar to the clearing cache which can get
multi-cleared) it should be safe: different threads hitting `cache`
concurrently will each hit their own lookup failure, and initialise
their local cache, and set their personal contextvar.

For a var to get double-init would require the same thread to be
concurrent with itself, which is not possible.

Fixes ua-parser#180
@masklinn masklinn disabled auto-merge February 28, 2024 21:03
@masklinn masklinn enabled auto-merge (rebase) February 28, 2024 21:03
@masklinn masklinn merged commit c0abcbb into ua-parser:master Feb 28, 2024
29 checks passed
@masklinn masklinn deleted the single-entry-point branch February 28, 2024 21:09
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