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, adopt tox and pytest #2127

Merged
merged 56 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 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
1de8ad0
Fix linter flags
ppfeister May 19, 2024
b344611
Add basic tox
ppfeister May 19, 2024
85ec59e
whitelist -> allowlist
ppfeister May 19, 2024
a785a59
Adopt tox and pytest
ppfeister May 20, 2024
9f75d5e
Fix newline
ppfeister May 20, 2024
08a1291
Remove exrex depend
ppfeister May 20, 2024
2b24cca
Add tests
ppfeister May 20, 2024
030860c
Cleanup
ppfeister May 20, 2024
790305b
Fix ci
ppfeister May 20, 2024
249bab3
Drop py313 from ci
ppfeister May 20, 2024
e32a84e
Fix tox caught errors
ppfeister May 20, 2024
beb4f3e
Disable fail-fast
ppfeister May 20, 2024
8bd8b20
Remove Windows
ppfeister May 20, 2024
906575d
Remove test branch from ci
ppfeister May 20, 2024
4aaf058
Fix platform differences
ppfeister May 21, 2024
e5736d3
Fix platform dependant issues
ppfeister May 21, 2024
9579f94
Remove test branch
ppfeister May 21, 2024
d467758
Simple docu change
ppfeister May 21, 2024
67258b5
Adapt for online testing
ppfeister May 22, 2024
b2ddd9a
Re-ID Regression CI
ppfeister May 31, 2024
9701e4f
Remove Nightly
ppfeister May 31, 2024
c812216
Remove Main
ppfeister May 31, 2024
b0521d6
'pwd' -> 'current working directory'
ppfeister Jun 1, 2024
b728ce0
Cleanup
ppfeister Jun 1, 2024
87f2f08
Add matheusfelipeog
ppfeister Jun 2, 2024
850528f
Add newline
ppfeister Jun 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
### REPOSITORY
/.github/CODEOWNERS @sdushantha
./github/FUNDING.yml @sdushantha
/LICENSE @sdushantha

### PACKAGING
# Changes made to these items without code owner approval may negatively
# impact packaging pipelines. Code owners may need time to verify or adapt.
# impact packaging pipelines.
/pyproject.toml @ppfeister @sdushantha
/setup.cfg @ppfeister @sdushantha
/setup.py @ppfeister
/*.spec @ppfeister

### REGRESSION
/.github/workflows/regression.yml @ppfeister
/tox.ini @ppfeister
/pytest.ini @ppfeister
/tests/ @ppfeister
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [ sdushantha, ppfeister, matheusfelipeog ]
38 changes: 0 additions & 38 deletions .github/workflows/main.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/nightly.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/pull_request.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Regression Testing

on:
pull_request:
branches: [ master ]
push:
branches: [ master ]

jobs:
tox-matrix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # We want to know what version it fails on
matrix:
os: [
ubuntu-latest,
windows-latest,
macos-latest,
]
python-version: [
'3.8',
'3.9',
'3.10',
'3.11',
'3.12',
]

steps:
- uses: actions/checkout@v4
- name: Set up environment ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox and related dependencies
run: |
python -m pip install --upgrade pip
pip install tox
pip install tox-gh-actions
- name: Run tox
run: tox
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Virtual Environment
# Virtual Environments
venv/
bin/
lib/
pyvenv.cfg
poetry.lock

# Editor Configurations
.vscode/
Expand All @@ -14,8 +15,9 @@ __pycache__/
# Pip
src/

# Pip / PyProject Devel & Installation
# Devel, Build, and Installation
*.egg-info/
dist/**

# Jupyter Notebook
.ipynb_checkpoints
Expand Down
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 current working directory is respository root
$ python3 -m unittest tests.all --verbose
```

Expand Down
21 changes: 16 additions & 5 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,24 @@ 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.

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).

```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 current working directory is repository root
pipx install -e .
```

### Run package from source (without installing)

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

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

<h2>
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

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>
63 changes: 37 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,48 +1,59 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
requires = [ "poetry-core>=1.2.0" ]
build-backend = "poetry.core.masonry.api"
# poetry-core 1.8 not available in .fc39. Can upgrade to 1.8.0 at .fc39 EOL

[project.scripts]
sherlock = "sherlock:main"
[tool.poetry-version-plugin]
source = "init"

[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]
[tool.poetry]
name = "sherlock-project"
# single source of truth for version is __init__.py
version = "0"
description = "Hunt down social media accounts by username across social networks"
license = "MIT"
authors = [
{ name = "Siddharth Dushantha" }
"Siddharth Dushantha <[email protected]>"
]
maintainers = [
{ name = "Matheus Felipe" },
{ name = "Sondre Karlsen Dyrnes" },
{ name = "Paul Pfeister" }
"Paul Pfeister <[email protected]>",
"Matheus Felipe <[email protected]>",
"Sondre Karlsen Dyrnes <[email protected]>"
]
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 = "https://sherlock-project.github.io/"
repository = "https://github.com/sherlock-project/sherlock"


[tool.poetry.urls]
"Bug Tracker" = "https://github.com/sherlock-project/sherlock/issues"

[tool.setuptools.dynamic]
dependencies = { file = [ "requirements.txt" ] }
version = { attr = "sherlock.__version__" }
[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 can likely be bumped up to ^2.0.0 after fc39 EOL
pandas = ">=1.0.0,<3.0.0"
openpyxl = "^3.0.10"

[tool.setuptools]
package-dir = {"" = "sherlock"}
[tool.poetry.group.dev.dependencies]
jsonschema = "^4.0.0"

[tool.setuptools.package-data]
"*" = ["*.json"]
[tool.poetry.scripts]
sherlock = 'sherlock.sherlock:main'
Loading
Loading