Skip to content

Commit

Permalink
Fixed flask test query-string
Browse files Browse the repository at this point in the history
Added pipenv support
  • Loading branch information
ltflb-bgdi committed Mar 8, 2024
1 parent 82c5ae1 commit 2c0063d
Show file tree
Hide file tree
Showing 5 changed files with 1,093 additions and 95 deletions.
63 changes: 32 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,34 @@ SHELL = /bin/bash


CURRENT_DIR := $(shell pwd)
VENV := $(CURRENT_DIR)/.venv
DEV_REQUIREMENTS = $(CURRENT_DIR)/dev_requirements.txt

# Test reports configuration
TEST_REPORT_DIR ?= $(CURRENT_DIR)/tests/report
TEST_REPORT_FILE ?= nose2-junit.xml

# venv targets timestamps
VENV_TIMESTAMP = $(VENV)/.timestamp
DEV_REQUIREMENTS_TIMESTAMP = $(VENV)/.dev-requirements.timestamp

# general targets timestamps
TIMESTAMPS = .timestamps
REQUIREMENTS := $(TIMESTAMPS) $(PIP_FILE) $(PIP_FILE_LOCK)

# Find all python files that are not inside a hidden directory (directory starting with .)
PYTHON_FILES := $(shell find ./* -type d \( -path ./build -o -path ./dist \) -prune -false -o -type f -name "*.py" -print)

PYTHON_VERSION ?= 3
SYSTEM_PYTHON := python$(PYTHON_VERSION)
# PIPENV files
PIP_FILE = Pipfile
PIP_FILE_LOCK = Pipfile.lock

# default configuration
ENV_FILE ?= .env.local

# Commands
PYTHON := $(VENV)/bin/python3
PIP := $(VENV)/bin/pip3
YAPF := $(VENV)/bin/yapf
ISORT := $(VENV)/bin/isort
NOSE := $(VENV)/bin/nose2
PYLINT := $(VENV)/bin/pylint
PIPENV_RUN := pipenv run
PYTHON := $(PIPENV_RUN) python3
PYTHON := $(PIPENV_RUN)
PIP := $(PIPENV_RUN) pip3
YAPF := $(PIPENV_RUN) yapf
ISORT := $(PIPENV_RUN) isort
NOSE := $(PIPENV_RUN) nose2
PYLINT := $(PIPENV_RUN) pylint

PACKAGE_VERSION = $(shell awk '/^Version:/ {print $$2}' logging_utilities.egg-info/PKG-INFO)

Expand All @@ -57,18 +58,21 @@ help:
@echo "- clean Clean genereated files"
@echo "- clean-venv Clean python venv"
@echo "- clean-all Clean everything"
@echo "- python-version Show python version"


# Build targets. Calling setup is all that is needed for the local files to be installed as needed.

.PHONY: setup
setup: $(DEV_REQUIREMENTS_TIMESTAMP)
setup: $(REQUIREMENTS)
pipenv install --dev
pipenv shell


# linting target, calls upon yapf to make sure your code is easier to read and respects some conventions.

.PHONY: format
format: $(DEV_REQUIREMENTS_TIMESTAMP)
format: $(REQUIREMENTS)
$(YAPF) -p -i --style .style.yapf $(PYTHON_FILES)
$(ISORT) $(PYTHON_FILES)

Expand All @@ -83,7 +87,7 @@ ci-check-format: format


.PHONY: lint
lint: $(DEV_REQUIREMENTS_TIMESTAMP)
lint: $(REQUIREMENTS)
$(PYLINT) $(PYTHON_FILES)


Expand All @@ -103,38 +107,35 @@ test: $(DEV_REQUIREMENTS_TIMESTAMP)

.PHONY: package
package: $(DEV_REQUIREMENTS_TIMESTAMP)
$(PYTHON) -m build
$(PYTHON) python -m build


.PHONY: publish
publish: clean-all publish-check setup package
publish: clean-all publish-check package
@echo "Upload package version=$(PACKAGE_VERSION)"
$(PYTHON) -m twine upload dist/*
$(PYTHON) python -m twine upload dist/*


# Clean targets

.PHONY: clean-venv
clean-venv:
if [ -e $(VENV)/bin/deactivate ]; then $(VENV)/deactivate; fi
rm -rf $(VENV)

pipenv --rm

.PHONY: clean
clean:
clean: clean-venv
@# clean python cache files
find . -name __pycache__ -type d -print0 | xargs -I {} -0 rm -rf "{}"
rm -rf $(PYTHON_LOCAL_DIR)
rm -rf $(TEST_REPORT_DIR)
rm -rf $(TIMESTAMPS)
rm -rf dist
rm -rf build
rm -rf *.egg-info
rm -f .coverage


.PHONY: clean-all
clean-all: clean clean-venv
clean-all: clean

.PHONY: python-version
python-version:
$(PYTHON) python --version



# Actual builds targets with dependencies
Expand Down
74 changes: 74 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
asgiref = "==3.6.0"
astroid = "==2.13.2"
bleach = "==5.0.1"
build = "==0.8.0"
certifi = "==2022.12.7"
cffi = "==1.15.1"
charset-normalizer = "==3.0.1"
click = "==8.1.3"
coverage = "==7.0.5"
cryptography = "==39.0.1"
deprecated = "==1.2.13"
dill = "==0.3.6"
django = "==3.2.18"
docutils = "==0.19"
escape = "==1.1"
flask = "==2.3.2"
idna = "==3.4"
importlib-metadata = "==6.0.0"
importlib-resources = "==5.10.2"
isort = "==5.11.4"
itsdangerous = "==2.1.2"
"jaraco.classes" = "==3.2.3"
jeepney = "==0.8.0"
jinja2 = "==3.1.2"
keyring = "==23.13.1"
lazy-object-proxy = "==1.9.0"
markdown-it-py = "==2.2.0"
markupsafe = "==2.1.2"
mccabe = "==0.7.0"
mdurl = "==0.1.2"
more-itertools = "==9.0.0"
nose2 = "==0.12.0"
packaging = "==23.0"
pep517 = "==0.13.0"
pkginfo = "==1.9.6"
platformdirs = "==2.6.2"
pycparser = "==2.21"
pygments = "==2.14.0"
pylint = "==2.15.4"
pytoolconfig = "==1.2.4"
pytz = "==2022.7.1"
readme-renderer = "==37.3"
requests = "==2.28.2"
requests-toolbelt = "==0.10.1"
rfc3986 = "==2.0.0"
rich = "==13.2.0"
rope = "==1.3.0"
secretstorage = "==3.3.3"
setuptools-git-versioning = "==1.12.0"
six = "==1.16.0"
sqlparse = "==0.4.4"
toml = "==0.10.2"
tomli = "==2.0.1"
tomlkit = "==0.11.6"
twine = "==4.0.1"
typed-ast = "==1.5.4"
typing-extensions = "==4.4.0"
urllib3 = "==1.26.14"
webencodings = "==0.5.1"
werkzeug = "==2.3.3"
wrapt = "==1.14.1"
yapf = "==0.32.0"
zipp = "==3.11.0"

[dev-packages]

[requires]

Loading

0 comments on commit 2c0063d

Please sign in to comment.