Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mnbf9rca committed Nov 4, 2023
1 parent 5bb7bd4 commit 956d023
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"image": "mcr.microsoft.com/devcontainers/python:3.10-bullseye",
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/jlaundry/devcontainer-features/azure-functions-core-tools:1": {
"version": "4"
},
"ghcr.io/devcontainers-contrib/features/poetry:2": {
"version": "1.6.1"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "lts"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-azurefunctions",
"ms-vscode.azure-account",
"ms-python.python",
"ms-vscode-remote.vscode-remote-extensionpack",
"GitHub.codespaces",
"ms-azuretools.vscode-azureresourcegroups",
"ms-python.flake8",
"ms-python.black-formatter",
"ms-python.isort",
"GitHub.copilot",
"GitHub.copilot-labs",
"github.vscode-github-actions",
"dotenv.dotenv-vscode"
]
}
},
"postAttachCommand": "python3 -m venv venv && source venv/bin/activate && poetry install --with test,dev --no-interaction --no-root --sync"
}
26 changes: 26 additions & 0 deletions .env.vault
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#/-------------------.env.vault---------------------/
#/ cloud-agnostic vaulting standard /
#/ [how it works](https://dotenv.org/env-vault) /
#/--------------------------------------------------/

#
# Hello 👋,
#
# Your environment variables will be encrypted and
# safely stored in this .env.vault file, after you
# run the login, push, and build commands.
#
# Next run:
#
# $ npx dotenv-vault@latest login
#
#
# You can safely commit this file to code.
#
# Enjoy. 🌴
#

#/----------------settings/metadata-----------------/
DOTENV_VAULT="vlt_74a0d969328c24c44288572b0b90e05a3a6f0377d071632083d71c74c28ab188"
DOTENV_API_URL="https://vault.dotenv.org"
DOTENV_CLI="npx dotenv-vault@latest"
56 changes: 56 additions & 0 deletions .github/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Run pytest

on:
push:
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]

steps:

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4
with:
python-version: ${{ matrix.python-version }}

- uses: snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b # v1
with:
version: 1.6.1 # pin the version as they keep changing their APIs
virtualenvs-create: false
virtualenvs-in-project: false

- name: Install dependencies
run: |
python -m venv venv
. venv/bin/activate
poetry install --with test --without dev --no-interaction --no-root --sync
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
python -c "import os; print(os.environ['VIRTUAL_ENV'])"
- name: Lint with flake8
run: |
. venv/bin/activate
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
env:
DOTENV_KEY: ${{ secrets.DOTENV_KEY }}
run: |
. venv/bin/activate
pytest --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,9 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

.env*
.flaskenv*
!.env.project
!.env.vault
!.env.example
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.poetry]
name = "ohme-client"
version = "0.1.0"
description = ""
authors = ["mnbf9rca <[email protected]>"]
license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = ">3.9,<3.12"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 956d023

Please sign in to comment.