Skip to content

Commit

Permalink
chore: sync project template
Browse files Browse the repository at this point in the history
  • Loading branch information
makkus committed Jun 17, 2024
1 parent f3a18c7 commit 8588be0
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/DHARPA-Project/kiara_plugin.develop.git",
"commit": "29494cbc7b4f042d1780806a7baf3fe90e344f24",
"commit": "3a24ac33e10ccf160aa6beb5486aec151610fd99",
"context": {
"cookiecutter": {
"full_name": "Markus Binsteiner",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: "darwin tests for 'kiara_plugin.tabular'"
# This workflow is triggered on pushes to the repository.
on: [push]
env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
MACOSX_DEPLOYMENT_TARGET: 10.15

jobs:
test-darwin:
name: pytest on darwin
runs-on: macos-11
runs-on: macos-14
strategy:
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
Expand All @@ -22,7 +22,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python_version }}
key: ${{ runner.os }}-pip-${{ matrix.python_version }}-macos-14
- uses: actions/checkout@v4
- name: install kiara_plugin.tabular
run: pip install -U .[dev_testing]
Expand Down
16 changes: 10 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,43 @@ default_language_version:
repos:

- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: 'v9.3.0'
rev: 'v9.15.0'
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional']

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 24.3.0
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.6.1' # Use the sha / tag you want to point at
rev: 'v1.9.0' # Use the sha / tag you want to point at
hooks:
- id: mypy
files: "^src/"
pass_filenames: true
args: ["--config-file", "pyproject.toml", "--ignore-missing-imports"]
additional_dependencies: [pydantic>=2.0.0, rich>=10.0.0, ruamel.yaml, anyio>=3.0.0, pyzmq>=22.0.3, bidict, sqlalchemy-stubs, types-python-slugify, types-setuptools, types-python-dateutil, dag_cbor, multiformats, textual, regex, types-pytz, types-orjson]

- repo: https://github.com/charliermarsh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.1.4'
rev: v0.4.1
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
#- id: ruff-format

- repo: https://github.com/Kludex/no-optional
rev: 0.4.0
hooks:
- id: no_optional

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.3.0'
rev: 'v4.5.0'
hooks:
- id: trailing-whitespace
exclude: 'setup.cfg'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The recommended way to setup a development environment is to use [pixi](https://
Once you have `pixi` installed, you need to initialize the environment once:

```
pixi run install-dev-env
pixi run install-dev-dependencies
```

You also need to do this whenever a depdendency of this plugin is updated (for example the core `kiara` package).
Expand Down Expand Up @@ -78,7 +78,7 @@ In most cases it's recommended to use a pixi shell though.

### Using pre-defined development-related tasks

The included `pixi.toml` file includes some useful tasks that help with development:
The included `pyproject.toml` file includes some useful tasks that help with development:

- `pixi run pre-commit-check`: runs a set of checks against all files
- `pixi run tests`: runs the unit tests
Expand Down
21 changes: 0 additions & 21 deletions pixi.toml

This file was deleted.

29 changes: 23 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ dev_testing = [
dev_utils = [
"kiara[dev_utils]",
]
dev_all = [
"kiara[dev_all]"
]
streamlit = [
"kiara_plugin.streamlit"
]

[project.entry-points."kiara.plugin"]
tabular = "kiara_plugin.tabular"
Expand Down Expand Up @@ -257,3 +251,26 @@ module = [
"appdirs.*",
]
ignore_missing_imports = true

[tool.pixi.project]
channels = ["dharpa", "conda-forge"]
platforms = ["linux-64", "win-64", "osx-64", "osx-arm64"]

[tool.pixi.dependencies]
pip = ">=24.0,<25"

[tool.pixi.pypi-dependencies]
tabular = { path = ".", editable = true }

[tool.pixi.environments]
default = { solve-group = "default" }
#dev = { features = ["dev_utils"], solve-group = "default" }

[tool.pixi.tasks]
pre-commit-check = "pre-commit run --all-files"
tests = "py.test"
mypy = "mypy --namespace-packages --explicit-package-base src/kiara_plugin/tabular"
kiara = "kiara"
show-versions = "kiara --version"
delete-context = "kiara context delete"
install-dev-dependencies = "pip install --upgrade -e '.[dev_utils]'"
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from pathlib import Path

import pytest
from _pytest.compat import NotSetType

from kiara.api import JobDesc, KiaraAPI
from kiara.context import KiaraConfig
Expand All @@ -40,6 +41,10 @@ def create_temp_dir():


def get_job_alias(job_desc: JobDesc) -> str:

if isinstance(job_desc, NotSetType):
return "-- no example jobs --"

return job_desc.job_alias


Expand Down

0 comments on commit 8588be0

Please sign in to comment.