Skip to content

Commit

Permalink
Rework requirements files
Browse files Browse the repository at this point in the history
* Seperate out linters (so we can run black in a custom python3.6 job)
* Hopefully make it easier to reason about changes and make using
  dependabot easier
  • Loading branch information
wlach committed Mar 27, 2020
1 parent 052fbe5 commit cc30e19
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 47 deletions.
22 changes: 15 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ matrix:
dist: trusty # newer dists seem to have some weird ssl error with python2
language: python
python: '2.7'
virtualenv:
system_site_packages: true
script:
- coverage run -m pytest tests && mv .coverage .coverage.core
- coverage combine
- pip install coveralls; coveralls
- name: python3-linux
- name: python35-linux
env: PYTHON=python3.5
os: linux
language: python
python: '3.5'
script:
- coverage run -m pytest tests && mv .coverage .coverage.core
- coverage combine
- pip install coveralls; coveralls
- name: python3-linux
env: PYTHON=python3.6
os: linux
addons:
apt:
packages:
Expand All @@ -24,20 +31,21 @@ matrix:
services:
- xvfb
language: python
python: '3.5'
python: '3.6'
script:
- pip install -r requirements-gui-dev.txt
- pip install -r requirements/all.txt
- coverage run -m pytest tests && mv .coverage .coverage.core
- coverage run gui/build.py test && mv .coverage .coverage.gui
- coverage combine
- pip install coveralls; coveralls
- python gui/build.py bundle
- name: linters
env: PYTHON=python3.5
env: PYTHON=python3.6
os: linux
language: python
python: '3.6'
script:
- pip install -r requirements/linters.txt
- ./bin/lint-check.sh

install:
Expand All @@ -55,7 +63,7 @@ install:
sudo install_name_tool -id $PWD/QtGui.so QtGui.so;
cd $MOZPATH;
fi
- pip install -r requirements-dev.txt
- pip install -r requirements/console.txt

deploy:
- provider: releases
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ With virtualenvwrapper:

```bash
mkvirtualenv -p /usr/bin/python3 mozregression
pip install -r requirements-dev.txt
pip install -r requirements/all-console.txt
```

Or with virtualenv: ::

```bash
virtualenv -p /usr/bin/python3 venv
source venv/bin/activate
pip install -r requirements-dev.txt
pip install -r requirements/all-console.txt
```

2. lint your code for errors and formatting (we use [black](https://black.readthedocs.io/en/stable/), [flake8](https://flake8.pycqa.org/en/latest/) and [isort](https://isort.readthedocs.io/en/latest/))
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ init:
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
install:
# install mozregression code and test dependencies
- "pip install -r requirements-gui-dev.txt"
- "pip install -r requirements/all-gui.txt"
test_script:
- "python setup.py test"
- "python gui\\build.py test"
Expand Down
6 changes: 3 additions & 3 deletions gui/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ a virtualenv here. See this link
about python virtualenvs. You may also consider using virtualenvwrapper
(https://virtualenvwrapper.readthedocs.org/en/latest/).

Python 3.5+ is *required* to develop or use mozregression-gui.
Python 3.6+ is *required* to develop or use mozregression-gui.

Install with virtualenvwrapper: ::

mkvirtualenv -p /usr/bin/python3 mozregression
pip install -r requirements-gui-dev.txt
pip install -r requirements/all-gui.txt

Or with virtualenv: ::

virtualenv --system-site-packages -p /usr/bin/python3 venv
source venv/bin/activate
pip install -r requirements-gui-dev.txt
pip install -r requirements/all-gui.txt

Launching the application
-------------------------
Expand Down
32 changes: 0 additions & 32 deletions requirements-dev.txt

This file was deleted.

6 changes: 6 additions & 0 deletions requirements/all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# all the things (what you usually want when doing development)
-r dev.txt
-r linters.txt
-r build.txt
-r gui.txt
-e .
17 changes: 17 additions & 0 deletions requirements/build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# pinned version of mozregression dependencies
beautifulsoup4==4.7.1
colorama==0.4.1
configobj==5.0.6
mozdevice==3.1.0
mozfile==2.1.0
mozinfo==1.2.1
mozlog==6.0
mozprofile==2.5.0
mozrunner==7.8.0
mozversion==2.3.0
redo==2.0.2
requests[security]==2.22.0
taskcluster==6.0.0

# for some reason we need to specify a specific version of six
six==1.12.0
4 changes: 4 additions & 0 deletions requirements/console.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# *just* the dependencies required for the console version of
# mozregression (compatible with older versions of python)
-r build.txt
-r dev.txt
4 changes: 4 additions & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage==4.2
mock==3.0.5 # last version compatible with python2.7
pytest==4.6.9 # last version compatible with python2.7
pytest-mock == 2.0.0
2 changes: 0 additions & 2 deletions requirements-gui-dev.txt → requirements/gui.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
-r requirements-dev.txt

# Qt bindings for python
PySide2==5.14.1

Expand Down
6 changes: 6 additions & 0 deletions requirements/linters.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# peg flake8 + deps so code doesn't suddenly violate validation expectations unexpectedly
flake8==3.7.9
flake8-black==0.1.1
isort==4.3.21
mccabe==0.6.1
pyflakes==2.1.1

0 comments on commit cc30e19

Please sign in to comment.