FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
testcontainers-python/Makefile at main · adendek/testcontainers-python · GitHub
adendek
/
testcontainers-python
Public
forked from
testcontainers/testcontainers-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
testcontainers-python
/
Makefile
Copy path
More file actions
More file actions
Latest commit
History
History
History
109 lines (82 loc) · 3.42 KB
Breadcrumbs
testcontainers-python
/
Makefile
Copy path
File metadata and controls
109 lines (82 loc) · 3.42 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
.DEFAULT_GOAL
:= help
PYTHON_VERSION
?= 3.10
IMAGE
= testcontainers-python:${PYTHON_VERSION}
PACKAGES
= core
$(
addprefix
modules/,
$(
notdir
$(
wildcard
modules/
*
)
)
)
UPLOAD
=
$(
addsuffix
/upload,${PACKAGES})
TESTS
=
$(
addsuffix
/tests,
$(
filter-out
meta,${PACKAGES})
)
TESTS_DIND
=
$(
addsuffix
-dind,${TESTS})
DOCTESTS
=
$(
addsuffix
/doctests,
$(
filter-out
modules/README.md,${PACKAGES})
)
install
:
#
# Set up the project for development
poetry install --all-extras
poetry run pre-commit install
build
:
#
# Build the python package
poetry build
&&
poetry run twine check dist/
*
tests
: ${TESTS}
#
# Run tests for each package
${TESTS}
:
%
/tests:
poetry run pytest -v --cov=testcontainers.
$*
$*
/tests
coverage
:
#
# Target to combine and report coverage.
poetry run coverage combine
poetry run coverage report
poetry run coverage xml
poetry run coverage html
lint
:
#
# Lint all files in the project, which we also run in pre-commit
poetry run pre-commit run -a
mypy-core
:
#
# Run mypy on the core package
poetry run mypy --config-file pyproject.toml core
mypy-core-report
:
#
# Generate a report for mypy on the core package
poetry run mypy --config-file pyproject.toml core
|
poetry run python scripts/mypy_report.py
docs
:
#
# Build the docs for the project
poetry run sphinx-build -nW
.
docs/_build
#
Target to build docs watching for changes as per https://stackoverflow.com/a/21389615
docs-watch
:
poetry run sphinx-autobuild
.
docs/_build
#
requires 'pip install sphinx-autobuild'
doctests
: ${DOCTESTS}
#
# Run doctests found across the documentation.
poetry run sphinx-build -b doctest
.
docs/_build
${DOCTESTS}
:
%
/doctests:
#
# Run doctests found for a module.
poetry run sphinx-build -b doctest -c doctests
$*
docs/_build
clean
:
#
# Remove generated files.
rm -rf docs/_build
rm -rf build
rm -rf dist
rm -rf
*
/
*
.egg-info
clean-all
: clean
#
# Remove all generated files and reset the local virtual environment
rm -rf .venv
#
Targets that do not generate file-level artifacts.
.PHONY
: clean docs doctests image tests ${TESTS}
#
Implements this pattern for autodocumenting Makefiles:
#
https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
#
#
Picks up all comments that start with a ## and are at the end of a target definition line.
.PHONY
: help
help
:
#
# Display command usage
@grep -E
'
^[0-9a-zA-Z_-]+:.*?## .*$$
'
$(
MAKEFILE_LIST
)
|
sort
|
awk
'
BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}
'
#
# --------------------------------------
DOCS_CONTAINER
=mkdocs-container
DOCS_IMAGE
=mkdocs-poetry
DOCS_DOCKERFILE
:= Dockerfile.docs
.PHONY
: clean-docs
clean-docs
:
@echo
"
Destroying docs
"
@if docker ps -a --format
'
{{.Names}}
'
|
grep -q
'
^$(DOCS_CONTAINER)$$
'
;
then
\
docker rm -f
$(
DOCS_CONTAINER
)
;
\
fi
@if docker images -q
$(
DOCS_IMAGE
)
|
grep -q
.
;
then
\
docker rmi
$(
DOCS_IMAGE
)
;
\
fi
.PHONY
: docs-ensure-image
docs-ensure-image
:
@if [
-z
"
$$
(docker images -q
$(
DOCS_IMAGE
)
)
"
]
;
then
\
docker build -f
$(
DOCS_DOCKERFILE
)
-t
$(
DOCS_IMAGE
)
.
;
\
fi
.PHONY
: serve-docs
serve-docs
: docs-ensure-image
docker run --rm --name
$(
DOCS_CONTAINER
)
-it -p 8000:8000
\
-v
$(
PWD
)
:/testcontainers-go
\
-w /testcontainers-go
\
$(
DOCS_IMAGE
)
bash -c
"
\
cd
docs
&&
poetry install --no-root
&&
\
poetry run mkdocs serve -f ../mkdocs.yml -a 0.0.0.0:8000
"
#
Needed if dependencies are added to the docs site
.PHONY
: export-docs-deps
export-docs-deps
:
cd
docs
&&
poetry
export
--without-hashes --output requirements.txt
Back
|
FazBrowse Home
|
New Git URL