Skip to content

Commit

Permalink
chore: track python dependencies with pip (balena-io#1447)
Browse files Browse the repository at this point in the history
We're currently hardcoding various pip dependencies in
`appveyor-install.bat` and `travis-install.sh`.

This commit moves all the dependencies to a `requirements.txt` file in
the root of the project, and makes every install script run `pip install
-r requirements.txt`.

See: balena-io#1401 (comment)
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
  • Loading branch information
Juan Cruz Viotti authored May 18, 2017
1 parent 30ed217 commit 78f36df
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*
!requirements.txt
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Makefile text
*.svg text
*.yml text
*.patch text
*.txt text

# Binary files (no line-ending conversions)
*.bz2 binary diff=hex
Expand Down
8 changes: 6 additions & 2 deletions docs/RUNNING-LOCALLY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ Prerequisites
- [NodeJS](https://nodejs.org) (at least v6)
- [Python](https://www.python.org)
- [jq](https://stedolan.github.io/jq/)
- [Codespell](https://github.com/lucasdemarchi/codespell)
- [curl](https://curl.haxx.se/)
- [cpplint](https://github.com/cpplint/cpplint)

```sh
pip install -r requirements.txt
```

You might need to run this with `sudo` or administrator permissions.

### Windows

Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
codespell==1.9.2
cpplint==1.3.0
awscli==1.11.87
3 changes: 2 additions & 1 deletion scripts/build/docker/Dockerfile-i686
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ RUN npm config set spin=false
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1

# Python
RUN pip install codespell==1.9.2 awscli cpplint
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
3 changes: 2 additions & 1 deletion scripts/build/docker/Dockerfile-x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ RUN npm config set spin=false
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1

# Python
RUN pip install codespell==1.9.2 awscli cpplint
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
3 changes: 2 additions & 1 deletion scripts/build/docker/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ RUN npm config set spin=false
RUN npm install -g uglify-es@3.0.3 electron-installer-debian@0.5.1

# Python
RUN pip install codespell==1.9.2 awscli cpplint
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
2 changes: 1 addition & 1 deletion scripts/ci/appveyor-install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ call choco install nsis -version 2.51 || ( EXIT /B 1 )
call choco install jq || ( EXIT /B 1 )
call choco install curl || ( EXIT /B 1 )

call pip install codespell==1.9.2 awscli cpplint || ( EXIT /B 1 )
call pip install -r requirements.txt || ( EXIT /B 1 )

call make info || ( EXIT /B 1 )
call make electron-develop || ( EXIT /B 1 )
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/travis-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ else

npm config set spin=false
npm install -g uglify-es@3.0.3
pip install codespell==1.9.2 awscli cpplint
pip install -r requirements.txt
brew install afsctool jq
make info
make electron-develop
Expand Down

0 comments on commit 78f36df

Please sign in to comment.