Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: remove check2 and references to python2 #196

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ci
on: [pull_request, workflow_dispatch]
jobs:
check3:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -13,7 +13,7 @@ jobs:
# -common seems a catch-22, but this is just a shortcut to
# initialize user and dirs, some used through tests.
sudo apt-get -y install landscape-common
- run: make check3 TRIAL=/usr/bin/trial3
- run: make check TRIAL=/usr/bin/trial3
lint:
runs-on: ubuntu-latest
steps:
Expand Down
53 changes: 15 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PYDOCTOR ?= pydoctor
TXT2MAN ?= txt2man
PYTHON2 ?= python2
PYTHON3 ?= python3
PYTHON ?= python3
SNAPCRAFT = SNAPCRAFT_BUILD_INFO=1 snapcraft
TRIAL ?= -m twisted.trial
TRIAL_ARGS ?=
PRE_COMMIT ?= $(HOME)/.local/bin/pre-commit

# PEP8 rules ignored:
# W503 https://www.flake8rules.com/rules/W503.html
Expand All @@ -16,57 +16,34 @@ help: ## Print help about available targets
@grep -h -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

.PHONY: depends
depends: depends3 ## py2 is deprecated
sudo apt-get -y install python3-flake8 python3-coverage

.PHONY: depends2
depends2:
sudo apt-get -y install python-twisted-core python-distutils-extra python-mock python-configobj python-netifaces python-pycurl python-pip
depends:
sudo apt-get -y install python3-configobj python3-coverage python3-distutils-extra\
python3-flake8 python3-mock python3-netifaces python3-pip python3-pycurl python3-twisted
pip install pre-commit
pre-commit install

.PHONY: depends3
depends3:
sudo apt-get -y install python3-twisted python3-distutils-extra python3-mock python3-configobj python3-netifaces python3-pycurl python3-pip
pip3 install pre-commit
pre-commit install
$(PRE_COMMIT) install

all: build

.PHONY: build
build: build2 build3 ## Build.

.PHONY: build2
build2:
$(PYTHON2) setup.py build_ext -i

.PHONY: build3
build3:
$(PYTHON3) setup.py build_ext -i

.PHONY: check
check: check2 check3 ## Run all the tests.

.PHONY: check2
check2: build2
PYTHONPATH=$(PYTHONPATH):$(CURDIR) LC_ALL=C $(PYTHON2) $(TRIAL) --unclean-warnings $(TRIAL_ARGS) landscape
build:
$(PYTHON) setup.py build_ext -i

# trial3 does not support threading via `-j` at the moment
# so we ignore TRIAL_ARGS.
# TODO: Respect $TRIAL_ARGS once trial3 is fixed.
.PHONY: check3
check3: TRIAL_ARGS=
check3: build3
PYTHONPATH=$(PYTHONPATH):$(CURDIR) LC_ALL=C $(PYTHON3) $(TRIAL) --unclean-warnings $(TRIAL_ARGS) landscape
.PHONY: check
check: TRIAL_ARGS=
check: build
PYTHONPATH=$(PYTHONPATH):$(CURDIR) LC_ALL=C $(PYTHON) $(TRIAL) --unclean-warnings $(TRIAL_ARGS) landscape

.PHONY: coverage
coverage:
PYTHONPATH=$(PYTHONPATH):$(CURDIR) LC_ALL=C $(PYTHON3) -m coverage run $(TRIAL) --unclean-warnings landscape
PYTHONPATH=$(PYTHONPATH):$(CURDIR) LC_ALL=C $(PYTHON3) -m coverage xml
PYTHONPATH=$(PYTHONPATH):$(CURDIR) LC_ALL=C $(PYTHON) -m coverage run $(TRIAL) --unclean-warnings landscape
PYTHONPATH=$(PYTHONPATH):$(CURDIR) LC_ALL=C $(PYTHON) -m coverage xml

.PHONY: lint
lint:
$(PYTHON3) -m flake8 --ignore $(PEP8_IGNORED) `find landscape -name \*.py`
$(PYTHON) -m flake8 --ignore $(PEP8_IGNORED) `find landscape -name \*.py`

.PHONY: pyflakes
pyflakes:
Expand Down
Loading