Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #1

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# syntax=docker/dockerfile:1

###############################################################################
# Stage 1: Base image
###############################################################################

ARG PYTHON_VERSION=3.13.0
FROM python:${PYTHON_VERSION} as base

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
git \
zsh \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

###############################################################################
# Stage 2: Poetry Install
###############################################################################

FROM base as poetry-installer

ENV POETRY_VIRTUALENVS_IN_PROJECT=false \
POETRY_NO_INTERACTION=1

RUN curl -sSL https://install.python-poetry.org | python3 - \
&& ln -s /root/.local/bin/poetry /usr/local/bin/poetry

###############################################################################
# Stage 3: Zsh Configuration
###############################################################################

FROM poetry-installer as zsh-config

ENV ZSH_CUSTOM=/root/.oh-my-zsh/custom

# Install Oh My Zsh and clone plugins
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \
&& git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM}/plugins/zsh-autosuggestions \
&& git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM}/plugins/fast-syntax-highlighting

# Clone asdf scripts
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf

# Install direnv
RUN curl -sfL https://direnv.net/install.sh | bash

COPY .devcontainer/override.zshrc /tmp/override.zshrc
RUN cat /tmp/override.zshrc >> ~/.zshrc \
&& chsh -s $(which zsh)

###############################################################################
# Stage 4: Development
###############################################################################

FROM zsh-config as development

WORKDIR /workspaces/jupyterhub

ENV SHELL=/bin/zsh

CMD ["zsh"]
85 changes: 85 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"name": "PAC Jupyterhub Dev Env",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"PYTHON_VERSION": "3.13.0"
}
},
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": true,
"installDockerBuildx": true,
"version": "latest",
"dockerDashComposeVersion": "v2"
}
},
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"customizations": {
"vscode": {
"extensions": [
"charliermarsh.ruff",
"davidanson.vscode-markdownlint",
"EditorConfig.EditorConfig",
"github.vscode-github-actions",
"ms-azuretools.vscode-docker",
"ms-python.mypy-type-checker",
"ms-python.python",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker-cspell-bundled-dictionaries",
"tamasfe.even-better-toml",
"tekumara.typos-vscode"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.formatting.provider": "none",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.analysis.typeCheckingMode": "basic",
"python.analysis.diagnosticMode": "workspace",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"editor.suggestSelection": "first",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"editor.rulers": [
80
]
},
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint",
"editor.wordWrap": "on",
"editor.rulers": [
80
]
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml",
"editor.autoIndent": "keep"
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"mypy.runUsingActiveInterpreter": true
}
}
},
"postCreateCommand": "[ -d .venv ] && rm -rf .venv; make venv && . .venv/bin/activate && make install",
"remoteUser": "root"
}
24 changes: 24 additions & 0 deletions .devcontainer/override.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Path to your oh-my-zsh installation
export ZSH="/root/.oh-my-zsh"

# Plugins
plugins=(
asdf # Sets up asdf version manager
direnv # Loads .envrc files
git # Adds git command aliases and useful prompt info
docker # Provides docker command completion and aliases
zsh-autosuggestions # Suggests commands based on history
fast-syntax-highlighting # Adds syntax highlighting while typing
)

# Load oh-my-zsh with the configured settings
source $ZSH/oh-my-zsh.sh

# Load asdf
. "$HOME/.asdf/asdf.sh"

# Initialize direnv
eval "$(direnv hook zsh)"

# Attempt to activate the Python virtual environment for every session
source /workspaces/jupyterhub/.venv/bin/activate 2>/dev/null || true
38 changes: 38 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Ignore cache
__pycache__/
*.pyc
*.pyo
*.pyd
.ruff_cache/

# Ignore virtual environments
.venv/

# Ignore version control files and directories
.git/
.gitignore

# Ignore CI/CD and deployment-related files
.github/
.dockerignore
.pre-commit-config.yaml
.safety-policy.yml
.readthedocs.yaml
.yamllint.yaml
.tool-versions

# Ignore markdown files (e.g., documentation)
*.md

# Ignore environment files (for local development)
.env

# Ignore deployment files
deployment/

# Ignore documentation and images
docs/
images/

# Ignore test files and directories
tests/
28 changes: 28 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# EditorConfig is a file format that helps maintain consistent coding styles
# https://editorconfig.org/

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

# Python files
[*.py]
max_line_length = 80
quote_type = double

[*.md]
max_line_length = 80

[*.{json,yml,yaml}]
indent_size = 2

[Makefile]
indent_style = tab
30 changes: 30 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Auto detect text files and perform line-ending normalization
* text=auto

# Python files
*.py text diff=python
*.pyi text diff=python

# Documentation
*.md text diff=markdown
*.rst text diff=rst
*.bat text eol=crlf
Makefile text eol=lf

# Configuration files
*.toml text diff=toml
*.json text

# SVG treated as binary to prevent merge conflicts
*.svg binary

# Declare files that should have specific line endings
LICENSE text eol=lf

# Exclude files from statistics
images/* linguist-vendored
docs/* linguist-documentation

# Fix syntax highlighting on GitHub to allow comments
.devcontainer.json linguist-language=JSON-with-Comments
devcontainer.json linguist-language=JSON-with-Comments
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: 🪲 Bug Report
description: Report a bug
title: "[Bug 🪲]: "
labels: ["bug"]
body:
- type: input
id: description
attributes:
label: Description
description: Small description of the bug
placeholder: "I have a problem with..."
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Steps to reproduce the bug
value: |
1. Step 1
2. Step 2
3. Step 3
validations:
required: false
- type: textarea
id: traceback
attributes:
label: Error Traceback
description: Full error traceback if applicable
render: python
validations:
required: false
- type: textarea
id: dependencies
attributes:
label: Dependencies
description: Output of `pip freeze`
render: text
validations:
required: false
- type: textarea
id: environment
attributes:
label: environment
description: Output of `poetry env info`
render: text
validations:
required: false
...
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
blank_issues_enabled: false
...
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/dependency-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: 📦 Dependency Issue
description: Report dependency conflicts or version issues
title: "[Deps 📦]: "
labels: ["dependencies"]
body:
- type: textarea
id: conflict
attributes:
label: Conflict Description
description: Describe the dependency conflict
validations:
required: true
- type: textarea
id: dependencies
attributes:
label: Dependencies
description: Output of `pip freeze`
render: text
validations:
required: true
- type: textarea
id: environment
attributes:
label: environment
description: Output of `poetry env info`
render: text
validations:
required: true
...
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: 📚 Documentation Issue
description: Report issues with documentation
title: "[Docs 📚]: "
labels: ["documentation"]
body:
- type: input
id: page_url
attributes:
label: Documentation Page URL
description: Link to the documentation page
validations:
required: true
- type: textarea
id: issue_description
attributes:
label: Issue Description
description: Describe what needs to be updated
validations:
required: true
...
Loading
Loading