This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM python:3.7.2-alpine | |
| RUN pip install --upgrade pip | |
| RUN adduser -D worker | |
| USER worker | |
| WORKDIR /home/worker | |
| RUN pip install --user pipenv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM python:3.7.2-alpine | |
| RUN pip install --upgrade pip | |
| RUN adduser -D worker | |
| USER worker | |
| WORKDIR /home/worker | |
| COPY --chown=worker:worker requirements.txt requirements.txt | |
| RUN pip install --user -r requirements.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import click | |
| from tool import __version__ | |
| from tool.custom_decorators import add_version | |
| @click.group() | |
| @click.version_option( | |
| __version__, "-V", "--version", message="%(prog)s, version %(version)s" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| A module including custom decorators. | |
| """ | |
| from . import __version__ | |
| def add_version(f): | |
| """ | |
| Add the version of the tool to the help heading. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import click | |
| from tool import __version__ | |
| @click.group() | |
| @click.version_option( | |
| __version__, "-V", "--version", message="%(prog)s, version %(version)s" | |
| ) | |
| @click.pass_context |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Tool. | |
| Example tool. | |
| """ | |
| __version__ = "1.2.3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import dis | |
| def f_string(number: int): | |
| return f"{number}" | |
| def str_string(number: int): | |
| return str(number) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from boxx import timeit | |
| with timeit(name="f-strings"): | |
| for i in range(500_000): | |
| x = 6 | |
| f"{x}" | |
| with timeit(name="str"): | |
| for i in range(500_000): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Some more code above | |
| val = 6 | |
| value = f"{val}" | |
| # some more code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
| -D CMAKE_INSTALL_PREFIX=/usr/local \ | |
| -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ | |
| -D PYTHON3_LIBRARY=/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6m/config-3.6m-darwin/libpython3.6.dylib \ | |
| -D PYTHON3_INCLUDE_DIR=/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/include/python3.6m/ \ | |
| -D PYTHON3_EXECUTABLE=$VIRTUAL_ENV/bin/python \ | |
| -D BUILD_opencv_python2=OFF \ | |
| -D BUILD_opencv_python3=ON \ | |
| -D INSTALL_PYTHON_EXAMPLES=ON \ | |
| -D INSTALL_C_EXAMPLES=OFF \ |