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

Add pipenv setup #250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 3 additions & 7 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
fail-fast: false
matrix:
python-ver:
# - "3.5.4"
- "3.5"
- "3.6"
- "3.7"
Expand All @@ -38,14 +37,11 @@ jobs:
- name: Install apt deps
run: sudo apt-get update && sudo apt-get install -qq -y libenchant-dev libxml2-dev libxslt1-dev
- name: Install dependencies
run: |
pip install -U pip setuptools cython wheel
pip install -Ur requirements-dev.txt
- name: Test with pytest
run: pytest
run: pipenv install --deploy --dev
- name: Run tests
run: pipenv run test
env:
PYTHONASYNCIODEBUG: 1
PYTHONPATH: .
- uses: codecov/[email protected]
with:
name: build-${{ matrix.python-ver }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Expand youtube.py error information
- Handle 'a' vs 'an' in drinks plugin
- Apply rate limiting to regex hooks
- Switched deploy to pipenv setup
### Fixed
- Fix matching exception in horoscope test
- Fix youtube.py ISO time parse
Expand Down
41 changes: 41 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
coverage = "~=5.3"
freezegun = "~=1.0.0"
pylint = "~=2.6.0"
pytest = "~=6.1.1"
pytest-asyncio = "~=0.14.0"
pytest-cov = "~=2.10.1"
pytest-random-order = "~=1.0.4"
responses = "~=0.12.0"

[packages]
beautifulsoup4 = "~=4.9.3"
cleverwrap = "~=0.3.0.2"
feedparser = "~=5.2.1"
forecastiopy = "~=0.22"
geoip2 = "~=3.0.0"
mcstatus = "~=4.0.0"
googlemaps = "~=4.4.2"
imgurpython = "~=1.1.7"
isodate = "~=0.6.0"
lxml = "~=4.5.2"
multidict = "~=4.7.6"
nltk = "~=3.5"
psutil = "~=5.7.2"
py-irclib = "~=0.3.0"
requests = "~=2.24.0"
tweepy = "~=3.9.0"
venusian = "~=3.0.0"
watchdog = "~=0.10.3"
yarl = "~=1.6.0"
attrs = "~=20.2.0"
SQLAlchemy = "~=1.3.20"

[scripts]
bot = "python -m cloudbot"
test = "pytest"
787 changes: 787 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ Firstly, CloudBot will only run on **Python 3.5.4 or higher**

To install CloudBot on *nix (linux, etc), see [here](docs/installing/nix.md)

To install CloudBot on Windows, see [here](docs/installing/win.md)


### Running CloudBot

Before you run the bot, rename `config.default.json` to `config.json` and edit it with your preferred settings. You can check if your JSON is valid using [jsonlint.com](http://jsonlint.com/)!
Expand Down
6 changes: 0 additions & 6 deletions Vagrantfile

This file was deleted.

57 changes: 3 additions & 54 deletions docs/installing/nix.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,12 @@
### Downloading

[Quick Install](#quick-install)

#### Archive
Download CloudBot from [https://github.com/TotallyNotRobots/CloudBot/archive/master.zip](https://github.com/TotallyNotRobots/CloudBot/archive/master.zip) and unzip, or execute the following commands:
```bash
curl -Ls https://github.com/TotallyNotRobots/CloudBot/archive/master.zip > CloudBot.zip
unzip CloudBot.zip
cd CloudBot-master
```

#### Git

Alternately, you can also clone CloudBot by using:
```bash
git clone https://github.com/TotallyNotRobots/CloudBot.git
cd CloudBot
```

### Installing Dependencies

All of CloudBot's python dependencies are stored in the `requirements.txt` file, and can be installed with pip.

But first, you will need `git`, `python3.5-dev` and `libenchant1c2a`, `libxml2-dev`, `libxslt-dev` and `zlib1g-dev`. Install these with your system's package manager.

For example, on a Debian-based system, you could use:
```bash
[sudo] apt-get install -y python3.5-dev git libenchant-dev libxml2-dev libxslt-dev zlib1g-dev
```

You will also need to install `pip`, which can be done by following [this guide](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#installing-pip)

It is also recommended that you create a virtual environment for the bot to isolate it from system library updates. First, [install the venv package](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#installing-virtualenv) if required, and then [create the virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment)

We will refer to the virtual environment directory as `<VENV_DIR>` from here on.

Once the virtual environment is created, [activate it](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#activating-a-virtual-environment).

Finally, install the python dependencies using `pip` using the following command in the CloudBot directory:
```bash
pip install -Ur requirements.txt
```

Now you are ready to run the bot! This can be done simply by executing the cloudbot module like so
```bash
python -m cloudbot
```
or without activating the virtual environment, use
```bash
<VENV_DIR>/bin/python -m cloudbot
```

## Quick Install
### Ubuntu (latest LTS)
To quickly get the bot up and running without much customization
1. [Install pipenv](https://github.com/pypa/pipenv#installation)
1. Run `git clone https://github.com/TotallyNotRobots/CloudBot.git`
1. `cd CloudBot`
1. `python3 -m venv venv --clear`
1. `venv/bin/python -m pip install -Ur requirements.txt`
1. `pipenv install --deploy`
1. Copy `config.default.json` to `config.json`, change settings as needed and validate it with [jsonlint](https://jsonlint.com/).
1. Run the bot while in the `CloudBot` directory
1. `venv/bin/python -m cloudbot`
1. `pipenv run bot`
30 changes: 0 additions & 30 deletions docs/installing/win.md

This file was deleted.

9 changes: 0 additions & 9 deletions requirements-dev.txt

This file was deleted.

21 changes: 0 additions & 21 deletions requirements.txt

This file was deleted.

28 changes: 0 additions & 28 deletions vagrant-bootstrap.sh

This file was deleted.