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

Switch to poetry build system #687

Merged
merged 7 commits into from
Oct 6, 2023
Merged

Switch to poetry build system #687

merged 7 commits into from
Oct 6, 2023

Conversation

SR4ven
Copy link
Collaborator

@SR4ven SR4ven commented Sep 24, 2023

Here is an attempt to switch to Poetry and pyproject.toml to build the package.

The setup.py installation method has been deprecated for a while now and Poetry seemed versatile, well documented and easy to use.

@SR4ven SR4ven merged commit c2facda into master Oct 6, 2023
11 checks passed
@SR4ven SR4ven deleted the poetry branch October 6, 2023 23:00
@jtpereyda
Copy link
Owner

jtpereyda commented Oct 7, 2023

@SR4ven One use case I can't quite figure out with Poetry is how to install and make entry points generally available. I sued to recommend running:

# from the boofuzz directory:
pipx install -e .

This would use editable mode, but even more helpfully, it would make the boo script available as standalone executable, which when run would run the boo script using the correct virtualenv.

Do you know how to do something similar with Poetry?

Edit: There is poetry run boo but that feels lame!

@SR4ven
Copy link
Collaborator Author

SR4ven commented Oct 7, 2023

After installing from source in editable mode with poetry install, you can use poetry shell to activate the virtualenv.
Then boo is available.

I guess that one could also activate the virtualenv bypassing poetry as it's a normal virtualenv located in ~/.cache/pypoetry/virtualenvs/

Does that help?

@jtpereyda
Copy link
Owner

@SR4ven That's what I'm doing for now, poetry shell -- I just miss how pipx would throw it right on your PATH and let you execute it as a regular CLI tool.

Since we're publishing to PyPI, I think one could still pipx install boofuzz to get the latest release as a regular CLI tool. It's just harder in dev. 🤷‍♂️ It can still be done manually, but the magical thing pipx does is make a little python script that uses the specific virtualenv python interpreter, meaning one can run the script without starting a virtualenv first.

@SR4ven
Copy link
Collaborator Author

SR4ven commented Oct 7, 2023

Alright, didn't know about that pipx feature.
But you're right, Poetry is only for developing and publishing. If you just intend to install boofuzz for using it with regular pip or pipx, no Poetry is involved. Poetry can only install from source, something like poetry install boofuzz does not work.

Since we don't build and release locally, I guess that you could still use pipx for development. pip install -e .[dev] still works fine, so I don't see why it shouldn't work with pipx.
We could add a pipx install method to the docs too.

I'm using PyCharm for developing which has a Poetry integration that I find quite convenient. It automatically activates the virtualenv in the shells.

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