This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
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.
- Loading branch information
LeeeeT
committed
Jan 12, 2023
1 parent
a60d623
commit d61a69d
Showing
128 changed files
with
1,628 additions
and
1,107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "Valtypes", | ||
"image": "mcr.microsoft.com/devcontainers/python:0-3.11", | ||
"features": { | ||
"ghcr.io/devcontainers/features/git:1": {}, | ||
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": { | ||
"plugins": [ | ||
"zsh-autosuggestions zsh-syntax-highlighting" | ||
], | ||
"omzPlugins": [ | ||
"https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-syntax-highlighting" | ||
] | ||
}, | ||
"ghcr.io/devcontainers-contrib/features/poetry:2": {} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.isort", | ||
"bungcip.better-toml", | ||
"ryanluker.vscode-coverage-gutters" | ||
] | ||
} | ||
}, | ||
"postCreateCommand": "poetry 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Build Dev Container image | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
name: Build Dev Container image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Login to GHCR | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: ghcr.io/${{ github.repository }} | ||
cacheFrom: ghcr.io/${{ github.repository }} | ||
push: always |
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 |
---|---|---|
|
@@ -9,185 +9,50 @@ on: | |
jobs: | ||
flake8: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ '3.11' ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Restore cache and venv | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache | ||
.venv | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install Poetry | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-in-project: true | ||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: poetry install --with dev | ||
- uses: actions/checkout@v3 | ||
- name: Run flake8 | ||
run: | | ||
source .venv/bin/activate | ||
pre-commit run --all-files flake8 | ||
uses: devcontainers/[email protected] | ||
with: | ||
cacheFrom: ghcr.io/${{ github.repository }} | ||
runCmd: poetry run pre-commit run --all-files flake8 | ||
|
||
# mypy: | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# python-version: [ '3.11' ] | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# - name: Setup Python | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: ${{ matrix.python-version }} | ||
# - name: Restore cache and venv | ||
# id: cache | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: | | ||
# ~/.cache | ||
# .venv | ||
# key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
# - name: Restore mypy cache | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: .mypy_cache | ||
# key: ${{ matrix.python-version }} | ||
# - name: Install Poetry | ||
# if: steps.cache.outputs.cache-hit != 'true' | ||
# uses: snok/[email protected] | ||
# with: | ||
# virtualenvs-in-project: true | ||
# - name: Install dependencies | ||
# if: steps.cache.outputs.cache-hit != 'true' | ||
# run: poetry install --with dev | ||
# - name: Run mypy | ||
# run: | | ||
# source .venv/bin/activate | ||
# pre-commit run --all-files mypy | ||
# mypy: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Run mypy | ||
# uses: devcontainers/[email protected] | ||
# with: | ||
# cacheFrom: ghcr.io/${{ github.repository }} | ||
# runCmd: poetry run pre-commit run --all-files mypy | ||
|
||
pyright: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ '3.11' ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Restore cache and venv | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache | ||
.venv | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install Poetry | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-in-project: true | ||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: poetry install --with dev | ||
- uses: actions/checkout@v3 | ||
- name: Run pyright | ||
run: | | ||
source .venv/bin/activate | ||
pre-commit run --all-files pyright | ||
uses: devcontainers/[email protected] | ||
with: | ||
cacheFrom: ghcr.io/${{ github.repository }} | ||
runCmd: poetry run pre-commit run --all-files pyright | ||
|
||
pyright-verify: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ '3.11' ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Restore cache and venv | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache | ||
.venv | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install Poetry | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-in-project: true | ||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: poetry install --with dev | ||
- uses: actions/checkout@v3 | ||
- name: Run pyright-verify | ||
run: | | ||
source .venv/bin/activate | ||
pre-commit run --all-files pyright-verify | ||
uses: devcontainers/[email protected] | ||
with: | ||
cacheFrom: ghcr.io/${{ github.repository }} | ||
runCmd: poetry run pre-commit run --all-files pyright-verify | ||
|
||
pytest: | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macos-latest ] | ||
python-version: [ '3.11' ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Restore cache and venv | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache | ||
.venv | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Restore pytest cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: .pytest_cache | ||
key: pytest-${{ runner.os }}-${{ matrix.python-version }} | ||
- name: Install Poetry | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
uses: snok/[email protected] | ||
- uses: actions/checkout@v3 | ||
- name: Run pytest | ||
uses: devcontainers/[email protected] | ||
with: | ||
virtualenvs-in-project: true | ||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: poetry install --with dev | ||
- name: Run pytest on Windows | ||
if: runner.os == 'Windows' | ||
run: | | ||
source .venv/scripts/activate | ||
pre-commit run --all-files pytest | ||
- name: Run pytest on normal OS | ||
if: runner.os != 'Windows' | ||
run: | | ||
source .venv/bin/activate | ||
pre-commit run --all-files pytest | ||
cacheFrom: ghcr.io/${{ github.repository }} | ||
runCmd: poetry run pre-commit run --all-files pytest |
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 |
---|---|---|
|
@@ -9,18 +9,12 @@ jobs: | |
name: Publish release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-create: false | ||
- uses: actions/checkout@v3 | ||
- name: Build the package | ||
run: poetry build | ||
uses: devcontainers/[email protected] | ||
with: | ||
cacheFrom: ghcr.io/${{ github.repository }} | ||
runCmd: poetry build | ||
- name: Publish the package to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
|
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,62 +1,57 @@ | ||
ci: | ||
autofix_commit_msg: 'refactor: auto fixes from pre-commit hooks' | ||
autoupdate_commit_msg: 'build(deps): update pre-commit hooks' | ||
skip: [ pyproject-flake8, pyright, pyright-verify, pytest ] | ||
|
||
repos: | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.11.4 | ||
- repo: local | ||
hooks: | ||
- id: isort | ||
name: isort | ||
entry: poetry run isort | ||
language: system | ||
pass_filenames: false | ||
stages: [ commit ] | ||
|
||
- repo: https://github.com/aio-libs/sort-all | ||
rev: v1.2.0 | ||
hooks: | ||
- id: sort-all | ||
name: sort-all | ||
entry: poetry run sort-all | ||
language: system | ||
stages: [ commit ] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.12.0 | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: poetry run black . | ||
language: system | ||
pass_filenames: false | ||
stages: [ commit ] | ||
|
||
- repo: https://github.com/csachs/pyproject-flake8 | ||
rev: v6.0.0.post1 | ||
hooks: | ||
- id: pyproject-flake8 | ||
- id: flake8 | ||
name: flake8 | ||
alias: flake8 | ||
entry: poetry run pflake8 valtypes tests testing | ||
language: system | ||
pass_filenames: false | ||
stages: [ commit ] | ||
|
||
- repo: local | ||
hooks: | ||
# - id: mypy | ||
# name: mypy | ||
# entry: bash -c "pip install poetry && poetry install --with mypy && mypy" | ||
# language: system | ||
# pass_filenames: false | ||
# stages: [ commit ] | ||
# - id: mypy | ||
# name: mypy | ||
# entry: poetry run mypy | ||
# language: system | ||
# pass_filenames: false | ||
# stages: [ commit ] | ||
|
||
- id: pyright | ||
name: pyright | ||
entry: bash -c "pip install poetry && poetry install --with pyright && pyright" | ||
entry: poetry run pyright | ||
language: system | ||
pass_filenames: false | ||
stages: [ commit ] | ||
|
||
- id: pyright-verify | ||
name: pyright-verify | ||
entry: bash -c "pip install poetry && poetry install --with pyright-verify && pyright --verifytypes valtypes" | ||
entry: poetry run pyright --verifytypes valtypes | ||
language: system | ||
pass_filenames: false | ||
stages: [ commit ] | ||
|
||
- id: pytest | ||
name: pytest | ||
entry: bash -c "pip install poetry && poetry install --with pytest && pytest" | ||
entry: poetry run pytest | ||
language: system | ||
pass_filenames: false | ||
stages: [ commit ] |
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,7 @@ | ||
{ | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
"python.testing.pytestEnabled": true, | ||
"python.formatting.provider": "black", | ||
"python.analysis.typeCheckingMode": "strict", | ||
"python.linting.enabled": false, | ||
} |
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
Oops, something went wrong.