Skip to content

Commit

Permalink
Sync with template
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeNaccarato committed Jul 23, 2024
1 parent c171825 commit 766338d
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 2024.1.1-91-g2217ca3
_commit: 2024.1.1-173-ga81e7e6
_src_path: gh:blakeNaccarato/copier-python
actions_runner: ubuntu-22.04
active: true
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "devcontainer",
"image": "mcr.microsoft.com/devcontainers/base:1.1.1-ubuntu-22.04",
"image": "mcr.microsoft.com/devcontainers/base:1.1.2-ubuntu-22.04",
"features": {
"ghcr.io/devcontainers/features/powershell:1.4.0": {
"version": "7.4.1"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/changerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
strategy:
matrix:
runner: ["ubuntu-22.04"]
python: ["3.11"]
permissions:
contents: "write"
runs-on: "${{ matrix.runner }}"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defaults:
run:
shell: "pwsh"
env:
UV_CACHE_DIR: ".cache/uv-cache"
UV_CACHE_DIR: "../uv-cache"
UV_SYSTEM_PYTHON: "true"
jobs:
sync:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1"
- run: ". scripts/Initialize-Shell.ps1; sphinx-build -EaT docs _site"
- run: "sphinx-build -EaT docs _site"
- uses: "actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa" # v3.0.1
deploy-docs:
if: github.event_name != 'pull_request'
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1"
- run: ". scripts/Initialize-Shell.ps1; ruff check --no-fix --output-format github ."
- run: "ruff check --no-fix --output-format github ."
fawltydeps:
needs: "sync"
strategy:
Expand All @@ -123,7 +123,7 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1"
- run: ". scripts/Initialize-Shell.ps1; fawltydeps"
- run: "fawltydeps"
pyright:
needs: "sync"
strategy:
Expand All @@ -146,9 +146,9 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1"
- uses: "jakebailey/pyright-action@3bdde3b31d26f0f1f5de051b1fbd7a536a9a4e7f" # v4.1.7
- uses: "jakebailey/pyright-action@3bdde3b31d26f0f1f5de051b1fbd7a536a9a4e7f" # v2.3.1
with:
pylance-version: "2024.6.1"
pylance-version: "${{ env.PYRIGHT_PYTHON_PYLANCE_VERSION }}"
test:
needs: "sync"
strategy:
Expand Down Expand Up @@ -176,14 +176,14 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1 -Version '${{ matrix.python }}'"
# ! https://github.com/pytest-dev/pytest-cov/issues/479#issuecomment-1247444988
- run: ". scripts/Initialize-Shell.ps1; pytest --cov --cov-config pyproject.toml"
- run: "pytest --cov --cov-config=pyproject.toml --cov-report=xml"
- if: startsWith(matrix.runner, 'ubuntu') && matrix.python == '3.11'
uses: "codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673" # v4.5.0
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
lock:
needs:
- "build-docs"
- "ruff"
- "fawltydeps"
- "pyright"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defaults:
run:
shell: "pwsh"
env:
UV_CACHE_DIR: ".cache/uv-cache"
UV_CACHE_DIR: "../uv-cache"
SYNC_PY_DISABLE_CI: True
jobs:
no-spaces-in-path:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- uses: "actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9" # v4.0.2
with:
path: "${{ env.UV_CACHE_DIR }}"
key: "uv-${{ matrix.runner }}-${{ matrix.python }}-${{ hashFiles('lock.json') }}"
key: "uv-${{ matrix.runner }}-${{ matrix.python }}-${{ hashFiles('repo path with spaces/lock.json') }}"
- uses: "actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d" # v5.1.0
with:
python-version: "${{ matrix.python }}"
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/high.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaults:
run:
shell: "pwsh"
env:
UV_CACHE_DIR: ".cache/uv-cache"
UV_CACHE_DIR: "../uv-cache"
UV_SYSTEM_PYTHON: "true"
SYNC_PY_HIGH: "true"
jobs:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1"
- run: ". scripts/Initialize-Shell.ps1; sphinx-build -EaT docs _site"
- run: "sphinx-build -EaT docs _site"
- uses: "actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa" # v3.0.1
ruff:
needs: "sync"
Expand All @@ -68,7 +68,7 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1"
- run: ". scripts/Initialize-Shell.ps1; ruff check --no-fix --output-format github ."
- run: "ruff check --no-fix --output-format github ."
fawltydeps:
needs: "sync"
strategy:
Expand All @@ -87,7 +87,7 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1"
- run: ". scripts/Initialize-Shell.ps1; fawltydeps"
- run: "fawltydeps"
pyright:
needs: "sync"
strategy:
Expand All @@ -106,9 +106,9 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1"
- uses: "jakebailey/pyright-action@3bdde3b31d26f0f1f5de051b1fbd7a536a9a4e7f" # v4.1.7
- uses: "jakebailey/pyright-action@3bdde3b31d26f0f1f5de051b1fbd7a536a9a4e7f" # v2.3.1
with:
pylance-version: "2024.6.1"
pylance-version: "${{ env.PYRIGHT_PYTHON_PYLANCE_VERSION }}"
test:
needs: "sync"
strategy:
Expand All @@ -132,9 +132,10 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1 -Version '${{ matrix.python }}'"
- run: ". scripts/Initialize-Shell.ps1; pytest"
- run: "pytest --cov --cov-config=pyproject.toml --cov-report=xml"
lock:
needs:
- "build-docs"
- "ruff"
- "fawltydeps"
- "pyright"
Expand All @@ -148,6 +149,8 @@ jobs:
runs-on: "${{ matrix.runner }}"
steps:
- uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7
with:
submodules: True
- uses: "actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e" # v4.1.7
with:
name: "lock"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
python-version: "${{ matrix.python }}"
- run: "scripts/Sync-Py.ps1 -Release"
- run: ". scripts/Initialize-Shell.ps1; python -m build --installer uv"
- run: "python -m build --installer uv"
- uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
with:
subject-path: "dist/**"
Expand Down
8 changes: 0 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ci:
- "fawltydeps-docs"
- "fawltydeps-scripts"
- "fawltydeps-tests"
- "pyright"
- "pytest-fast-only"
- "dvc-post-checkout"
- "dvc-pre-push"
Expand Down Expand Up @@ -69,13 +68,6 @@ repos:
files: "^tests/.*$"
entry: |
pwsh -Command ". scripts/Initialize-Shell.ps1; fawltydeps --config-file tests/pyproject.toml"
- id: "pyright"
name: "pyright"
pass_filenames: false
language: "system"
entry: |
pwsh -Command ". scripts/Initialize-Shell.ps1; pyright"
types_or: ["python", "pyi"]
- id: "pytest-fast-only"
name: "pytest-fast-only"
pass_filenames: false
Expand Down
17 changes: 17 additions & 0 deletions .renovaterc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,30 @@
"enabled": true
},
"enabledManagers": [
"custom.regex",
"devcontainer",
"git-submodules",
"github-actions",
"pep621",
"pip_requirements",
"pre-commit"
],
"customManagers": [
{
"description": "Pylance",
"customType": "regex",
"fileMatch": [
"^scripts/Initialize-Shell\\.ps1$",
"^\\.devcontainer/devcontainer\\.json$"
],
"matchStrings": [
"PYRIGHT_PYTHON_PYLANCE_VERSION = '(?<currentValue>.+)'",
"ms-python\\.vscode-pylance@(?<currentValue>[^\"]+)"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "microsoft/pylance-release"
}
],
"pip_requirements": {
"description": "Additionally monitor these files",
"fileMatch": ["(^|/)requirements/.+$"]
Expand Down
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"aaron-bond.better-comments",
"bierner.markdown-mermaid",
"bierner.markdown-preview-github-styles",
"charliermarsh.ruff",
"davidanson.vscode-markdownlint",
"donjayamanne.githistory",
"eamodio.gitlens",
Expand All @@ -13,12 +14,16 @@
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"ms-azuretools.vscode-docker",
"ms-python.debugpy",
"ms-python.python",
"ms-toolsai.jupyter",
"ms-vscode.powershell",
"ms-vscode-remote.remote-containers",
"njpwerner.autodocstring",
"njpwerner.autodocstring",
"redhat.vscode-yaml",
"rodolphebarbanneau.python-docstring-highlighter",
"rodolphebarbanneau.python-docstring-highlighter",
"ryanluker.vscode-coverage-gutters",
"sourcery.sourcery",
"stkb.rewrap",
Expand Down
11 changes: 9 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@
{
"label": "task: pre-commit",
"type": "shell",
"command": ". scripts/Initialize-Shell.ps1; pre-commit",
"command": ". scripts/Initialize-Shell.ps1; pre-commit run --verbose",
"icon": { "id": "git-commit" },
"problemMatcher": []
},
{
"label": "task: pre-commit (all)",
"type": "shell",
"command": ". scripts/Initialize-Shell.ps1; pre-commit run --all-files",
"command": ". scripts/Initialize-Shell.ps1; pre-commit run --all-files --verbose",
"icon": { "id": "git-commit" },
"problemMatcher": []
},
Expand All @@ -181,6 +181,13 @@
"icon": { "id": "versions" },
"problemMatcher": []
},
{
"label": "task: Run pytest with coverage",
"type": "shell",
"command": ". scripts/Initialize-Shell.ps1; pytest --cov --cov-config pyproject.toml --cov-report xml",
"icon": { "id": "check" },
"problemMatcher": []
},
{
"label": "task: Run ruff",
"type": "shell",
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# boilercore

[![All Contributors](https://img.shields.io/github/all-contributors/softboiler/boilercore?color=ee8449&style=flat-square)](../README.md#contributors)
[![All Contributors](https://img.shields.io/github/all-contributors/softboiler/boilercore?color=ee8449&style=flat-square)](contributors)

Common functionality of boiler repositories.

Expand Down
21 changes: 3 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ addopts = '''
--color=yes
-p no:legacypaths
-r a
--cov
--cov-config=pyproject.toml
--cov-report=xml
--plots=tests/plots
'''
cache_dir = ".cache/.pytest_cache"
Expand Down Expand Up @@ -108,20 +105,8 @@ name = "Changes"
showcontent = true

[tool.pyright]
exclude = [
"**/node_modules",
"**/__pycache__",
"**/.*",
"**/.*/**",
"**/.venv",
"**/.vscode/extensions",
"**/AppData",
"bin",
"submodules/template",
"submodules/**/docs",
"submodules/**/scripts",
"submodules/**/tests",
]
stubPath = "submodules/stubs/stubs"
ignore = ["bin", "submodules", "scripts/install.py"]
typeCheckingMode = "strict"
# Default "true" in strict
analyzeUnannotatedFunctions = true
Expand Down Expand Up @@ -220,7 +205,7 @@ reportUnusedCallResult = "none"

[tool.ruff]
cache-dir = ".cache/.ruff_cache"
extend-exclude = ["bin", "submodules"]
extend-exclude = ["bin", "submodules", "scripts/install.py"]
extend-include = ["*.ipynb"]
src = ["src", "docs", "scripts", "tests"]
output-format = "grouped"
Expand Down
3 changes: 2 additions & 1 deletion scripts/Initialize-Repo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ catch [System.Management.Automation.NativeCommandExitException] { $fresh = $true

git add .
git commit --no-verify -m 'Prepare template using blakeNaccarato/copier-python'
git submodule add --force --name template 'https://github.com/blakeNaccarato/copier-python.git' submodules/template
git submodule add --force --name 'template' 'https://github.com/blakeNaccarato/copier-python.git' 'submodules/template'
git submodule add --force --name 'stubs' 'https://github.com/microsoft/python-type-stubs.git' 'submodules/stubs'
git add .
git commit --no-verify -m 'Add template and type stub submodules'
scripts/Sync-Py.ps1
Expand Down
Loading

0 comments on commit 766338d

Please sign in to comment.