From 79f5f18a693235e3e59b75cfc2ca22f20aa364f4 Mon Sep 17 00:00:00 2001 From: Marco Sirabella Date: Sat, 2 Mar 2024 13:21:32 -0800 Subject: [PATCH 1/2] Make an actual package with pyproject.toml Fixes #2017 --- Dockerfile | 4 ++-- README.md | 11 ++--------- pyproject.toml | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 pyproject.toml diff --git a/Dockerfile b/Dockerfile index 147c7d01..71bba287 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,9 +18,9 @@ LABEL org.label-schema.vcs-ref=$VCS_REF \ COPY --from=build /wheels /wheels COPY . /opt/sherlock/ -RUN pip3 install --no-cache-dir -r requirements.txt -f /wheels \ +RUN pip3 install --no-cache-dir . -f /wheels \ && rm -rf /wheels WORKDIR /opt/sherlock/sherlock -ENTRYPOINT ["python", "sherlock.py"] +ENTRYPOINT ["sherlock"] diff --git a/README.md b/README.md index b71cc2bc..f1a241ab 100644 --- a/README.md +++ b/README.md @@ -25,20 +25,13 @@ ## Installation ```console -# clone the repo -$ git clone https://github.com/sherlock-project/sherlock.git - -# change the working directory to sherlock -$ cd sherlock - -# install the requirements -$ python3 -m pip install -r requirements.txt +pip install git+https://github.com/sherlock-project/sherlock.git ``` ## Usage ```console -$ python3 sherlock --help +$ sherlock --help usage: sherlock [-h] [--version] [--verbose] [--folderoutput FOLDEROUTPUT] [--output OUTPUT] [--tor] [--unique-tor] [--csv] [--site SITE_NAME] [--proxy PROXY_URL] [--json JSON_FILE] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..3a187ba9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,23 @@ +[build-system] +requires = ["setuptools >= 61.0"] +build-backend = "setuptools.build_meta" + +[project.scripts] +sherlock = "sherlock:main" + +[project.urls] +Homepage = "http://sherlock-project.github.io/" +Repository = "https://github.com/sherlock-project/sherlock.git" +Issues = "https://github.com/sherlock-project/sherlock/issues" + +[project] +name = "sherlock" +readme = "README.md" +license = {file = "LICENSE"} +dynamic = ["dependencies", "version"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[tool.setuptools] +package-dir = {"" = "sherlock"} From 1698928bd3c3319d264321b30d3d9c87beb5272f Mon Sep 17 00:00:00 2001 From: Paul Pfeister Date: Sat, 11 May 2024 00:27:48 -0400 Subject: [PATCH 2/2] Prepare PyProject --- .gitignore | 3 +++ pyproject.toml | 27 +++++++++++++++++++++++++-- setup.cfg | 4 ++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 setup.cfg diff --git a/.gitignore b/.gitignore index 0552d417..4d47421a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,9 @@ __pycache__/ # Pip src/ +# Pip / PyProject Devel & Installation +*.egg-info/ + # Jupyter Notebook .ipynb_checkpoints *.ipynb diff --git a/pyproject.toml b/pyproject.toml index 3a187ba9..e826f240 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,13 +11,36 @@ Repository = "https://github.com/sherlock-project/sherlock.git" Issues = "https://github.com/sherlock-project/sherlock/issues" [project] -name = "sherlock" +name = "Sherlock" +authors = [ + { name = "Sherlock Project" } +] +maintainers = [ + { name = "Siddharth Dushantha" }, + { name = "Matheus Felipe" }, + { name = "Sondre Karlsen Dyrnes" }, + { name = "Paul Pfeister" } +] +description = "Hunt down social media accounts by username across social networks" readme = "README.md" license = {file = "LICENSE"} dynamic = ["dependencies", "version"] +keywords = [ "osint", "reconnaissance", "information gathering" ] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Communications", + "Topic :: Security" +] [tool.setuptools.dynamic] -dependencies = {file = ["requirements.txt"]} +dependencies = { file = [ "requirements.txt" ] } +version = { attr = "sherlock.__version__" } [tool.setuptools] package-dir = {"" = "sherlock"} diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..8929bbae --- /dev/null +++ b/setup.cfg @@ -0,0 +1,4 @@ +[metadata] +name = Sherlock +author = Sherlock Project +url = http://sherlock-project.github.io/