aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--.travis.yml5
-rw-r--r--Pipfile12
-rw-r--r--README.md6
-rw-r--r--docs/contributing.md84
-rw-r--r--requirements.txt3
6 files changed, 109 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 8673f9c..0c995ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,7 @@
*.pyc
.cache/
*.sublime-*
+
+# Ignore pipenv's lockfile until support for multiple versions of python is
+# dropped
+/Pipfile.lock
diff --git a/.travis.yml b/.travis.yml
index bf69238..5b43ff3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,8 @@ python:
cache: pip
install:
- - pip install flake8 pytest websocket-client
+ - pip install pipenv
+ - pipenv install --dev --system
before_script:
# stop the build if there are Python syntax errors or undefined names
@@ -15,7 +16,7 @@ before_script:
- flake8 . --exit-zero --select=C,E,F,W
script:
- - python -m pytest
+ - pytest
notifications:
irc: "chat.freenode.net#wee-slack-dev"
diff --git a/Pipfile b/Pipfile
new file mode 100644
index 0000000..00ff28d
--- /dev/null
+++ b/Pipfile
@@ -0,0 +1,12 @@
+[[source]]
+url = "https://pypi.python.org/simple"
+verify_ssl = true
+name = "pypi"
+
+[packages]
+websocket-client = "*"
+
+[dev-packages]
+mock = "*"
+pytest = "*"
+flake8 = "*"
diff --git a/README.md b/README.md
index dcbfbfd..cb827ec 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,7 @@ A WeeChat native client for Slack.com. Provides supplemental features only avail
Table of Contents
-----------------
* [Features](#features)
+ * [Contributing](#contributing)
* [Dependencies](#dependencies)
* [Setup](#setup)
* [1. Install dependencies](#1-install-dependencies)
@@ -58,6 +59,11 @@ Features
* Expands/shows metadata for things like tweets/links
* *Super fun* debug mode. See what the websocket is saying
+Contributing
+------------
+
+See [docs/contributing.md](./docs/contributing.md).
+
Dependencies
------------
* WeeChat 1.3+ http://weechat.org/
diff --git a/docs/contributing.md b/docs/contributing.md
new file mode 100644
index 0000000..24deaf6
--- /dev/null
+++ b/docs/contributing.md
@@ -0,0 +1,84 @@
+# Contributing
+
+Thank you for considering contributing to `wee-slack`!
+
+## Requirements
+
+* [`git`](https://git-scm.com)
+* [`pipenv`](https://github.com/pypa/pipenv)
+
+## Activating the development environment
+
+The development environment contains a few useful tools. Before testing or
+working on `wee-slack`, the development environment should be activated. This
+will ensure you have access to the necessary development tools.
+
+```
+$ cd /path/to/wee-slack
+$ pipenv shell
+
+# Install the required development dependencies
+$ pipenv install --dev
+```
+
+The rest of this document assumes that the development environment has been
+activated, and that you have the latest development dependencies installed.
+
+## Testing
+
+Tests are executed with `pytest`. To run the tests, first navigate to the
+project root, and then execute:
+
+```
+$ pytest
+```
+
+## Adding new dependencies
+
+Add your desired dependencies to the appropriate header, specifying a version if
+necessary, defaulting to `*` if not. Be extra careful if you are pinning a
+specific version of a dependency, as we currently support multiple versions of
+Python which may or may not have the version you specify available to it.
+
+```
+# use [package] for production dependencies
+[package]
+foo-package = "*"
+
+# use [dev-packages] for development dependencies
+[dev-packages]
+bar-package = "*"
+```
+
+> **PRO TIP**
+>
+> You can also add dependencies without manually updating this file by running
+> `pipenv install [--dev] <package...>`. This will automatically update the
+> entry for the package in the `Pipfile` (and your local lockfile).
+>
+> For example, to add the `foo` and `bar` packages as development dependencies
+> without specificying a version, you would run:
+>
+> ``` pipenv install --dev foo bar ```
+
+## Updating dependencies
+
+It's important to keep our dependencies up-to-date over time. Because we support
+multiple versions of Python, we avoid committing the `Pipfile.lock` file (which
+is added in `.gitignore`), in addition to avoiding pinning versions of packages.
+
+To update the dependencies installed in your local virtual environment:
+
+```
+# Check for upstream updates
+$ pipenv update --outdated
+
+# Want to update everything?
+$ pipenv update
+
+# Want to update one package at a time?
+$ pipenv update <pkg>
+```
+
+It's important to [run the tests](#testing) after updating dependencies to
+ensure that the updated dependencies have not broken the build.
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index d0d67bc..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-pytest
-mock
-websocket-client