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 PyProject to Poetry #2111

Merged
merged 30 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fba6432
Switch to Poetry
ppfeister May 16, 2024
de8ebb1
Relocate unit tests
ppfeister May 16, 2024
b2a69b5
Remove setup.[cfg|py]
ppfeister May 16, 2024
caed51e
Remove rpm spec
ppfeister May 16, 2024
44bc852
Remove setup.[cfg|py] from codeowners
ppfeister May 16, 2024
9f58f93
Remove requirements.txt
ppfeister May 16, 2024
6b09955
Remove install redirect
ppfeister May 16, 2024
07227e4
Add dynamic versionin support (disabled)
ppfeister May 16, 2024
af7565e
Allow higher certifi
ppfeister May 16, 2024
36c274e
Remove License classifier
ppfeister May 16, 2024
e580578
Downgrade poetry-core
ppfeister May 16, 2024
3b713ed
Fix cli mod exec import
ppfeister May 17, 2024
63a1c14
Fix version string
ppfeister May 17, 2024
ea1c421
Update docs with module changes
ppfeister May 17, 2024
7867e26
Remove upper limit
ppfeister May 17, 2024
8fee9a9
Ignore Poetry
ppfeister May 18, 2024
b485001
Switch versioning plugin
ppfeister May 18, 2024
41f798a
Ignore dist
ppfeister May 18, 2024
33bbb4e
Fix pyproject URLs
ppfeister May 18, 2024
16e6ee6
Add email to maintainers
ppfeister May 18, 2024
606743b
Remove tor
ppfeister May 18, 2024
4b7fd8b
Fix typos
ppfeister May 18, 2024
ba2eef7
Revert "Remove tor"
ppfeister May 18, 2024
377e076
Update pyproject.toml
ppfeister May 18, 2024
313d2a9
Caret depends
ppfeister May 18, 2024
1b0e508
Allow pandas upgrade
ppfeister May 18, 2024
07274a9
Add note about version number
ppfeister May 18, 2024
04ce7aa
Change remote version URI
ppfeister May 20, 2024
b38faf7
Fix conflicts
ppfeister May 24, 2024
b8ca8aa
Add Sponsor
ppfeister May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@
# Changes made to these items without code owner approval may negatively
# impact packaging pipelines. Code owners may need time to verify or adapt.
/pyproject.toml @ppfeister @sdushantha
/setup.cfg @ppfeister @sdushantha
/setup.py @ppfeister
/*.spec @ppfeister
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Sherlock. This invocation hides the progress text that Sherlock normally
outputs, and instead shows the verbose output of the tests.

```console
$ cd sherlock/sherlock
# Assumes pwd is respository root
$ python3 -m unittest tests.all --verbose
```

Expand Down
13 changes: 4 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
[![PyPI - Version](https://img.shields.io/pypi/v/sherlock-project?logo=PyPi&label=PyPI&color=darkgreen)][ext_pypi] [![Docker Image Version](https://img.shields.io/docker/v/sherlock/sherlock?sort=semver&logo=docker&label=Docker&color=darkgreen)][docs_docker] [![homebrew version](https://img.shields.io/homebrew/v/sherlock?logo=Homebrew&color=darkgreen)][ext_brew]


| Method | Command | Notes |
| | Command | Notes |
| - | - | - |
| pypi | `pipx install sherlock-project` | `pip` may be used in place of `pipx` |
| brew | `brew install sherlock` | Community supported |
| docker | `docker pull sherlock/sherlock` | |
| PyPI | `pipx install sherlock-project` | `pip` may be used in place of `pipx` |
| Homebrew | `brew install sherlock` | Community supported |
| Docker | `docker pull sherlock/sherlock` | |

### Alternative guides and methods

Expand Down Expand Up @@ -133,15 +133,10 @@ Original Creator - [Siddharth Dushantha](https://github.com/sdushantha)

[docs_install]: /docs/install.md
[docs_docker]: /docs/install.md#docker
[docs_docker_dockerhub]: /docs/install.md#docker
[docs_docker_compose]: /docs/install.md#using-compose
[docs_docker_source]: /docs/install.md#build-image-from-source-useful-for-contributors
[docs_py]: /docs/install.md#python
[docs_py_build]: /docs/install.md#build-python-package-from-source-useful-for-contributors
[docs_contrib]: /docs/CONTRIBUTING.md
[docs_contrib_adding_targets]: /docs/CONTRIBUTING.md#adding-targets
[docs_contrib_removing_targets]: /docs/CONTRIBUTING.md#removing-targets
[docs_contrib_restoring_targets]: /docs/CONTRIBUTING.md#restoring-targets
[ext_pypi]: https://pypi.org/project/sherlock-project/
[ext_brew]: https://formulae.brew.sh/formula/sherlock

19 changes: 14 additions & 5 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,22 @@ Python
pipx install sherlock-project
```

### Build python package from source (useful for contributors)
### Build live package from source (useful for contributors)

Building an editable (or live) package links the entry point to your current directory, rather than to the standard install location. This is often useful when working with the code base, as changes are reflected immediately without reinstallation.

```bash
# pipx is recommended, but pip may suffice if pipx is unavailable
git clone https://github.com/sherlock-project/sherlock.git
cd sherlock
pipx install .
# Assumes repository cloned, and pwd is repository root
pipx install -e .
```

### Run package from source (no install)

If you'd rather not install directly to your system, you can import the module at runtime with `-m`.

```bash
# Assumes repository cloned, and pwd is repository root
python3 -m sherlock user123 user789
```

<h2>
Expand Down
26 changes: 11 additions & 15 deletions docs/pyproj/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@

<p align=center>
<br>
<a href="https://sherlock-project.github.io/" target="_blank"><img src="https://user-images.githubusercontent.com/27065646/53551960-ae4dff80-3b3a-11e9-9075-cef786c69364.png"/></a>
<a href="https://sherlock-project.github.io/" target="_blank"><img src="https://www.kali.org/tools/sherlock/images/sherlock-logo.svg" width="25%"/></a>
<br>
<span>Hunt down social media accounts by username across <a href="https://github.com/sherlock-project/sherlock/blob/master/sites.md">social networks</a></span>
<strong><span>Hunt down social media accounts by username across <a href="https://github.com/sherlock-project/sherlock/blob/master/sites.md">400+ social networks</a></span></strong>
<br><br>
<span>Additional documentation can be found at our <a href="https://github.com/sherlock-project/sherlock/">GitHub repository</a></span>
<br>
<span>Additional documentation can be found on our <a href="https://github.com/sherlock-project/sherlock/">GitHub repository</a></span>
<br>
</p>

<p align="center">
<img width="70%" height="70%" src="https://user-images.githubusercontent.com/27065646/219638267-a5e11090-aa6e-4e77-87f7-0e95f6ad5978.png"/>
</a>
</p>

## Usage
Expand All @@ -36,11 +31,12 @@ To search for more than one user:
```bash
$ sherlock user1 user2 user3
```
<br>

## Star History
___

<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=sherlock-project/sherlock&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=sherlock-project/sherlock&type=Date" />
<img alt="Sherlock Project Star History Chart" src="https://api.star-history.com/svg?repos=sherlock-project/sherlock&type=Date" />
</picture>
<br>
<p align="center">
<img width="70%" height="70%" src="https://user-images.githubusercontent.com/27065646/219638267-a5e11090-aa6e-4e77-87f7-0e95f6ad5978.png"/>
</a>
</p>
67 changes: 42 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,48 +1,65 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
requires = [ "poetry-core>=1.6.0", "poetry-dynamic-versioning>1.0.0,<2.0.0" ]
build-backend = "poetry_dynamic_versioning.backend"
# poetry-core 1.8 not available in .fc39. Can upgrade to 1.8.0 at .fc39 EOL

[project.scripts]
sherlock = "sherlock:main"
[tool.poetry-dynamic-versioning]
enable = false
metadata = false
strict = true
vcs = "git"
# Matched tags:
# v0.0.0 followed by optional -rc0 (release candidate) OR -b0 (public beta)
pattern = "^v(?P<base>\\d+(?:\\.\\d+){2})(?:-(?P<stage>(?:rc|b)\\d+?))??$"

[project.urls]
Homepage = "http://sherlock-project.github.io/"
Repository = "https://github.com/sherlock-project/sherlock.git"
Issues = "https://github.com/sherlock-project/sherlock/issues"
[tool.poetry-dynamic-versioning.substitution]
folders = [ { path = "sherlock" } ]

[project]
[tool.poetry]
name = "sherlock-project"
version = "0.14.4"
description = "Hunt down social media accounts by username across social networks"
license = "MIT"
authors = [
{ name = "Siddharth Dushantha" }
"Siddharth Dushantha"
ppfeister marked this conversation as resolved.
Show resolved Hide resolved
]
maintainers = [
{ name = "Matheus Felipe" },
{ name = "Sondre Karlsen Dyrnes" },
{ name = "Paul Pfeister" }
"Paul Pfeister",
"Matheus Felipe",
"Sondre Karlsen Dyrnes"
ppfeister marked this conversation as resolved.
Show resolved Hide resolved
]
description = "Hunt down social media accounts by username across social networks"
readme = "docs/pyproj/README.md"
# Do not set license to file. Causes issues with rpm packaging for some reason.
license = {text = "MIT"}
dynamic = ["dependencies", "version"]
packages = [ { include = "sherlock"} ]
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 :: Security"
]
homepage = "http://sherlock-project.github.io/"
ppfeister marked this conversation as resolved.
Show resolved Hide resolved
repository = "https://github.com/sherlock-project/sherlock.git"
ppfeister marked this conversation as resolved.
Show resolved Hide resolved


[tool.setuptools.dynamic]
dependencies = { file = [ "requirements.txt" ] }
version = { attr = "sherlock.__version__" }
[tool.poetry.urls]
"Bug Reporting" = "https://github.com/sherlock-project/sherlock/issues"
"Contributors" = "https://github.com/sherlock-project/sherlock/graphs/contributors"

[tool.setuptools]
package-dir = {"" = "sherlock"}
[tool.poetry.dependencies]
python = "^3.8"
certifi = ">=2019.6.16"
colorama = ">=0.4.1"
PySocks = ">=1.7.0"
requests = ">=2.22.0"
requests-futures = ">=1.0.0"
stem = ">=1.8.0"
torrequest = ">=0.1.0"
pandas = ">=1.0.0"
openpyxl = ">=3.0.10"
exrex = ">=0.11.0"
ppfeister marked this conversation as resolved.
Show resolved Hide resolved

[tool.setuptools.package-data]
"*" = ["*.json"]
[tool.poetry.scripts]
sherlock = 'sherlock.sherlock:main'
10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

4 changes: 0 additions & 4 deletions setup.cfg

This file was deleted.

8 changes: 0 additions & 8 deletions setup.py

This file was deleted.

71 changes: 0 additions & 71 deletions sherlock-project.spec

This file was deleted.

2 changes: 1 addition & 1 deletion sherlock/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
print(f"Sherlock requires Python 3.6+\nYou are using Python {python_version}, which is not supported by Sherlock.")
sys.exit(1)

import sherlock
from sherlock import sherlock
sherlock.main()
2 changes: 1 addition & 1 deletion sherlock/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This module defines the objects for notifying the caller about the
results of queries.
"""
from result import QueryStatus
from sherlock.result import QueryStatus
from colorama import Fore, Style
import webbrowser

Expand Down
14 changes: 7 additions & 7 deletions sherlock/sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

from requests_futures.sessions import FuturesSession
from torrequest import TorRequest
from result import QueryStatus
from result import QueryResult
from notify import QueryNotifyPrint
from sites import SitesInformation
from sherlock.result import QueryStatus
from sherlock.result import QueryResult
from sherlock.notify import QueryNotifyPrint
from sherlock.sites import SitesInformation
from colorama import init
from argparse import ArgumentTypeError

Expand Down Expand Up @@ -510,9 +510,9 @@ def handler(signal_received, frame):

def main():
version_string = (
f"%(prog)s {__version__}\n"
+ f"{requests.__description__}: {requests.__version__}\n"
+ f"Python: {platform.python_version()}"
f"Sherlock {__version__}\n"
+ f"Requests {requests.__version__}\n"
+ f"Python {platform.python_version()}"
)

parser = ArgumentParser(
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions sherlock/tests/base.py → tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import os
import os.path
import unittest
import sherlock
from result import QueryStatus
from notify import QueryNotify
from sites import SitesInformation
from sherlock import sherlock
from sherlock.result import QueryStatus
from sherlock.notify import QueryNotify
from sherlock.sites import SitesInformation
import warnings


Expand All @@ -30,7 +30,7 @@ def setUp(self):
warnings.simplefilter("ignore", ResourceWarning)

# Create object with all information about sites we are aware of.
sites = SitesInformation(data_file_path=os.path.join(os.path.dirname(__file__), "../resources/data.json"))
sites = SitesInformation(data_file_path=os.path.join(os.path.dirname(__file__), "../sherlock/resources/data.json"))

# Create original dictionary from SitesInformation() object.
# Eventually, the rest of the code will be updated to use the new object
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import importlib
import unittest
import sys
sys.path.append('../')
import sherlock as sh
from sherlock import sherlock as sh

checksymbols = []
checksymbols = ["_", "-", "."]
Expand Down