Hana 9e216da9ef go.mod: add go.mod and move pygments to third_party
After go1.16, go will use module mode by default,
even when the repository is checked out under GOPATH
or in a one-off directory. Add go.mod, go.sum to keep
this repo buildable without opting out of the module
mode.

> go mod init github.com/mmcgrana/gobyexample
> go mod tidy
> go mod vendor

In module mode, the 'vendor' directory is special
and its contents will be actively maintained by the
go command. pygments aren't the dependency the go will
know about, so it will delete the contents from vendor
directory. Move it to `third_party` directory now.

And, vendor the blackfriday package.

Note: the tutorial contents are not affected by the
change in go1.16 because all the examples in this
tutorial ask users to run the go command with the
explicit list of files to be compiled (e.g.
`go run hello-world.go` or `go build command-line-arguments.go`).
When the source list is provided, the go command does
not have to compute the build list and whether it's
running in GOPATH mode or module mode becomes irrelevant.
2021-02-15 16:45:26 -05:00

63 lines
1.6 KiB
Makefile

#
# Makefile for Pygments
# ~~~~~~~~~~~~~~~~~~~~~
#
# Combines scripts for common tasks.
#
# :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
# :license: BSD, see LICENSE for details.
#
PYTHON ?= python
export PYTHONPATH = $(shell echo "$$PYTHONPATH"):$(shell python -c 'import os; print ":".join(os.path.abspath(line.strip()) for line in file("PYTHONPATH"))' 2>/dev/null)
.PHONY: all check clean clean-pyc codetags docs mapfiles \
pylint reindent test test-coverage
all: clean-pyc check test
check:
@$(PYTHON) scripts/detect_missing_analyse_text.py || true
@pyflakes pygments | grep -v 'but unused' || true
@$(PYTHON) scripts/check_sources.py -i build -i dist -i pygments/lexers/_mapping.py \
-i docs/build -i pygments/formatters/_mapping.py -i pygments/unistring.py
clean: clean-pyc
-rm -rf build
-rm -f codetags.html
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
codetags:
@$(PYTHON) scripts/find_codetags.py -i tests/examplefiles -i scripts/pylintrc \
-i scripts/find_codetags.py -o codetags.html .
docs:
make -C doc html
mapfiles:
(cd pygments/formatters; $(PYTHON) _mapping.py)
(cd pygments/lexers; $(PYTHON) _mapping.py)
pylint:
@pylint --rcfile scripts/pylintrc pygments
reindent:
@$(PYTHON) scripts/reindent.py -r -B .
test:
@$(PYTHON) tests/run.py -d $(TEST)
test-coverage:
@$(PYTHON) tests/run.py -d --with-coverage --cover-package=pygments --cover-erase $(TEST)
tox-test:
@tox -- $(TEST)
tox-test-coverage:
@tox -- --with-coverage --cover-package=pygments --cover-erase $(TEST)