-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
delete 2 files, create 10 files and update 23 files delete 2 files an…
…d update 11 files
- Loading branch information
1 parent
e143395
commit 941af47
Showing
37 changed files
with
971 additions
and
432 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY | ||
_commit: 981c40d | ||
_src_path: https://github.com/MartinBernstorff/nimble-python-template | ||
email: [email protected] | ||
full_name: Martin Bernstorff | ||
github_username: MartinBernstorff | ||
package_name: memorymarker | ||
project_name: memorymarker | ||
project_slug: memorymarker | ||
python_version: '3.12' | ||
release_to_pypi: true |
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,43 +1,22 @@ | ||
// 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", | ||
"cacheFrom": "ghcr.io/martinbernstorff/memorymarker-devcontainer:latest" | ||
"dockerfile": "../Dockerfile" | ||
}, | ||
"postCreateCommand": ".devcontainer/post_create.sh", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"GitHub.copilot", | ||
"charliermarsh.ruff", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"GitHub.copilot", | ||
"GitHub.vscode-pull-request-github", | ||
"github.vscode-github-actions", | ||
"SeeLog.python-init-generator", | ||
"tamasfe.even-better-toml", | ||
"MichaelCurrin.auto-commit-msg", | ||
"tamasfe.even-better-toml" | ||
"SeeLog.python-init-generator", | ||
"charliermarsh.ruff", | ||
] | ||
} | ||
}, | ||
"mounts": [ | ||
"source=${localEnv:HOME}/.config/gh/hosts.yml,target=/root/.config/gh/hosts.yml,type=bind,consistency=cache" // GitHub CLI authentication login | ||
], | ||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {} | ||
}, | ||
"postStartCommand": "gt user pager --disable" | ||
// 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 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
set -e | ||
|
||
# Zsh as default terminal | ||
chsh -s $(which zsh) | ||
|
||
# Github CLI | ||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ | ||
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ | ||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ | ||
&& apt update \ | ||
&& apt install gh -y | ||
|
||
# Node | ||
export NVM_DIR="$HOME/.nvm" | ||
mkdir -p $NVM_DIR | ||
export NODE_VERSION="18.2.0" | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \ | ||
&& . $NVM_DIR/nvm.sh \ | ||
&& nvm install $NODE_VERSION \ | ||
&& nvm alias default $NODE_VERSION \ | ||
&& nvm use default | ||
|
||
export NODE_PATH=$NVM_DIR/v$NODE_VERSION/lib/node_modules | ||
export PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH | ||
echo 'export PATH="$PATH:$HOME/.nvm/versions/node/v18.2.0/bin:PATH"' >> ~/.zshrc | ||
|
||
# Graphite | ||
npm install -g @withgraphite/graphite-cli@stable | ||
|
||
# Lefthook | ||
curl -1sLf 'https://dl.cloudsmith.io/public/evilmartians/lefthook/setup.deb.sh' | bash | ||
apt install lefthook | ||
lefthook install |
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,25 +1,9 @@ | ||
## Recommened setup for the repository | ||
### Github personal access token | ||
For pre-commit actions to be able to commit changes to a PR, or for the Cruft update to be able to create a PR with updates from the upstream repo, you need a personal access token (PAT) with the following settings: | ||
|
||
**Expiration**: No expiration | ||
**scopes:** | ||
* `repo` | ||
* `workflow` | ||
|
||
#### Creating the PAT | ||
You can create a personal access token following [this guide](https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). | ||
|
||
#### Adding as a secret in the repo | ||
By default, the actions expect the repository secret to be called `PAT`. Add the PAT as a secret by following [this guide](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository). | ||
|
||
### Github Repository Settings | ||
These are all GitHub settings we recommend enabling, e.g. go to the repository's `Settings > General > Allow auto-merge`. | ||
|
||
* General | ||
* Pull Requests | ||
* Disallow squash commits | ||
* Disallow rebase commits | ||
* Always suggest updating pull request branches | ||
* Allow auto-merge | ||
* Automatically delete head branches | ||
|
@@ -29,12 +13,5 @@ | |
* Require a pull request before merging | ||
* Require status checks to pass before merging | ||
* Require branches to be up to date before merging | ||
* Status checks that are required: | ||
* static_type_checks (type hinting) | ||
* pre-commit (formatting) | ||
* pytest (tests) | ||
* check_for_rej (check for residual cruft updates) | ||
* Require conversation resolution before merging | ||
|
||
### Publishing to PyPI | ||
If do not wish to pypi, you can just delete the `release.yml` file. If you do wish to publish, you need to setup trusted publishing [here](https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/). | ||
* Status checks that are required | ||
* Require conversation resolution before merging |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: automerge-bot-prs | ||
|
||
on: pull_request | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
dependabot-automerge: | ||
runs-on: ubuntu-latest | ||
# if actor is dependabot or pre-commit-ci[bot] then run | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
|
||
steps: | ||
# Checkout action is required for token to persist | ||
- name: Enable auto-merge for Dependabot PRs | ||
run: gh pr merge --auto --merge "$PR_URL" # Use Github CLI to merge automatically the PR | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Auto approve dependabot PRs | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
uses: hmarr/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: test | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout (GitHub) | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build CI container | ||
run: | | ||
make docker_ci |
Oops, something went wrong.