Skip to content

Commit

Permalink
Merge pull request #43 from eduardoklosowski/refactor-project-struct
Browse files Browse the repository at this point in the history
Refactor project struct
  • Loading branch information
eduardoklosowski authored Sep 5, 2024
2 parents 41e851d + f94f019 commit b9e2426
Show file tree
Hide file tree
Showing 30 changed files with 158 additions and 177 deletions.
61 changes: 32 additions & 29 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
{
"name": "qldebugger",
"name": "qldebugger",

"image": "mcr.microsoft.com/devcontainers/python:3.8-bookworm",
"features": {
"ghcr.io/devcontainers-contrib/features/apt-packages:1": {
"packages": "bash-completion"
},
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
},
"image": "mcr.microsoft.com/devcontainers/python:1-3.8-bookworm",
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {"version": "1.8.3"}
},

"containerUser": "vscode",
"runArgs": [
"--userns=keep-id"
],
"mounts": [
{
"type": "bind",
"source": "/etc/localtime",
"target": "/etc/localtime"
}
],
"mounts": [
{
"type": "bind",
"source": "/etc/localtime",
"target": "/etc/localtime"
}
],

"postCreateCommand": "scripts/update-tools-completion.sh\nscripts/init-project.sh",
"postCreateCommand": "./scripts/setup-devcontainer.sh",

"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig",
"tamasfe.even-better-toml",
"ms-python.autopep8",
"charliermarsh.ruff",
"matangover.mypy"
]
"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig",
"tamasfe.even-better-toml",
"charliermarsh.ruff",
"matangover.mypy"
],
"settings": {
"python.defaultInterpreterPath": "./.venv/bin/python",
"ruff.importStrategy": "fromEnvironment",
"mypy.runUsingActiveInterpreter": true,
"mypy.targets": ["src", "tests"],
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["-vv", "tests"],
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
}
}
}
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@ insert_final_newline = true
[Makefile]
indent_style = tab

[*.toml]
indent_size = 2

[*.{yml,yaml}]
[*.{json,toml,yaml,yml}]
indent_size = 2
44 changes: 20 additions & 24 deletions .github/workflows/check-commit.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
name: Check Commit

on:
workflow_dispatch:
push:
branches:
- "*"
tags:
- "*"
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
name: Check Lints
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup poetry
run: pipx install poetry
run: pipx install poetry==1.8.3

- name: Generate datefile
run: echo "lint-$(date +%U)" > datefile

- name: Setup python
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
Expand All @@ -41,30 +37,30 @@ jobs:
- name: Install dependencies
if: steps.setup-python.outputs.cache-hit != 'true'
run: poetry install --only=main,type,dev
run: poetry install --sync --only=main,type,dev

- name: Run lints
run: make lint

test:
name: Test
runs-on: ubuntu-latest
name: Check Test
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup poetry
run: pipx install poetry
run: pipx install poetry==1.8.3

- name: Generate datefile
run: echo "test-$(date +%U)" > datefile

- name: Setup python
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
Expand All @@ -74,27 +70,27 @@ jobs:
- name: Install dependencies
if: steps.setup-python.outputs.cache-hit != 'true'
run: poetry install --only=main,dev
run: poetry install --sync --only=main,dev

- name: Run tests
run: make test

docs:
name: Docs
name: Check Docs
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup poetry
run: pipx install poetry
run: pipx install poetry==1.8.3

- name: Generate datefile
run: echo "docs-$(date +%U)" > datefile

- name: Setup python
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: poetry
Expand All @@ -104,7 +100,7 @@ jobs:
- name: Install dependencies
if: steps.setup-python.outputs.cache-hit != 'true'
run: poetry install --only=docs
run: poetry install --sync --only=docs

- name: Check build
run: make docs-build
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ permissions:
jobs:
build-package:
name: Build Package
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup python
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"

Expand All @@ -29,7 +29,7 @@ jobs:
run: python -m build

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: packages
path: dist
Expand All @@ -38,18 +38,18 @@ jobs:
github-release:
name: Release on GitHub
needs: build-package
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: packages
path: dist

- name: Make release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
dist/*.tar.gz
Expand All @@ -59,15 +59,15 @@ jobs:
pypi-publish:
name: Publish on PyPI
needs: github-release
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
environment:
name: pypi
url: https://pypi.org/p/qldebugger
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: packages
path: dist
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Python
*.py[cod]
__pycache__
/poetry.lock
/dist

# Development tools
/.venv
/poetry.lock
/dist
/.ruff_cache
/.mypy_cache
/.pytest_cache
Expand All @@ -17,8 +18,7 @@ __pycache__
# Editors
*.swp
/.idea
/.vscode/*
!/.vscode/*.example
/.vscode

# Configs
/qldebugger.toml
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build:
python: "3.8"
jobs:
post_create_environment:
- curl -sSL https://install.python-poetry.org | python3 -
- curl -sSL https://install.python-poetry.org | python3 - --version 1.8.3
- $HOME/.local/bin/poetry config virtualenvs.create false
pre_install:
- $HOME/.local/bin/poetry export --only=docs -o requirements.txt
Expand Down
18 changes: 0 additions & 18 deletions .vscode/settings.json.example

This file was deleted.

Loading

0 comments on commit b9e2426

Please sign in to comment.