Skip to content

Commit

Permalink
updated instructions to use pipenv
Browse files Browse the repository at this point in the history
  • Loading branch information
dethos committed Jun 1, 2018
1 parent a133c11 commit 6c37f64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 101 deletions.
18 changes: 5 additions & 13 deletions CONTRIBUTING.md
Expand Up @@ -8,23 +8,15 @@ Below are a few things we follow and would appreciate if you do too.

When reporting bugs or requesting new features, please provide as much detail and context as you can. This will make things much easier to the people trying to address your issue.

## How to add/remove dependencies
## Dependencies

* Add/remove to the correct `.in` file the required package. For dev only dependencies `requirements_dev.in`, otherwise `requirements.in`. Note: you should pin the version number.
If you need to use other dependencies, please make sure you install them using `pipenv` with the command:

* Compile the new requirements (You will need to install `pip-tools`)
>$ pipenv install <package>
```
$ pip-compile requirements/base.in -o requirements/requirements.txt
```
or in case it is only useful for developers add the `--dev` flag.

and

```
$ pip-compile requirements/base.in requirements/development.in -o requirements/requirements_dev.txt
```

* Commit these changes alongside your other code modifications
You should add the changes in `Pipfile` and `Pipfile.lock` to your commit.

## Style

Expand Down
93 changes: 5 additions & 88 deletions README.md
Expand Up @@ -27,30 +27,17 @@ Base requirements:
* Python 3
* Redis
* PostgreSQL
* gulp

## Linux
## On Linux

On a **Debian** based operating system execute the following steps, after cloning the repository:

* Install VirtualEnv and VirtualEnvWrapper

```
$ sudo apt-get install python-virtualenvwrapper
```

(follow their installation steps)

* Create a virtual environment, using python3

```
$ mkvirtualenv hawkpost --python=python3
```
* Make sure you have `pipenv` installed. You can check [this page for more information](https://docs.pipenv.org/install/#installing-pipenv)

* Install the dependencies

```
$ pip install -r requirements/requirements_dev.txt
$ pipenv install
```

* Create the local postgreSQL database with your user and no password
Expand All @@ -61,77 +48,7 @@ $ pip install -r requirements/requirements_dev.txt
$ python manage.py migrate
```

* Generate stylesheet

```
$ gulp build
```

* Now you should be able to launch the server and its workers

```
$ python manage.py runserver
$ celery -A hawkpost worker --beat -l info
```

## OSX

First, install [Postgres.app](http://postgresapp.com/) and make sure it's in the Applications folder. Add `/Applications/Postgres.app/Contents/Versions/latest/bin` to your $PATH.

Steps:

* Update [Homebrew](http://brew.sh/)

```
$ brew update
```

* Update [Pip](https://pip.pypa.io/en/stable/installing/)

```
$ sudo pip install --upgrade pip
```

* Install the latest 2.7.x version and 3.x of Python via Homebrew

```
$ brew install python
$ brew install python3
```

* Install Virtualenv

```
$ pip install virtualenv
```

* Setup Virtualenv
```
$ mkdir ~/.virtualenvs
$ cd ~/.virtualenvs
$ virtualenv hawkpost --python=python3
$ source hawkpost/bin/activate
```

* Clone the project, go to the folder and install the dependencies

```
$ pip install -r requirements/requirements_dev.txt
```

* Create the database for the first time

```
$ psql CREATE DATABASE hawkpost_dev;
```

* Prepare the database

```
$ python manage.py migrate
```

* Generate stylesheet
* Generate stylesheet with gulp (installation instructions for gulp can be found [here](https://gulpjs.com/))

```
$ gulp build
Expand All @@ -144,7 +61,7 @@ $ python manage.py runserver
$ celery -A hawkpost worker --beat -l info
```

## Docker
## Using Docker

To use this approach you need to have [Docker][docker-overview] and
[Docker Compose][docker-compose-overview] installed.
Expand Down

0 comments on commit 6c37f64

Please sign in to comment.