Skip to content

Commit 4e1237a

Browse files
authored
Merge pull request #9 from VectorInstitute/add_pyproject.toml
Add pyproject.toml and run pre-commit
2 parents 1515fe9 + 89d31ca commit 4e1237a

File tree

15 files changed

+1558
-45
lines changed

15 files changed

+1558
-45
lines changed

.github/workflows/deploy_coder_gcp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Terraform Init
4141
working-directory: ${{ env.TF_DIR }}
4242
run: terraform init -backend-config="bucket=${{ vars.TF_STATE_BUCKET }}"
43-
43+
4444
- name: Replace env variables in startup script
4545
working-directory: ${{ env.TF_DIR }}
4646
run: |
@@ -79,7 +79,7 @@ jobs:
7979
with:
8080
name: tf-artifacts
8181
path: ${{ env.TF_DIR }}
82-
82+
8383
- name: Grant execute permissions to Terraform folder
8484
working-directory: ${{ env.TF_DIR }}
8585
run: chmod -R +x .terraform/

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ terraform.tfvars
2929
.terraform.lock.hcl
3030
.terraform.tfstate.lock.info
3131

32-
.coder
32+
.coder

.pre-commit-config.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0 # Use the ref you want to point at
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: check-ast
7+
- id: check-builtin-literals
8+
- id: check-docstring-first
9+
- id: check-executables-have-shebangs
10+
- id: debug-statements
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
args: [--fix=lf]
14+
- id: fix-byte-order-marker
15+
- id: check-merge-conflict
16+
- id: check-symlinks
17+
- id: detect-private-key
18+
- id: check-yaml
19+
args: [--unsafe]
20+
- id: check-toml
21+
22+
- repo: https://github.com/astral-sh/uv-pre-commit
23+
rev: 0.8.23
24+
hooks:
25+
- id: uv-lock
26+
27+
- repo: https://github.com/astral-sh/ruff-pre-commit
28+
rev: 'v0.13.3'
29+
hooks:
30+
- id: ruff-check
31+
args: [--fix, --exit-non-zero-on-fix]
32+
types_or: [python, jupyter]
33+
- id: ruff-format
34+
types_or: [python, jupyter]
35+
36+
- repo: https://github.com/pre-commit/mirrors-mypy
37+
rev: v1.18.2
38+
hooks:
39+
- id: mypy
40+
entry: python3 -m mypy --config-file pyproject.toml
41+
language: system
42+
types: [python]
43+
exclude: "tests"
44+
45+
- repo: https://github.com/crate-ci/typos
46+
rev: v1
47+
hooks:
48+
- id: typos
49+
args: []
50+
51+
ci:
52+
autofix_commit_msg: |
53+
[pre-commit.ci] Add auto fixes from pre-commit.com hooks
54+
55+
for more information, see https://pre-commit.ci
56+
autofix_prs: true
57+
autoupdate_branch: ''
58+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
59+
autoupdate_schedule: weekly
60+
skip: [pytest,doctest,mypy]
61+
submodules: false

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ The folder `coder` contains all resources needed to deploy a [Coder](https://cod
66

77
### Structure
88

9-
- **deploy/**
10-
Terraform scripts and startup automation for provisioning the Coder server on a GCP VM.
11-
12-
- **docker/**
13-
Dockerfiles and guides for building custom images used by Coder workspace templates.
9+
- **deploy/**
10+
Terraform scripts and startup automation for provisioning the Coder server on a GCP VM.
1411

15-
- **templates/**
16-
Coder workspace templates for reproducible, containerized development environments on GCP.
12+
- **docker/**
13+
Dockerfiles and guides for building custom images used by Coder workspace templates.
14+
15+
- **templates/**
16+
Coder workspace templates for reproducible, containerized development environments on GCP.
1717

1818
## Usage
1919

20-
1. **Provision Coder on GCP**
20+
1. **Provision Coder on GCP**
2121
Follow the steps in [`deploy/README.md`](coder/deploy/README.md) to set up your GCP environment and deploy the Coder server using Terraform.
2222

23-
2. **Build and Push Docker Images**
23+
2. **Build and Push Docker Images**
2424
Use [`docker/README.md`](coder/docker/README.md) to build and upload Docker images required by your templates.
2525

26-
3. **Push Workspace Templates**
27-
See [`templates/README.md`](coder/templates/README.md) for instructions on uploading workspace templates to your Coder instance.
26+
3. **Push Workspace Templates**
27+
See [`templates/README.md`](coder/templates/README.md) for instructions on uploading workspace templates to your Coder instance.

coder/cli_scripts/suspend_users.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,3 @@ if [[ ${error_count} -gt 0 ]]; then
145145
else
146146
log_success "Script completed successfully"
147147
fi
148-

coder/deploy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ You'll need a `terraform.tfvars` file in this folder. Copy over the example file
3838

3939
### Stop the instance
4040

41-
terraform destroy -var-file=../terraform.tfvars
41+
terraform destroy -var-file=../terraform.tfvars

coder/deploy/backend.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
terraform {
22
backend "gcs" {}
3-
}
3+
}

coder/deploy/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ variable "service_account_email" {
2525

2626
variable "vm_name" {
2727
type = string
28-
}
28+
}

coder/templates/bootcamp/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ This template provisions Coder workspaces on Google Cloud Platform (GCP) for Vec
2121

2222
## Usage
2323

24-
1. **Configure Variables**
24+
1. **Configure Variables**
2525
Copy `terraform.tfvars.example` to `terraform.tfvars` and update values:
2626
- `project`, `region`, `zone`: GCP settings
2727
- `machine_type`: VM type (e.g., `e2-medium`)
2828
- `container_image`: Docker image URI
2929
- `jupyterlab`, `codeserver`, `streamlit`: `"true"` or `"false"` to enable apps
3030
- `github_repo`, `github_branch`: Repository and branch to clone
3131

32-
2. **Push Template to Coder**
32+
2. **Push Template to Coder**
3333
```sh
3434
coder login <your-coder-instance-url>
3535
cp terraform.tfvars.example terraform.tfvars
3636
coder templates push
3737
```
3838

39-
3. **Verify Workspace**
39+
3. **Verify Workspace**
4040
Launch a workspace from the Coder dashboard and confirm your environment is set up.
4141

4242
## Reference
@@ -45,5 +45,5 @@ This template provisions Coder workspaces on Google Cloud Platform (GCP) for Vec
4545
- [GCP VM Documentation](https://cloud.google.com/compute/docs/instances)
4646
- [Docker Build & Push Guide](../../docker/README.md)
4747

48-
> **Note:**
49-
> This template is a starting point. Customize the Terraform files and Docker images to fit your
48+
> **Note:**
49+
> This template is a starting point. Customize the Terraform files and Docker images to fit your

coder/templates/bootcamp/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ variable github_app_id {
4747

4848
variable container_image {
4949
type = string
50-
}
50+
}

0 commit comments

Comments
 (0)