Skip to content

Develop #719

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

Merged
merged 2 commits into from
Jun 8, 2025
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
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ COPY ./.markdownlint.yaml ${WORKDIR}/
COPY ./.yamllint ${WORKDIR}/
COPY ./.yamlignore ${WORKDIR}/

# JSON linting conf
COPY ./.prettierrc.yaml ${WORKDIR}/

CMD ["make", "lint"]

###############################################################################
Expand Down
78 changes: 42 additions & 36 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,44 @@ env:

install: dependencies

## Dependency management
dependencies:
@echo "################################################################################"
@echo "## Dependencies: ###############################################################"
@echo "################################################################################"
${PACKAGE_TOOL} install -r requirements.txt
@echo "################################################################################"

outdated:
${PACKAGE_TOOL} list --outdated

update:
${PACKAGE_TOOL} freeze > requirements.txt

upgrade:
${PACKAGE_TOOL} list --outdated | cut -f1 -d' ' | tr " " "\n" | awk '{if(NR>=3)print}' | cut -d' ' -f1 | xargs -n1 pip3 install -U

clean:
${PACKAGE_TOOL} freeze > unins ; ${PACKAGE_TOOL} uninstall -y -r unins ; rm unins
rm -f .coverage
rm -fr .pytest_cache
rm -fr htmlcov
rm -fr coverage
rm -fr build
find . -path "*/*.pyc" -delete -print || true
find . -path "*/*.pyo" -delete -print || true
find . -path "*/__pycache__" -type d -print -exec rm -fr {} ';' || true

## Building process
build: env
rsync -av --prune-empty-dirs \
--exclude '*_test.py' \
--exclude '*.pyc' \
--exclude '.venv' \
--exclude '__pycache__' \
src/ build/

## Source code linting and formatting
lint/json:
prettier --check ./src/**/*.json

Expand All @@ -78,15 +109,6 @@ lint/yaml:

lint: lint/markdown lint/yaml lint/json test/styling test/static

test/static: dependencies
${RUNTIME_TOOL} -m pylint --verbose --recursive yes src/
${RUNTIME_TOOL} -m flake8 --verbose src/
${RUNTIME_TOOL} -m pyright --verbose src/

test/styling: dependencies
${RUNTIME_TOOL} -m pycodestyle --statistics src/
${RUNTIME_TOOL} -m autopep8 --diff --recursive --exit-code --verbose .

format/json:
prettier --write ./src/**/*.json

Expand All @@ -95,14 +117,17 @@ format/sources:

format: format/sources format/json

build: env
rsync -av --prune-empty-dirs \
--exclude '*_test.py' \
--exclude '*.pyc' \
--exclude '.venv' \
--exclude '__pycache__' \
src/ build/
## Static code analysis
test/static: dependencies
${RUNTIME_TOOL} -m pylint --verbose --recursive yes src/
${RUNTIME_TOOL} -m flake8 --verbose src/
${RUNTIME_TOOL} -m pyright --verbose src/

test/styling: dependencies
${RUNTIME_TOOL} -m pycodestyle --statistics src/
${RUNTIME_TOOL} -m autopep8 --diff --recursive --exit-code --verbose .

## Unit tests and coverage
test: env dependencies
${RUNTIME_TOOL} -m coverage run -m \
pytest --verbose \
Expand All @@ -118,26 +143,7 @@ coverage/html: test
${RUNTIME_TOOL} -m coverage html
open htmlcov/index.html

outdated:
${PACKAGE_TOOL} list --outdated

update:
${PACKAGE_TOOL} freeze > requirements.txt

upgrade:
${PACKAGE_TOOL} list --outdated | cut -f1 -d' ' | tr " " "\n" | awk '{if(NR>=3)print}' | cut -d' ' -f1 | xargs -n1 pip3 install -U

clean:
${PACKAGE_TOOL} freeze > unins ; ${PACKAGE_TOOL} uninstall -y -r unins ; rm unins
rm -f .coverage
rm -fr .pytest_cache
rm -fr htmlcov
rm -fr coverage
rm -fr build
find . -path "*/*.pyc" -delete -print || true
find . -path "*/*.pyo" -delete -print || true
find . -path "*/__pycache__" -type d -print -exec rm -fr {} ';' || true

## Docker Compose commands
compose/build: env
${DOCKER_COMPOSE} --profile lint build
${DOCKER_COMPOSE} --profile testing build
Expand Down