Closed charlieparkes closed 4 years ago
Note: If you must develop in Python 2, install the libs via your project's dev-dependencies
, you can write a target that offloads some complexity to the build-harness.
lint: pipenv reports/
@$(MAKE) python/lint/announce/isort
@$(PIPENV_RUN) isort $(ISORT_FLAGS) --check-only $(PYTHON_LINT_TARGETS) --diff
@$(MAKE) python/lint/announce/flake8
@$(PIPENV_RUN) flake8 $(FLAKE8_FLAGS) $(PYTHON_LINT_TARGETS)
.PHONY: lint
In this example, build-harness
provides:
pipenv
, reports/
, and python/lint/announce/...
PIPENV_RUN
, PYTHON_LINT_TARGETS
, ISORT_FLAGS
, and FLAKE8_FLAGS
You could simplify this even more, but this is an example replicating the exact functionality build-harness provides for isort and flake8. Check the source for other examples you may draw inspiration from if you decide to write a custom target.
@chavlin I'd prefer not to add it to the readme, as it's not "officially supported" by the project. In the unlikely event someone brings this up, refer them to this PR. (it is the github way)
We just discovered that this breaks our jenkins builds. It's almost like running all builds on the same python 2 binary is a bad idea. 🙄 Will need to find a workaround for CI systems that don't run builds on the project's desired version of python.
Ok, updated to work in python 2 build environments.
python_requires
in .build-harness.Pipfile