-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3217d85
commit 9da7e6c
Showing
10 changed files
with
192 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,39 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile | ||
{ | ||
"name": "Existing Dockerfile", | ||
"build": { | ||
// Sets the run context to one level up instead of the .devcontainer folder. | ||
"context": "..", | ||
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. | ||
"dockerfile": "../Dockerfile" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"charliermarsh.ruff", | ||
"ms-python.black-formatter", | ||
"ms-azuretools.vscode-docker", | ||
"ms-vscode.makefile-tools", | ||
"github.vscode-github-actions" | ||
] | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {} | ||
}, | ||
"postStartCommand": "pip install -e ." | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Uncomment the next line to run commands after the container is created. | ||
// "postCreateCommand": "cat /etc/os-release", | ||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "devcontainer" | ||
"name": "Existing Dockerfile", | ||
"build": { | ||
// Sets the run context to one level up instead of the .devcontainer folder. | ||
"context": "..", | ||
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. | ||
"dockerfile": "../Dockerfile", | ||
"cacheFrom": "ghcr.io/martinbernstorff/personal-mnemonic-medium:latest" | ||
}, | ||
// "features": {}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"GitHub.copilot", | ||
"charliermarsh.ruff", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"GitHub.vscode-pull-request-github", | ||
"ms-vscode.makefile-tools", | ||
"github.vscode-github-actions", | ||
] | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {} | ||
}, | ||
"postStartCommand": "make install" | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Uncomment the next line to run commands after the container is created. | ||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "devcontainer" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
# GitHub action to check if pre-commit has been run. Runs from .pre-commit-config.yaml, where the pre-commit actions are. | ||
|
||
name: validate | ||
# This workflow will install Python dependencies, run pytests and run notebooks | ||
# then it will in python 3.9 (ubuntu-latest) create a badge with the coverage | ||
# and add it to the PR. This badge will be updated if the PR is updated. | ||
|
||
name: Tests | ||
on: | ||
pull_request: | ||
branches: [main] | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
build-and-test: | ||
permissions: write-all | ||
concurrency: | ||
group: "${{ github.workflow }} @ ${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
@@ -22,14 +24,15 @@ jobs: | |
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
username: MartinBernstorff | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Pre-build dev container image | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: ghcr.io/martinbernstorff/personal-mnemonic-medium | ||
cacheFrom: ghcr.io/martinbernstorff/personal-mnemonic-medium | ||
push: always | ||
imageName: ghcr.io/martinbernstorff/personal-mnemonic-medium-devcontainer | ||
cacheFrom: ghcr.io/martinbernstorff/personal-mnemonic-medium-devcontainer:latest | ||
push: filter | ||
refFilterForPush: refs/heads/main | ||
runCmd: | ||
make validate | ||
make validate |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
{ | ||
"python.analysis.typeCheckingMode": "strict", | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
"personal_mnemonic_medium" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"python.analysis.typeCheckingMode": "strict", | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter" | ||
"explorer.excludeGitIgnore": false, | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"**/Thumbs.db": true, | ||
"**/BUILD": true | ||
}, | ||
"python.formatting.provider": "none" | ||
"python.analysis.diagnosticMode": "workspace" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,43 @@ | ||
lint: | ||
@echo Running black | ||
black . | ||
SRC_PATH = personal_mnemonic_medium | ||
|
||
@echo Running ruff | ||
install-dev: | ||
pip install -r dev-requirements.txt | ||
|
||
install-deps: | ||
pip install -r requirements.txt | ||
|
||
install: | ||
make install-deps | ||
make install-dev | ||
pip install -e . | ||
|
||
test: ## Run tests | ||
pytest $(SRC_PATH) | ||
|
||
lint: ## Format code | ||
ruff check . --fix | ||
ruff format . | ||
|
||
test: | ||
@echo ––– Testing ––– | ||
pytest -n auto -rfE --failed-first --disable-warnings -q | ||
type-check: ## Type-check code | ||
pyright $(SRC_PATH) | ||
|
||
type-check: | ||
@echo ––– Running static type checks ––– | ||
pyright . | ||
validate: ## Run all checks | ||
make lint | ||
make type-check | ||
make test | ||
|
||
install: | ||
pip install --upgrade -e .[dev,tests] | ||
sync-pr: | ||
git push --set-upstream origin HEAD | ||
git push | ||
|
||
validate: | ||
@echo ––– Ensuring dependencies are up to date. This will take a few moments --- | ||
@make install > /dev/null | ||
@make lint && make type-check && make test | ||
create-pr: | ||
gh pr create -w || true | ||
|
||
pr: | ||
gh pr create -w | ||
merge-pr: | ||
gh pr merge --auto --merge --delete-branch | ||
|
||
pr: ## Run relevant tests before PR | ||
make sync-pr | ||
make create-pr | ||
make validate | ||
git push | ||
gh pr merge --auto --merge | ||
make merge-pr |
Oops, something went wrong.