Skip to content

Commit

Permalink
Testing devenv and dev containers
Browse files Browse the repository at this point in the history
  • Loading branch information
myoung34 committed Jul 3, 2024
1 parent 7ad8b3f commit 7eb94ff
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.8
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
POETRY_VERSION=1.6.0 \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_HOME="/opt/poetry" \
AWS_DEFAULT_REGION="us-east-1"

ENV PATH="$POETRY_HOME/bin:/src/.venv/bin:$PATH"

RUN pip3 install poetry
RUN poetry config virtualenvs.create false
COPY poetry.lock pyproject.toml /src/
WORKDIR /src
RUN poetry install -n --no-ansi

11 changes: 11 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Yawps",
"dockerFile": "Dockerfile",
"postCreateCommand": "poetry install -n --no-ansi",
"containerEnv": {
"MY_VARIABLE": "1"
},
"shutdownAction": "none",
"privileged": true,
"capAdd": []
}
4 changes: 4 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
yawps:
build:
dockerfile: Dockerfile.dev
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ config.ini
.venv
.vscode
junit.html
.devenv
.idea
61 changes: 61 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{ pkgs, lib, config, inputs, ... }:

{

packages = [
];

languages.python = {
enable = true;
version = "3.8.19";
poetry = {
enable = true;
install = {
enable = true;
installRootPackage = false;
onlyInstallRootPackage = false;
compile = false;
quiet = false;
groups = [ ];
ignoredGroups = [ ];
onlyGroups = [ ];
extras = [ ];
allExtras = false;
verbosity = "no";
};
activate.enable = true;
package = pkgs.poetry;
};
};

# https://devenv.sh/basics/
env.GREET = "devenv";

# https://devenv.sh/scripts/
scripts.hello.exec = "echo hello from $GREET";

enterShell = ''
hello
git --version
'';

# https://devenv.sh/tests/
enterTest = ''
echo "Running tests"
git --version | grep "2.42.0"
'';

# https://devenv.sh/services/
# services.postgres.enable = true;

# https://devenv.sh/languages/
# languages.nix.enable = true;

# https://devenv.sh/pre-commit-hooks/
# pre-commit.hooks.shellcheck.enable = true;

# https://devenv.sh/processes/
# processes.ping.exec = "ping example.com";

# See full reference at https://devenv.sh/reference/options/
}

0 comments on commit 7eb94ff

Please sign in to comment.