2023-06-09 09:27:19 -05:00
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install: ## Install the dependencies
|
|
|
|
python3 -m pip install --upgrade pip
|
|
|
|
python3 -m pip install -e .
|
|
|
|
|
|
|
|
.PHONY: develop
|
|
|
|
develop: ## Install the test and dev dependencies
|
|
|
|
python3 -m pip install -e .[test,dev]
|
|
|
|
|
2023-06-20 08:40:32 -05:00
|
|
|
.PHONY: pretty-templates
|
|
|
|
pretty-templates: ## Prettify template files
|
|
|
|
djlint umap/templates --reformat
|
|
|
|
|
2023-06-20 09:00:02 -05:00
|
|
|
.PHONY: lint-templates
|
|
|
|
lint-templates: ## Lint template files
|
|
|
|
djlint umap/templates --lint
|
|
|
|
|
2023-06-09 09:27:19 -05:00
|
|
|
.PHONY: version
|
|
|
|
version: ## Display the current version
|
|
|
|
@hatch version
|
|
|
|
|
|
|
|
.PHONY: bump
|
|
|
|
bump: ## Bump the current version to a new minor one
|
|
|
|
@hatch version fix
|
|
|
|
|
|
|
|
.PHONY: docker
|
|
|
|
docker: ## Create a new Docker image and publish it
|
|
|
|
$(eval VERSION=$(shell hatch version))
|
|
|
|
@echo "Version to build: ${VERSION}"
|
|
|
|
docker build -t umap/umap:${VERSION} .
|
|
|
|
docker push umap/umap:${VERSION}
|
|
|
|
|
2023-06-17 08:36:50 -05:00
|
|
|
.PHONY: build
|
|
|
|
build: test compilemessages ## Build the Python package before release
|
|
|
|
@hatch build
|
|
|
|
|
2023-06-17 08:50:36 -05:00
|
|
|
.PHONY: publish
|
|
|
|
publish: ## Publish the Python package to Pypi
|
|
|
|
@hatch publish
|
|
|
|
make clean
|
|
|
|
|
2023-06-09 09:27:19 -05:00
|
|
|
|
2016-08-20 05:32:23 -05:00
|
|
|
test:
|
2018-06-02 08:43:22 -05:00
|
|
|
py.test -xv umap/tests/
|
2018-06-02 09:17:42 -05:00
|
|
|
clean:
|
|
|
|
rm -f dist/*
|
|
|
|
rm -rf build/*
|
2018-05-19 04:12:19 -05:00
|
|
|
compilemessages:
|
2018-09-08 10:01:22 -05:00
|
|
|
umap compilemessages
|
2018-07-07 16:03:10 -05:00
|
|
|
umap generate_js_locale
|
2018-09-08 10:01:22 -05:00
|
|
|
messages:
|
2023-05-30 10:36:59 -05:00
|
|
|
cd umap && umap makemessages -l en
|
2018-07-07 16:03:10 -05:00
|
|
|
node node_modules/leaflet-i18n/bin/i18n.js --dir_path=umap/static/umap/js/ --dir_path=umap/static/umap/vendors/measurable/ --locale_dir_path=umap/static/umap/locale/ --locale_codes=en --mode=json --clean --default_values
|
2018-07-07 16:15:26 -05:00
|
|
|
vendors:
|
2023-06-05 06:19:14 -05:00
|
|
|
npm run vendors
|
2018-06-02 07:44:59 -05:00
|
|
|
installjs:
|
|
|
|
npm install
|
|
|
|
testjsfx:
|
|
|
|
firefox umap/static/umap/test/index.html
|
|
|
|
testjs: node_modules
|
|
|
|
@./node_modules/mocha-phantomjs/bin/mocha-phantomjs --view 1024x768 umap/static/umap/test/index.html
|
2018-06-02 09:17:42 -05:00
|
|
|
tx_push:
|
|
|
|
tx push -s
|
|
|
|
tx_pull:
|
|
|
|
tx pull
|
2023-05-12 12:57:03 -05:00
|
|
|
|
|
|
|
jsdir = umap/static/umap/js/
|
|
|
|
filepath = "${jsdir}*.js"
|
2023-06-09 09:27:19 -05:00
|
|
|
.PHONY: pretty
|
2023-05-12 12:57:03 -05:00
|
|
|
pretty: ## Apply PrettierJS to all JS files (or specified `filepath`)
|
|
|
|
./node_modules/prettier/bin-prettier.js --write ${filepath}
|
|
|
|
|
2023-06-09 09:27:19 -05:00
|
|
|
.PHONY: lebab
|
2023-05-12 13:04:59 -05:00
|
|
|
lebab: ## Convert JS `filepath` to modern syntax with Lebab, then prettify
|
|
|
|
./node_modules/lebab/bin/index.js --replace ${filepath} --transform arrow,arrow-return
|
2023-05-22 09:13:45 -05:00
|
|
|
./node_modules/lebab/bin/index.js --replace ${filepath} --transform let
|
2023-05-30 13:53:53 -05:00
|
|
|
./node_modules/lebab/bin/index.js --replace ${filepath} --transform template
|
2023-05-12 13:04:59 -05:00
|
|
|
$(MAKE) pretty filepath=${filepath}
|
|
|
|
|
2023-06-09 09:27:19 -05:00
|
|
|
.PHONY: lebab-all
|
2023-05-12 13:04:59 -05:00
|
|
|
lebab-all: $(jsdir)* ## Convert all JS files to modern syntax with Lebab + prettify
|
|
|
|
for file in $^ ; do $(MAKE) lebab filepath=$${file}; done
|
2023-06-09 09:27:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: help
|
|
|
|
help:
|
|
|
|
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
|
|
|
|
|
|
|
|
# See https://daniel.feldroy.com/posts/autodocumenting-makefiles
|
|
|
|
define PRINT_HELP_PYSCRIPT # start of Python section
|
|
|
|
import re, sys
|
|
|
|
|
|
|
|
output = []
|
|
|
|
# Loop through the lines in this file
|
|
|
|
for line in sys.stdin:
|
|
|
|
# if the line has a command and a comment start with
|
|
|
|
# two pound signs, add it to the output
|
|
|
|
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
|
|
|
|
if match:
|
|
|
|
target, help = match.groups()
|
|
|
|
output.append("\033[36m%-20s\033[0m %s" % (target, help))
|
|
|
|
# Sort the output in alphanumeric order
|
|
|
|
output.sort()
|
|
|
|
# Print the help result
|
|
|
|
print('\n'.join(output))
|
|
|
|
endef
|
|
|
|
export PRINT_HELP_PYSCRIPT # End of python section
|