diff --git a/.env.template b/.env.template deleted file mode 100644 index 976e977..0000000 --- a/.env.template +++ /dev/null @@ -1,9 +0,0 @@ -# Security Warning! Do not commit this file to any VCS! -# This is a local file to speed up development process, -# so you don't have to change your environment variables. -# -# This is not applied to `.env.template`! -# Template files must be committed to the VCS, but must not contain -# any secret values. - -ENVIRONMENT=development diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 1c6ed3a..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,63 +0,0 @@ -# How to contribute - - -## Dependencies - -We use [poetry](https://github.com/python-poetry/poetry) to manage the dependencies. - -To install them you would need to run `install` command: - -```bash -poetry install -``` - -To activate your `virtualenv` run `poetry shell`. - - -## One magic command - -Run `make checks` to run everything we have! - - -## Tests - -We use `pytest` and `flake8` for quality control. - -To run all tests: - -```bash -make test -``` - -To run linting: - -```bash -make lint -``` -Keep in mind: default virtual environment folder excluded by flake8 style checking is `.venv`. -If you want to customize this parameter, you should do this in `pyproject.toml`. - - -## Type checks - -We use `mypy` to run type checks on our code. -To use it: - -```bash -make mypy -``` - - -## Submitting your code - -What are the point of this method? - -1. We use protected `main` branch, - so the only way to push your code is via pull request -2. We use issue branches: to implement a new feature or to fix a bug - create a new branch -3. Then create a pull request to `main` branch -4. We use `git tag`s to make releases, so we can track what has changed - since the latest release - -In this method, the latest version of the app is always in the `main` branch. diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index cb2e844..0000000 --- a/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM python:3.11-slim-bullseye as builder - -ARG WHEEL=picodi-0.2.0-py3-none-any.whl -ENV VENV=/venv -ENV PATH="$VENV/bin:$PATH" - -WORKDIR /code - -RUN python -m venv $VENV - -# for caching purposes in CI -# waiting for https://github.com/moby/buildkit/issues/1512 -# to replace with this: -#COPY ./dist/$WHEEL ./$WHEEL -#RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ -# pip install --upgrade pip \ -# && pip install --upgrade wheel \ -# && pip install --upgrade ./$WHEEL -COPY ./dist/requirements.txt ./ -RUN pip install --upgrade --no-cache-dir pip \ - && pip install --upgrade --no-cache-dir wheel \ - && pip install --upgrade --no-cache-dir -r requirements.txt - -COPY ./dist/$WHEEL ./$WHEEL -RUN pip install --upgrade --no-cache-dir ./$WHEEL --no-deps - - -FROM python:3.11-slim-bullseye as production - -RUN useradd -M appuser --uid=1000 --shell=/bin/false -USER appuser - -ENV PATH="/venv/bin:$PATH" -WORKDIR /opt/app -COPY --from=builder /venv /venv - -CMD ["python"] diff --git a/Dockerfile-dev b/Dockerfile-dev deleted file mode 100644 index cdfcc72..0000000 --- a/Dockerfile-dev +++ /dev/null @@ -1,68 +0,0 @@ -# https://github.com/python-poetry/poetry/discussions/1879#discussioncomment-216865 -# `python-base` sets up all our shared environment variables -ARG PYTHON_VERSION=3.11 -FROM python:${PYTHON_VERSION}-slim-bullseye as python-base - -ENV PYTHONUNBUFFERED=1 \ - PYTHONDEVMODE=1 \ - PIP_NO_CACHE_DIR=off \ - PIP_DISABLE_PIP_VERSION_CHECK=on \ - PIP_DEFAULT_TIMEOUT=100 \ - POETRY_VERSION=1.5.1 \ - VENV_PATH="/opt/venv" \ - POETRY_VIRTUALENVS_IN_PROJECT=true \ - POETRY_NO_INTERACTION=1 \ - CODE_PATH="/opt/code" - -ENV XDG_CACHE_HOME="$CODE_PATH/.cache" \ - XDG_CONFIG_HOME="/tmp/.config" - - -ENV PATH="$VENV_PATH/bin:$CODE_PATH/.venv/bin:$PATH" -ARG USER_ID=1000 -ARG GROUP_ID=1000 -ARG USER_NAME=app - -RUN addgroup --gid $GROUP_ID --system $USER_NAME \ - && adduser --uid $USER_ID --system --no-create-home --shell=/bin/false --disabled-password --group $USER_NAME \ - && mkdir $CODE_PATH \ - && chown -R $USER_ID:$GROUP_ID $CODE_PATH - -RUN apt-get update \ - && apt-get install --no-install-recommends -y \ - make \ - git \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# For pre-commit -# TODO PRE_COMMIT_HOME -RUN mkdir -p $XDG_CONFIG_HOME/git \ - && touch $XDG_CONFIG_HOME/git/config \ - && chown -R $USER_ID:$GROUP_ID $XDG_CONFIG_HOME \ - && git config --global safe.directory $CODE_PATH - - -FROM python-base as builder-base -RUN set -ex \ - && apt-get update \ - && apt-get install --no-install-recommends -y \ - # deps for building python deps - build-essential \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN python -m venv $VENV_PATH -RUN pip install poetry==$POETRY_VERSION - - -# `development` image is used during development / testing -FROM python-base as development -ENV PYTHONDONTWRITEBYTECODE=1 -WORKDIR $CODE_PATH - -COPY --from=builder-base $VENV_PATH $VENV_PATH - -USER $USER_NAME - -CMD ["poetry", "install"] diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 067a228..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- - -x-common: &common - build: - target: development - context: . - dockerfile: Dockerfile-dev - args: - - PYTHON_VERSION=${PYTHON_VERSION:-3.11} - image: "picodi:dev" -# env_file: .env - volumes: - - .:/opt/code - -services: - devtools: - <<: *common - command: sleep infinity - - app: - <<: *common - restart: "no" - ports: - - "8000:8000"