"test"
This file contains 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 time | |
import pytest | |
@pytest.hookimpl(hookwrapper=True) | |
def pytest_fixture_setup(fixturedef, request): | |
start = time.time() | |
yield | |
total = time.time() - start |
These are abbreviated notes taken from Martin Fowler's Refactoring.
(This is an atomic refactoring.)
(This is an atomic refactoring.)
- Copy the function and rename as query
- Remove side effects from query
- Replace each call using return value with call to query plus call to modifier
This is now on PyPI and GitHub:
A lazy sequence makes an iterator look like an immutable sequence:
This file contains 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
repos: | |
- repo: https://github.com/prettier/prettier | |
rev: 2.0.4 | |
hooks: | |
- id: prettier |
This file contains 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.9.0a4 | |
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python | |
ENV PATH /root/.poetry/bin:$PATH | |
ENTRYPOINT ["poetry"] |
This file contains 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.6-alpine3.11 as base | |
ENV PYTHONFAULTHANDLER=1 \ | |
PYTHONHASHSEED=random \ | |
PYTHONUNBUFFERED=1 | |
WORKDIR /app | |
FROM base as builder |
This file contains 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.8.1 | |
RUN pip install virtualenv==20.0.2 | |
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python | |
ENV PATH "/root/.poetry/bin:$PATH" | |
RUN virtualenv /venv | |
ENV VIRTUAL_ENV /venv | |
ENV PATH "/venv/bin:$PATH" | |
RUN poetry new foobar | |
WORKDIR foobar | |
CMD ["poetry", "install", "-vvv"] |
This file contains 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
# Install XQuartz | |
wget http://xquartz.macosforge.org/downloads/SL/XQuartz-2.7.5.dmg | |
mkdir /Volumes/XQuartz-2.7.5 | |
hdiutil attach -mountpoint /Volumes/XQuartz-2.7.5 XQuartz-2.7.5.dmg | |
sudo installer -pkg /Volumes/XQuartz-2.7.5/*.pkg -target / | |
hdiutil detach -mountpoint /Volumes/XQuartz-2.7.5 XQuartz-2.7.5.dmg | |
rmdir /Volumes/XQuartz-2.7.5 | |
rm XQuartz-2.7.5.dmg | |
# Install GTK. |