Skip to content

Commit 3211b90

Browse files
committed
Merge #2127 to implement Poetry, pytest, and tox
Closes #2111 as its feature branch was the base of this PR's branch Closes #2133 as no longer necessary Closes #2147 as no longer necessary
2 parents ef124ac + 850528f commit 3211b90

34 files changed

+478
-758
lines changed

.github/CODEOWNERS

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
### REPOSITORY
22
/.github/CODEOWNERS @sdushantha
3+
./github/FUNDING.yml @sdushantha
34
/LICENSE @sdushantha
45

56
### PACKAGING
67
# Changes made to these items without code owner approval may negatively
7-
# impact packaging pipelines. Code owners may need time to verify or adapt.
8+
# impact packaging pipelines.
89
/pyproject.toml @ppfeister @sdushantha
9-
/setup.cfg @ppfeister @sdushantha
10-
/setup.py @ppfeister
11-
/*.spec @ppfeister
10+
11+
### REGRESSION
12+
/.github/workflows/regression.yml @ppfeister
13+
/tox.ini @ppfeister
14+
/pytest.ini @ppfeister
15+
/tests/ @ppfeister

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [ sdushantha, ppfeister, matheusfelipeog ]

.github/workflows/main.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/nightly.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/pull_request.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/regression.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Regression Testing
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
push:
7+
branches: [ master ]
8+
9+
jobs:
10+
tox-matrix:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false # We want to know what version it fails on
14+
matrix:
15+
os: [
16+
ubuntu-latest,
17+
windows-latest,
18+
macos-latest,
19+
]
20+
python-version: [
21+
'3.8',
22+
'3.9',
23+
'3.10',
24+
'3.11',
25+
'3.12',
26+
]
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Set up environment ${{ matrix.python-version }}
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Install tox and related dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install tox
38+
pip install tox-gh-actions
39+
- name: Run tox
40+
run: tox

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# Virtual Environment
1+
# Virtual Environments
22
venv/
33
bin/
44
lib/
55
pyvenv.cfg
6+
poetry.lock
67

78
# Editor Configurations
89
.vscode/
@@ -14,8 +15,9 @@ __pycache__/
1415
# Pip
1516
src/
1617

17-
# Pip / PyProject Devel & Installation
18+
# Devel, Build, and Installation
1819
*.egg-info/
20+
dist/**
1921

2022
# Jupyter Notebook
2123
.ipynb_checkpoints

docs/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Sherlock. This invocation hides the progress text that Sherlock normally
6868
outputs, and instead shows the verbose output of the tests.
6969

7070
```console
71-
$ cd sherlock/sherlock
71+
# Assumes current working directory is respository root
7272
$ python3 -m unittest tests.all --verbose
7373
```
7474

docs/INSTALL.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,24 @@ Python
3737
pipx install sherlock-project
3838
```
3939

40-
### Build python package from source (useful for contributors)
40+
### Build live package from source (useful for contributors)
41+
42+
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.
43+
44+
Note that the version number will be 0.0.0 for pipx local builds unless manually changed in the pyproject file (it will prompt the user for an update).
4145

4246
```bash
43-
# pipx is recommended, but pip may suffice if pipx is unavailable
44-
git clone https://github.com/sherlock-project/sherlock.git
45-
cd sherlock
46-
pipx install .
47+
# Assumes repository cloned, and current working directory is repository root
48+
pipx install -e .
49+
```
50+
51+
### Run package from source (without installing)
52+
53+
If you'd rather not install directly to your system, you can import the module at runtime with `-m`.
54+
55+
```bash
56+
# Assumes repository cloned, and current working directory is repository root
57+
python3 -m sherlock user123 user789
4758
```
4859

4960
<h2>

docs/README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
[![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]
2828

2929

30-
| Method | Command | Notes |
30+
| | Command | Notes |
3131
| - | - | - |
32-
| pypi | `pipx install sherlock-project` | `pip` may be used in place of `pipx` |
33-
| brew | `brew install sherlock` | Community supported |
34-
| docker | `docker pull sherlock/sherlock` | |
32+
| PyPI | `pipx install sherlock-project` | `pip` may be used in place of `pipx` |
33+
| Homebrew | `brew install sherlock` | Community supported |
34+
| Docker | `docker pull sherlock/sherlock` | |
3535

3636
### Alternative guides and methods
3737

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

134134
[docs_install]: /docs/INSTALL.md
135135
[docs_docker]: /docs/INSTALL.md#docker
136-
[docs_docker_dockerhub]: /docs/INSTALL.md#docker
137-
[docs_docker_compose]: /docs/INSTALL.md#using-compose
138-
[docs_docker_source]: /docs/INSTALL.md#build-image-from-source-useful-for-contributors
139136
[docs_py]: /docs/INSTALL.md#python
140-
[docs_py_build]: /docs/INSTALL.md#build-python-package-from-source-useful-for-contributors
141137
[docs_contrib]: /docs/CONTRIBUTING.md
142138
[docs_contrib_adding_targets]: /docs/CONTRIBUTING.md#adding-targets
143139
[docs_contrib_removing_targets]: /docs/CONTRIBUTING.md#removing-targets
144140
[docs_contrib_restoring_targets]: /docs/CONTRIBUTING.md#restoring-targets
145141
[ext_pypi]: https://pypi.org/project/sherlock-project/
146142
[ext_brew]: https://formulae.brew.sh/formula/sherlock
147-

docs/pyproj/README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22

33
<p align=center>
44
<br>
5-
<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>
5+
<a href="https://sherlock-project.github.io/" target="_blank"><img src="https://www.kali.org/tools/sherlock/images/sherlock-logo.svg" width="25%"/></a>
66
<br>
7-
<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>
7+
<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>
8+
<br><br>
9+
<span>Additional documentation can be found at our <a href="https://github.com/sherlock-project/sherlock/">GitHub repository</a></span>
810
<br>
9-
<span>Additional documentation can be found on our <a href="https://github.com/sherlock-project/sherlock/">GitHub repository</a></span>
10-
<br>
11-
</p>
12-
13-
<p align="center">
14-
<img width="70%" height="70%" src="https://user-images.githubusercontent.com/27065646/219638267-a5e11090-aa6e-4e77-87f7-0e95f6ad5978.png"/>
15-
</a>
1611
</p>
1712

1813
## Usage
@@ -36,11 +31,12 @@ To search for more than one user:
3631
```bash
3732
$ sherlock user1 user2 user3
3833
```
34+
<br>
3935

40-
## Star History
36+
___
4137

42-
<picture>
43-
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=sherlock-project/sherlock&type=Date&theme=dark" />
44-
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=sherlock-project/sherlock&type=Date" />
45-
<img alt="Sherlock Project Star History Chart" src="https://api.star-history.com/svg?repos=sherlock-project/sherlock&type=Date" />
46-
</picture>
38+
<br>
39+
<p align="center">
40+
<img width="70%" height="70%" src="https://user-images.githubusercontent.com/27065646/219638267-a5e11090-aa6e-4e77-87f7-0e95f6ad5978.png"/>
41+
</a>
42+
</p>

pyproject.toml

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,59 @@
11
[build-system]
2-
requires = ["setuptools >= 61.0"]
3-
build-backend = "setuptools.build_meta"
2+
requires = [ "poetry-core>=1.2.0" ]
3+
build-backend = "poetry.core.masonry.api"
4+
# poetry-core 1.8 not available in .fc39. Can upgrade to 1.8.0 at .fc39 EOL
45

5-
[project.scripts]
6-
sherlock = "sherlock:main"
6+
[tool.poetry-version-plugin]
7+
source = "init"
78

8-
[project.urls]
9-
Homepage = "http://sherlock-project.github.io/"
10-
Repository = "https://github.com/sherlock-project/sherlock.git"
11-
Issues = "https://github.com/sherlock-project/sherlock/issues"
12-
13-
[project]
9+
[tool.poetry]
1410
name = "sherlock-project"
11+
# single source of truth for version is __init__.py
12+
version = "0"
13+
description = "Hunt down social media accounts by username across social networks"
14+
license = "MIT"
1515
authors = [
16-
{ name = "Siddharth Dushantha" }
16+
"Siddharth Dushantha <[email protected]>"
1717
]
1818
maintainers = [
19-
{ name = "Matheus Felipe" },
20-
{ name = "Sondre Karlsen Dyrnes" },
21-
{ name = "Paul Pfeister" }
19+
"Paul Pfeister <[email protected]>",
20+
"Matheus Felipe <[email protected]>",
21+
"Sondre Karlsen Dyrnes <[email protected]>"
2222
]
23-
description = "Hunt down social media accounts by username across social networks"
2423
readme = "docs/pyproj/README.md"
25-
# Do not set license to file. Causes issues with rpm packaging for some reason.
26-
license = {text = "MIT"}
27-
dynamic = ["dependencies", "version"]
24+
packages = [ { include = "sherlock"} ]
2825
keywords = [ "osint", "reconnaissance", "information gathering" ]
2926
classifiers = [
3027
"Development Status :: 5 - Production/Stable",
3128
"Intended Audience :: Developers",
3229
"Intended Audience :: Information Technology",
33-
"License :: OSI Approved :: MIT License",
3430
"Natural Language :: English",
3531
"Operating System :: OS Independent",
3632
"Programming Language :: Python :: 3",
3733
"Topic :: Security"
3834
]
35+
homepage = "https://sherlock-project.github.io/"
36+
repository = "https://github.com/sherlock-project/sherlock"
37+
38+
39+
[tool.poetry.urls]
40+
"Bug Tracker" = "https://github.com/sherlock-project/sherlock/issues"
3941

40-
[tool.setuptools.dynamic]
41-
dependencies = { file = [ "requirements.txt" ] }
42-
version = { attr = "sherlock.__version__" }
42+
[tool.poetry.dependencies]
43+
python = "^3.8"
44+
certifi = ">=2019.6.16"
45+
colorama = "^0.4.1"
46+
PySocks = "^1.7.0"
47+
requests = "^2.22.0"
48+
requests-futures = "^1.0.0"
49+
stem = "^1.8.0"
50+
torrequest = "^0.1.0"
51+
# pandas can likely be bumped up to ^2.0.0 after fc39 EOL
52+
pandas = ">=1.0.0,<3.0.0"
53+
openpyxl = "^3.0.10"
4354

44-
[tool.setuptools]
45-
package-dir = {"" = "sherlock"}
55+
[tool.poetry.group.dev.dependencies]
56+
jsonschema = "^4.0.0"
4657

47-
[tool.setuptools.package-data]
48-
"*" = ["*.json"]
58+
[tool.poetry.scripts]
59+
sherlock = 'sherlock.sherlock:main'

0 commit comments

Comments
 (0)