Skip to content

Commit

Permalink
Prepare dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
langestefan committed Sep 5, 2023
1 parent 17d65d6 commit 70f2f12
Show file tree
Hide file tree
Showing 41 changed files with 796 additions and 1,803 deletions.
24 changes: 12 additions & 12 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM mcr.microsoft.com/devcontainers/python:3

RUN python -m pip install --upgrade pip \
&& python -m pip install 'flit>=3.8.0'

ENV FLIT_ROOT_INSTALL=1

COPY pyproject.toml .
RUN touch README.md \
&& mkdir -p src/python_package \
&& python -m flit install --only-deps --deps develop \
&& rm -r pyproject.toml README.md src
FROM mcr.microsoft.com/devcontainers/python:3

RUN python -m pip install --upgrade pip \
&& python -m pip install 'flit>=3.8.0'

ENV FLIT_ROOT_INSTALL=1

COPY pyproject.toml .
RUN touch README.md \
&& mkdir -p src/python_package \
&& python -m flit install --only-deps --deps develop \
&& rm -r pyproject.toml README.md src
88 changes: 44 additions & 44 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda
{
"name": "Python Environment",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig",
"github.vscode-pull-request-github",
"ms-azuretools.vscode-docker",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.pylint",
"ms-python.isort",
"ms-python.flake8",
"ms-python.black-formatter",
"ms-vsliveshare.vsliveshare",
"ryanluker.vscode-coverage-gutters",
"bungcip.better-toml",
"GitHub.copilot"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"black-formatter.path": [
"/usr/local/py-utils/bin/black"
],
"pylint.path": [
"/usr/local/py-utils/bin/pylint"
],
"flake8.path": [
"/usr/local/py-utils/bin/flake8"
],
"isort.path": [
"/usr/local/py-utils/bin/isort"
]
}
}
},
"onCreateCommand": "pre-commit install-hooks"
}
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda
{
"name": "Python Environment",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig",
"github.vscode-pull-request-github",
"ms-azuretools.vscode-docker",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.pylint",
"ms-python.isort",
"ms-python.flake8",
"ms-python.black-formatter",
"ms-vsliveshare.vsliveshare",
"ryanluker.vscode-coverage-gutters",
"bungcip.better-toml",
"GitHub.copilot"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"black-formatter.path": [
"/usr/local/py-utils/bin/black"
],
"pylint.path": [
"/usr/local/py-utils/bin/pylint"
],
"flake8.path": [
"/usr/local/py-utils/bin/flake8"
],
"isort.path": [
"/usr/local/py-utils/bin/isort"
]
}
}
},
"onCreateCommand": "pre-commit install-hooks"
}
44 changes: 22 additions & 22 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
time: "13:00"
open-pull-requests-limit: 10
reviewers:
- dciborow
allow:
- dependency-type: direct
- dependency-type: indirect
commit-message:
prefix: "fix: "
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "13:00"
commit-message:
prefix: "fix: "
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
time: "13:00"
open-pull-requests-limit: 10
reviewers:
- dciborow
allow:
- dependency-type: direct
- dependency-type: indirect
commit-message:
prefix: "fix: "
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "13:00"
commit-message:
prefix: "fix: "
42 changes: 21 additions & 21 deletions .github/template-sync.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
files:
- ".gitignore" # include
- ".github"
- ".vscode"
- "tests/conftest.py"
- ".flake8"
- ".pre-commit-config.yml"
- ".pypirc"
- "docs"
- "src/README.md"
- "CODE_OF_CONDUCT.md"
- "LICENSE"
- "README.md"
- "SECURITY.md"
- "SUPPORT.md"
- "pyproject.toml"

- "!.github/workflows/template-sync.yml"
- "!.github/template-sync.yml"
- "!src/python_project"
- "!tests/test_methods.py"
files:
- ".gitignore" # include
- ".github"
- ".vscode"
- "tests/conftest.py"
- ".flake8"
- ".pre-commit-config.yml"
- ".pypirc"
- "docs"
- "src/README.md"
- "CODE_OF_CONDUCT.md"
- "LICENSE"
- "README.md"
- "SECURITY.md"
- "SUPPORT.md"
- "pyproject.toml"

- "!.github/workflows/template-sync.yml"
- "!.github/template-sync.yml"
- "!src/python_project"
- "!tests/test_methods.py"
42 changes: 21 additions & 21 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Python CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]
workflow_dispatch:

jobs:
validation:
uses: microsoft/action-python/.github/workflows/[email protected]
with:
workdir: '.'

publish:
uses: microsoft/action-python/.github/workflows/[email protected]
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
name: Python CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]
workflow_dispatch:

jobs:
validation:
uses: microsoft/action-python/.github/workflows/[email protected]
with:
workdir: '.'

publish:
uses: microsoft/action-python/.github/workflows/[email protected]
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
20 changes: 10 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Python Publish Workflow
on:
workflow_call:

jobs:
publish:
uses: microsoft/action-python/.github/workflows/[email protected]
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
name: Python Publish Workflow
on:
workflow_call:

jobs:
publish:
uses: microsoft/action-python/.github/workflows/[email protected]
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
50 changes: 25 additions & 25 deletions .github/workflows/schedule-update-actions.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: GitHub Actions Version Updater

# Controls when the action will run.
on:
workflow_dispatch:
schedule:
# Automatically run on every Sunday
- cron: '0 0 * * 0'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.PAT }}

- name: Run GitHub Actions Version Updater
uses: saadmk11/[email protected]
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.PAT }}
pull_request_title: "ci: Update GitHub Actions to Latest Version"
name: GitHub Actions Version Updater

# Controls when the action will run.
on:
workflow_dispatch:
schedule:
# Automatically run on every Sunday
- cron: '0 0 * * 0'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.PAT }}

- name: Run GitHub Actions Version Updater
uses: saadmk11/[email protected]
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.PAT }}
pull_request_title: "ci: Update GitHub Actions to Latest Version"
34 changes: 17 additions & 17 deletions .github/workflows/semantic-pr-check.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: "Semantic PR Check"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: "Semantic PR Check"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 18 additions & 18 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Deploy Sphinx documentation to Pages

on:
push:
branches: [main] # branch to trigger deployment

jobs:
pages:
runs-on: ubuntu-20.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- id: deployment
uses: sphinx-notes/pages@v3
name: Deploy Sphinx documentation to Pages

on:
push:
branches: [main] # branch to trigger deployment

jobs:
pages:
runs-on: ubuntu-20.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- id: deployment
uses: sphinx-notes/pages@v3
Loading

0 comments on commit 70f2f12

Please sign in to comment.