Skip to content

Commit 89dc9ed

Browse files
authored
Fix: devcontainer build and run for Linux host (#12)
2 parents dbf78d8 + d8b6b2d commit 89dc9ed

File tree

6 files changed

+24
-15
lines changed

6 files changed

+24
-15
lines changed

.config/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# `.config` directory
2+
3+
This directory is where local GAM and GYB configuration is stored.
4+
5+
The directoy's contents (except for this README) are ignored in `.gitignore` to
6+
avoid committing sensitive information.

.devcontainer/Dockerfile

+5-8
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,21 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
66
PYTHONUNBUFFERED=1 \
77
USER=compiler
88

9-
RUN useradd --create-home --shell /bin/bash $USER && \
10-
chown -R $USER /home/$USER
9+
RUN useradd --create-home --shell /bin/bash $USER
1110

1211
USER $USER
1312
ENV PATH "$PATH:/home/$USER/.local/bin"
1413
WORKDIR /home/$USER/admin
1514

1615
RUN python -m pip install --upgrade pip
1716

17+
COPY .git .git
1818
COPY compiler_admin compiler_admin
1919
COPY pyproject.toml pyproject.toml
2020
RUN pip install -e .[dev,test]
2121

22-
# install pre-commit environments in throwaway Git repository
23-
# https://stackoverflow.com/a/68758943
24-
COPY .pre-commit-config.yaml .
25-
RUN git init . && \
26-
pre-commit install-hooks && \
27-
rm -rf .git
22+
USER root
23+
RUN chown -R $USER /home/$USER
24+
USER $USER
2825

2926
CMD ["sleep", "infinity"]

.devcontainer/devcontainer.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"dockerComposeFile": ["../compose.yaml"],
44
"service": "dev",
55
"workspaceFolder": "/home/compiler/admin",
6+
"postAttachCommand": ["/bin/bash", ".devcontainer/postAttach.sh"],
67
"customizations": {
78
"vscode": {
89
// Set *default* container specific settings.json values on container create.

.devcontainer/postAttach.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
pre-commit install --install-hooks

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
GYB-GMail-Backup-*/
22
__pycache__
3-
.config
3+
.config/*
4+
!.config/README.md
45
.coverage
56
.downloads
67
.pytest_cache

pyproject.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = [
1111
]
1212
requires-python = ">=3.11"
1313
dependencies = [
14-
"advanced-gam-for-google-workspace @ git+https://github.com/taers232c/GAMADV-XTD3.git@v6.61.14#subdirectory=src"
14+
"advanced-gam-for-google-workspace @ git+https://github.com/taers232c/GAMADV-XTD3.git@v6.71.15#subdirectory=src"
1515
]
1616

1717
[project.urls]
@@ -23,7 +23,8 @@ dev = [
2323
"black",
2424
"build",
2525
"flake8",
26-
"pre-commit"
26+
"pre-commit",
27+
"setuptools_scm>=8"
2728
]
2829
test = [
2930
"coverage",
@@ -35,7 +36,7 @@ test = [
3536
compiler-admin = "compiler_admin.main:main"
3637

3738
[build-system]
38-
requires = ["setuptools>=64", "wheel", "setuptools-git-versioning<2"]
39+
requires = ["setuptools>=65", "setuptools-scm>=8"]
3940
build-backend = "setuptools.build_meta"
4041

4142
[tool.black]
@@ -63,6 +64,5 @@ norecursedirs = [
6364
".vscode",
6465
]
6566

66-
[tool.setuptools-git-versioning]
67-
enabled = true
68-
dev_template = "{tag}+{ccount}.{sha}"
67+
[tool.setuptools_scm]
68+
# intentionally left blank, but we need the section header to activate the tool

0 commit comments

Comments
 (0)