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-

0 commit comments

Comments
 (0)