← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/turnip:lpci-pre-commit into turnip:master

 

Colin Watson has proposed merging ~cjwatson/turnip:lpci-pre-commit into turnip:master.

Commit message:
Add pre-commit checks via lpci

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/turnip/+git/turnip/+merge/453433

Rather than having two different linters that might potentially disagree, I removed the older one that was done via `flake8` in turnip's own virtual environment rather than via `pre-commit`.  I updated `requirements.txt` with the aid of `pip freeze` - this found a few missing entries as well as the ones I was able to remove.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/turnip:lpci-pre-commit into turnip:master.
diff --git a/.launchpad.yaml b/.launchpad.yaml
new file mode 100644
index 0000000..d099949
--- /dev/null
+++ b/.launchpad.yaml
@@ -0,0 +1,21 @@
+pipeline:
+  - docs
+  - lint
+
+jobs:
+  docs:
+    architectures: amd64
+    packages:
+      - tox
+    run: tox -e docs
+    series: focal
+  lint:
+    architectures: amd64
+    packages:
+      - tox
+      - git
+    snaps:
+      - name: go
+        classic: true
+    run: tox -e lint
+    series: focal
diff --git a/Makefile b/Makefile
index 06ee204..1f350bd 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,6 @@ PIP_CACHE = $(CURDIR)/pip-cache
 
 PYTHON := $(ENV)/bin/python
 PSERVE := $(ENV)/bin/pserve
-FLAKE8 := $(ENV)/bin/flake8
 CELERY := $(ENV)/bin/celery
 PIP := $(ENV)/bin/pip
 VIRTUALENV := /usr/bin/virtualenv
@@ -103,14 +102,10 @@ TAGS:
 tags:
 	ctags -R turnip
 
-lint: $(ENV)
-	@$(FLAKE8) --exclude=__pycache__,version_info.py *.tac turnip
-	$(PYTHON) setup.py check --restructuredtext --strict
-
 pip-check: $(ENV)
 	$(PIP) check
 
-check: pip-check test lint
+check: pip-check test
 
 run-api: $(ENV)
 	$(PSERVE) api.ini --reload
@@ -175,5 +170,5 @@ publish-tarball: build-tarball
 		$(SWIFT_CONTAINER_NAME) $(SWIFT_OBJECT_PATH) \
 		$(TARBALL_BUILD_PATH) turnip=$(TARBALL_BUILD_LABEL)
 
-.PHONY: build check clean dist lint run-api run-pack test
+.PHONY: build check clean dist run-api run-pack test
 .PHONY: build-tarball publish-tarball
diff --git a/requirements.txt b/requirements.txt
index c9bc202..7043dd9 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,5 @@
 amqp==2.6.0
 appdirs==1.4.3
-asn1crypto==1.3.0
 attrs==19.3.0
 Automat==20.2.0
 bcrypt==3.1.7
@@ -8,7 +7,6 @@ beautifulsoup4==4.6.3
 billiard==3.6.3.0
 celery==4.4.6
 cffi==1.14.1
-configparser==4.0.2
 constantly==15.1.0
 contextlib2==0.6.0.post1
 cornice==3.6.1
@@ -17,45 +15,34 @@ docutils==0.14
 envdir==0.7
 extras==1.0.0
 fixtures==3.0.0
-flake8==3.9.2
 future==0.18.2
 gevent==20.6.2
-gmpy==1.17
 greenlet==0.4.16
 gunicorn==20.1.0
+hupper==1.10.2
 hyperlink==19.0.0
 idna==2.9
-importlib_metadata==1.7.0
 incremental==17.5.0
-ipaddress==1.0.23
 kombu==4.6.11
 lazr.sshserver==0.1.13
 linecache2==1.0.0
 lxml==4.5.2
-m2r==0.1.14
-# lp:~launchpad/mccabe:launchpad
-# lp1 Remove use of deprecated 'setup.py test'.
-mccabe==0.6.1+lp1
-mistune==0.8.3
-pathlib2==2.3.5
 Paste==3.5.0
 PasteDeploy==2.1.0
 pbr==5.4.5
+plaster==1.0
+plaster-pastedeploy==0.7
 psutil==5.7.0
 pyasn1==0.4.8
-pycodestyle==2.7.0
 pycparser==2.17
-pycrypto==2.6.1
-pyflakes==2.3.1
 pygit2==1.0.3
+PyHamcrest==1.10.1
 PyNaCl==1.3.0
 pyramid==1.10.4
 python-mimeparse==1.6.0
 python-openid2==3.2
 pytz==2020.1
 PyYAML==5.3
-repoze.lru==0.6
-scandir==1.10.0
 setuptools-scm==1.17.0
 simplejson==3.6.5
 six==1.15.0
@@ -68,12 +55,11 @@ translationstring==1.3
 # https://code.launchpad.net/~launchpad/twisted/+git/twisted/+ref/lp-backport.
 Twisted[conch_nacl]==20.3.0+lp9
 unittest2==1.1.0
-vine==1.3.0
 venusian==2.1.0
+vine==1.3.0
 waitress==0.8.9
 WebOb==1.8.6
 WebTest==2.0.35
-zipp==1.2.0
 zope.component==4.2.1
 zope.deprecation==4.4.0
 zope.event==4.4
diff --git a/setup.py b/setup.py
index a3e086f..6e4e70f 100755
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,6 @@ requires = [
 test_requires = [
     "docutils",
     "fixtures",
-    "flake8",
     "testscenarios",
     "testtools",
     "webtest",
diff --git a/tox.ini b/tox.ini
index 210d480..cb85b17 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,18 @@
 [tox]
-env_list = docs
+env_list =
+    lint
+    docs
+
+[testenv:lint]
+skip_install = true
+deps = pre-commit
+commands = pre-commit run --all-files --show-diff-on-failure
+# adding http(s)_proxy is a workaround for
+# https://github.com/tox-dev/tox/pull/2378/files
+passenv =
+    HOME
+    http_proxy
+    https_proxy
 
 [testenv:docs]
 description = Build documentation via Sphinx.