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

Fix console entry point to allow direct execution with uvx #76

Merged
merged 3 commits into from
Dec 29, 2024

Conversation

amitness
Copy link
Contributor

Hi @koaning,

Currently, when trying to use bulk with uvx directly:

uvx bulk text df.csv

It raises this error:

Traceback (most recent call last):
  File "/Users/amitness/Library/Caches/uv/archive-v0/Ai18k3ieJ7bpU38lhPOKc/bin/bulk", line 7, in <module>
    from bulk.__main__ import app
ImportError: cannot import name 'app' from 'bulk.__main__' (/Users/amitness/Library/Caches/uv/archive-v0/Ai18k3ieJ7bpU38lhPOKc/lib/python3.8/site-packages/bulk/__main__.py)

But, if you run it as a module, it works as usual because that doesn't invoke the console script.

python -m bulk text df.csv

I found that the reason is because the entrypoint defined in console_scripts is wrong and still set to the typer app. While the code has switched to click for the command line parsing.

I have pushed a fix for this. As such, both the scripts below will work now.

bulk text df.csv
uvx bulk text df.csv

You can also test my changes via this command using df.csv from here

uvx --from=git+https://github.com/amitness/bulk@fix-uvx bulk text df.csv

@koaning
Copy link
Owner

koaning commented Dec 29, 2024

Hey I remember that name! Back when I worked at Rasa I recall reading your blog a bunch, nice to see you here.

Copy link
Owner

@koaning koaning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, these changes look fair to me. When I made this tool it was well before the big uv ecosystem releases. Thanks for the addition!

@koaning
Copy link
Owner

koaning commented Dec 29, 2024

Ah it seems that the unit tests break due to an issue on my side. I think if you pull from main it should turn green.

@amitness
Copy link
Contributor Author

@koaning Thank you, I have synced with main, should work now

And, glad to hear you remember :)

This video discussing tools for exploring LLM prompts actually sent me here

@koaning
Copy link
Owner

koaning commented Dec 29, 2024

Ah yeah, that was a popular demo.

@koaning koaning merged commit 6ced46c into koaning:main Dec 29, 2024
5 of 6 checks passed
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.

2 participants