Skip to content

Commit

Permalink
feat!: major overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
EuleMitKeule committed Dec 1, 2024
1 parent cb9799e commit 721ad35
Show file tree
Hide file tree
Showing 45 changed files with 2,686 additions and 5,010 deletions.
36 changes: 9 additions & 27 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,41 +69,23 @@ jobs:
with:
python-version: "3.13"

- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-3.13

- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached Poetry venv
id: cached-poetry-venv
uses: actions/cache@v4
with:
path: .venv
key: poetry-venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-3.13

- name: Install dependencies
if: steps.cached-poetry-venv.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
python-version: "3.13"
enable-cache: true
cache-suffix: uv-${{ runner.os }}-3.13

- name: Install package
run: poetry install --no-interaction
- name: Install dependecies
run: uv sync

- name: Set package version
run: |
poetry version ${{ needs.version.outputs.version }}
uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version ${{ needs.version.outputs.version }}
- name: Build package
run: |
poetry build
uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
135 changes: 34 additions & 101 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: uv-${{ runner.os }}-${{ matrix.python-version }}

- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}

- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached Poetry venv
id: cached-poetry-venv
uses: actions/cache@v4
with:
path: .venv
key: poetry-venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}

- name: Install dependencies
if: steps.cached-poetry-venv.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install package
run: poetry install --no-interaction
- name: Install dependecies
run: uv sync --all-extras

ruff:
needs: cache
Expand All @@ -73,30 +50,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: uv-${{ runner.os }}-${{ matrix.python-version }}

- name: Load cached Poetry installation
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}

- name: Load cached Poetry venv
uses: actions/cache@v4
with:
path: ~/.venv
key: poetry-venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}

- name: Install package
run: |
poetry install --no-interaction
- name: Install dependecies
run: uv sync --all-extras

- name: Run ruff
run: |
poetry run ruff eq3btsmart
uv run ruff check .
mypy:
needs: cache
Expand All @@ -110,30 +76,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: uv-${{ runner.os }}-${{ matrix.python-version }}

- name: Load cached Poetry installation
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}

- name: Load cached Poetry venv
uses: actions/cache@v4
with:
path: ~/.venv
key: poetry-venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}

- name: Install package
run: |
poetry install --no-interaction
- name: Install dependecies
run: uv sync --all-extras

- name: Run mypy
run: |
poetry run mypy eq3btsmart
uv run mypy --strict .
tests:
needs: cache
Expand All @@ -147,30 +102,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: uv-${{ runner.os }}-${{ matrix.python-version }}

- name: Load cached Poetry installation
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}

- name: Load cached Poetry venv
uses: actions/cache@v4
with:
path: ~/.venv
key: poetry-venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}

- name: Install package
run: |
poetry install --no-interaction
- name: Install dependecies
run: uv sync --all-extras

- name: Run tests
run: |
poetry run pytest --cov=eq3btsmart --cov-report=xml --cov-report=term tests
uv run pytest --cov=. --cov-report=term tests
sonar:
needs: cache
Expand All @@ -186,30 +130,19 @@ jobs:
with:
fetch-depth: 0

- name: Install Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: uv-${{ runner.os }}-${{ matrix.python-version }}

- name: Load cached Poetry installation
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}

- name: Load cached Poetry venv
uses: actions/cache@v4
with:
path: ~/.venv
key: poetry-venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-${{ matrix.python-version }}

- name: Install package
run: |
poetry install --no-interaction
- name: Install dependecies
run: uv sync --all-extras

- name: Run tests
run: |
poetry run pytest --cov=eq3btsmart --cov-report=xml --cov-report=term tests
uv run pytest --cov=. --cov-report=xml --cov-report=term tests
- name: fix code coverage paths
run: |
Expand Down
23 changes: 0 additions & 23 deletions .pre-commit-config.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
7 changes: 0 additions & 7 deletions .vscode/extensions.json

This file was deleted.

39 changes: 2 additions & 37 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,4 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.formatOnSave": true,
"ruff.codeAction.disableRuleComment": {
"enable": false
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
},
"python.analysis.autoImportCompletions": true,
"python.analysis.packageIndexDepths": [
{
"name": "",
"depth": 4,
"includeAllSymbols": true
}
],
"mypy.extraArguments": [
"--exclude=.venv",
"--check-untyped-defs",
],
"editor.indentSize": 4,
"files.exclude": {
"**/.git": true,
"**/.venv": true,
"**/__pycache__": true,
"**/.mypy_cache": true,
"**/.pytest_cache": true,
"**/.ruff_cache": true,
"**/dist": true,
},
"extensions.ignoreRecommendations": false,
"python.testing.pytestArgs": [
"tests",
]
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
67 changes: 0 additions & 67 deletions eq3btsmart/adapter/base_adapter.py

This file was deleted.

Loading

0 comments on commit 721ad35

Please sign in to comment.