Skip to content

Commit

Permalink
Use pipenv for local development, instead of requirements files. (#147)
Browse files Browse the repository at this point in the history
* Use pipenv for local development, instead of requirements files.

* Update Travis file to account for pipenv.

* Use deploy and system flags for pipenv.

* Install dev requirements in travis build.

* Do not invoke shell script via pipenv run.

* Add printout of current directory to error message.

* Instead of raising an error, cd to the git repo root.

* Use cd instead of pushd.

* Mention "docker-compose up" in the getting started guide.
  • Loading branch information
obi1kenobi committed Dec 31, 2018
1 parent 00c0027 commit 7dcddb0
Show file tree
Hide file tree
Showing 7 changed files with 450 additions and 37 deletions.
24 changes: 13 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,35 @@ dist: xenial
services:
- docker
install:
- pip install -r dev-requirements.txt
- pip install -e .
- pip install --upgrade pip
- pip install --upgrade setuptools pipenv
- pipenv install --dev --deploy --system
- pipenv install --system --skip-lock -e .
before_script:
- docker-compose up -d
matrix:
include:
- name: "Lint and static analysis"
python: "3.6"
script:
- ./scripts/copyright_line_check.sh
- isort --check-only --verbose --recursive graphql_compiler/
- flake8 --config=setup.cfg graphql_compiler/
- pydocstyle graphql_compiler/
- pylint graphql_compiler/
- bandit -r graphql_compiler/
- pipenv run ./scripts/copyright_line_check.sh
- pipenv run isort --check-only --verbose --recursive graphql_compiler/
- pipenv run flake8 --config=setup.cfg graphql_compiler/
- pipenv run pydocstyle graphql_compiler/
- pipenv run pylint graphql_compiler/
- pipenv run bandit -r graphql_compiler/
- name: "Python 2.7 unit tests"
python: "2.7"
script:
- py.test --cov=graphql_compiler graphql_compiler/tests
- pipenv run py.test --cov=graphql_compiler graphql_compiler/tests
- name: "Python 3.6 unit tests"
python: "3.6"
script:
- py.test --cov=graphql_compiler graphql_compiler/tests
- pipenv run py.test --cov=graphql_compiler graphql_compiler/tests
- name: "Python 3.7 unit tests"
python: "3.7"
script:
- py.test --cov=graphql_compiler graphql_compiler/tests
- pipenv run py.test --cov=graphql_compiler graphql_compiler/tests
after_success:
- docker-compose down
- coveralls
13 changes: 9 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

Thank you for taking the time to contribute to this project!

To get started:
To get started, make sure that you have `pipenv`, `docker` and `docker-compose` installed
on your computer.

Then, from the root of the repository, run:
```
pip install -r dev-requirements.txt
pip install -r requirements.txt
docker-compose up -d
pipenv sync --dev
pipenv shell
py.test graphql_compiler/tests
```
Expand All @@ -31,7 +35,8 @@ of both the contributors and the project.
This project follows the
[Google Python style guide](https://google.github.io/styleguide/pyguide.html).

Additionally, any contributions must pass the following set of lint and style checks with no issues:
Additionally, any contributions must pass the following set of lint and style checks with no issues
when executed from a pipenv shell (i.e. after running `pipenv shell`):
```
isort --check-only --verbose --recursive graphql_compiler/
Expand Down
27 changes: 27 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
bandit = "==1.4.0"
coveralls = "==1.2.0"
flake8 = "==3.5.0"
isort = "==4.3.4"
pydocstyle = "==2.1.1"
pylint = "==1.8.2"
pyorient = "==1.5.5"
pytest = "==3.4.1"
pytest-cov = "==2.5.1"
snapshottest = "==0.5.0"

[packages]
arrow = "==0.10.0"
funcy = "==1.7.3"
graphql-core = "==1.1"
pytz = "==2017.2"
six = "==1.10.0"
sqlalchemy = "==1.2.9"

[requires]
python_version = "3.6"
Loading

0 comments on commit 7dcddb0

Please sign in to comment.