Skip to content

Commit 7dcddb0

Browse files
authored
Use pipenv for local development, instead of requirements files. (kensho-technologies#147)
* 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.
1 parent 00c0027 commit 7dcddb0

File tree

7 files changed

+450
-37
lines changed

7 files changed

+450
-37
lines changed

.travis.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,35 @@ dist: xenial
55
services:
66
- docker
77
install:
8-
- pip install -r dev-requirements.txt
9-
- pip install -e .
8+
- pip install --upgrade pip
9+
- pip install --upgrade setuptools pipenv
10+
- pipenv install --dev --deploy --system
11+
- pipenv install --system --skip-lock -e .
1012
before_script:
1113
- docker-compose up -d
1214
matrix:
1315
include:
1416
- name: "Lint and static analysis"
1517
python: "3.6"
1618
script:
17-
- ./scripts/copyright_line_check.sh
18-
- isort --check-only --verbose --recursive graphql_compiler/
19-
- flake8 --config=setup.cfg graphql_compiler/
20-
- pydocstyle graphql_compiler/
21-
- pylint graphql_compiler/
22-
- bandit -r graphql_compiler/
19+
- pipenv run ./scripts/copyright_line_check.sh
20+
- pipenv run isort --check-only --verbose --recursive graphql_compiler/
21+
- pipenv run flake8 --config=setup.cfg graphql_compiler/
22+
- pipenv run pydocstyle graphql_compiler/
23+
- pipenv run pylint graphql_compiler/
24+
- pipenv run bandit -r graphql_compiler/
2325
- name: "Python 2.7 unit tests"
2426
python: "2.7"
2527
script:
26-
- py.test --cov=graphql_compiler graphql_compiler/tests
28+
- pipenv run py.test --cov=graphql_compiler graphql_compiler/tests
2729
- name: "Python 3.6 unit tests"
2830
python: "3.6"
2931
script:
30-
- py.test --cov=graphql_compiler graphql_compiler/tests
32+
- pipenv run py.test --cov=graphql_compiler graphql_compiler/tests
3133
- name: "Python 3.7 unit tests"
3234
python: "3.7"
3335
script:
34-
- py.test --cov=graphql_compiler graphql_compiler/tests
36+
- pipenv run py.test --cov=graphql_compiler graphql_compiler/tests
3537
after_success:
3638
- docker-compose down
3739
- coveralls

CONTRIBUTING.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

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

5-
To get started:
5+
To get started, make sure that you have `pipenv`, `docker` and `docker-compose` installed
6+
on your computer.
7+
8+
Then, from the root of the repository, run:
69
```
7-
pip install -r dev-requirements.txt
8-
pip install -r requirements.txt
10+
docker-compose up -d
11+
pipenv sync --dev
12+
pipenv shell
913
1014
py.test graphql_compiler/tests
1115
```
@@ -31,7 +35,8 @@ of both the contributors and the project.
3135
This project follows the
3236
[Google Python style guide](https://google.github.io/styleguide/pyguide.html).
3337

34-
Additionally, any contributions must pass the following set of lint and style checks with no issues:
38+
Additionally, any contributions must pass the following set of lint and style checks with no issues
39+
when executed from a pipenv shell (i.e. after running `pipenv shell`):
3540
```
3641
isort --check-only --verbose --recursive graphql_compiler/
3742

Pipfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
bandit = "==1.4.0"
8+
coveralls = "==1.2.0"
9+
flake8 = "==3.5.0"
10+
isort = "==4.3.4"
11+
pydocstyle = "==2.1.1"
12+
pylint = "==1.8.2"
13+
pyorient = "==1.5.5"
14+
pytest = "==3.4.1"
15+
pytest-cov = "==2.5.1"
16+
snapshottest = "==0.5.0"
17+
18+
[packages]
19+
arrow = "==0.10.0"
20+
funcy = "==1.7.3"
21+
graphql-core = "==1.1"
22+
pytz = "==2017.2"
23+
six = "==1.10.0"
24+
sqlalchemy = "==1.2.9"
25+
26+
[requires]
27+
python_version = "3.6"

0 commit comments

Comments
 (0)