sherlock icon indicating copy to clipboard operation
sherlock copied to clipboard

poetry packaging

Open stranger-danger-zamu opened this issue 3 years ago • 2 comments

Fixes #1241.

Here are the changes required to package this with Poetry. Feel free to use it or just base your own changes off of it.

stranger-danger-zamu avatar Jan 27 '22 21:01 stranger-danger-zamu

Hey @stranger-danger-zamu, Could please explain the usage of this changes by example?! how we could run and use after this change?

TheYahya avatar Apr 05 '22 16:04 TheYahya

Sorry! Github just popped this up in my feed.

For developers:

The pyproject.toml file then allows the dev to build a python wheel:

git clone <github url> sherlock
cd sherlock
poetry install
poetry build

Then whoever from the sherlock project can just push the wheel up to PyPI to make it simple to install for end users. It's pretty simple with poetry, but it does require some configuration for the authentication (google poetry publish for more info).

Also you don't need to install the wheel to run it in the local environment, just run the following command and it'll run the command using the source code:

poetry run sherlock

For end users:

If/When sherlock is pushed up to PyPI, then end users can just pip install -U sherlock to install sherlock to their user directory so they can call sherlock as a command in the console (ie. sherlock).


As for how that works it's just the tool.poetry.scripts section in the pyproject.toml file (link).

Essentially, the tool.poetry.scripts section maps to the old setuptools' console_scripts feature.

stranger-danger-zamu avatar Apr 13 '22 22:04 stranger-danger-zamu