Skip to content

Commit dac313f

Browse files
authored
Merge pull request #206 from NeoLight1010/Feature_PoetryImplementation
Poetry Implementation
2 parents 31d4a1b + 81f81d6 commit dac313f

12 files changed

Lines changed: 1348 additions & 54 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ torBot
2525
.*.swp
2626
.ropeproject/
2727
.idea/
28+
.vscode/
2829
.DS_Store
2930

3031
venv/
32+
.venv/
3133
*.csv
3234
.DS_Store
3335
.env

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
sudo: required
2-
dist: trusty
2+
dist: xenial
33
language: python
44
cache: pip3
55
python:
6-
- "3.6"
6+
- "3.9"
77
# command to install dependencies
88
install:
9-
- sudo apt-get -y install python3-pip
10-
- pip3 install -r requirements.txt
9+
- pip install poetry
10+
- poetry config virtualenvs.create false
11+
- poetry install
1112
- cd src/modules/tests
1213
script:
1314
- pytest

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,20 @@ Contributor name will be updated to the below list. 😀
6565

6666
### OS Dependencies
6767
- Tor
68-
- Python 3.x
68+
- Python ^3.7
6969
- Golang 1.x (Not Currently Used)
7070

7171
### Python Dependencies
72+
73+
(see pyproject.toml for more detail)
7274
- beautifulsoup4
7375
- pyinstaller
7476
- PySocks
7577
- termcolor
7678
- requests
7779
- requests_mock
7880
- yattag
81+
- numpy
7982

8083

8184
## Basic setup
@@ -86,8 +89,13 @@ Before you run the torBot make sure the following things are done properly:
8689

8790
* Make sure that your torrc is configured to SOCKS_PORT localhost:9050
8891

92+
* Install [Poetry](https://python-poetry.org/docs/)
93+
94+
* Disable Poetry virtualenvs (not required)
95+
`poetry config settings.virtualenvs.create false`
96+
8997
* Install TorBot Python requirements
90-
`pip3 install -r requirements.txt`
98+
`poetry install`
9199

92100
On Linux platforms, you can make an executable for TorBot by using the install.sh script.
93101
You will need to give the script the correct permissions using `chmod +x install.sh`
@@ -126,9 +134,9 @@ Read more about torrc here : [Torrc](https://github.com/DedSecInside/TorBoT/blob
126134
#### Using Docker
127135

128136
- Ensure than you have a tor container running on port 9050.
129-
- Build the image using following command:
137+
- Build the image using following command (in the root directory):
130138

131-
`docker build -t dedsecinside/torbot .`
139+
`docker build -f docker/Dockerfile -t dedsecinside/torbot .`
132140
- Run the container (make sure to link the tor container as `tor`):
133141

134142
`docker run --link tor:tor --rm -ti dedsecinside/torbot`

docker/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.6-stretch
1+
FROM python:3
22
LABEL maintainer="dedsec_inside"
33

44
# Install PyQt5
@@ -11,7 +11,9 @@ WORKDIR /app
1111

1212
COPY . .
1313

14-
RUN pip install -r requirements.txt
14+
RUN pip install --no-cache-dir poetry
15+
RUN poetry config virtualenvs.create false
16+
RUN python -m poetry install --no-dev
1517

1618
RUN chmod +x install.sh
1719
RUN bash install.sh

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
mkdir -p tmp_build
55
mkdir -p tmp_dist
66

7-
pip install pyinstaller
7+
pip install pyinstaller
88

99
# Creates executable file and sends dependences to the recently created directories
10-
pyinstaller --onefile --workpath ./tmp_build --distpath ./tmp_dist src/torBot.py
10+
pyinstaller --onefile --workpath ./tmp_build --distpath ./tmp_dist --paths=src src/torBot.py
1111

1212
# Puts the executable in the current directory
1313
mv tmp_dist/torBot .

0 commit comments

Comments
 (0)