Skip to content

Commit

Permalink
v1.13.8
Browse files Browse the repository at this point in the history
Release v1.13.8
  • Loading branch information
leoschwarz authored Oct 3, 2024
2 parents 3e8b913 + ee91713 commit 8c74f22
Show file tree
Hide file tree
Showing 151 changed files with 884 additions and 166 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/complete_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Complete Release
on:
push:
branches: [stable]
# TODO remove after testing
workflow_dispatch:
jobs:
create_tag:
name: Create Tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Git Config
run: |
git config --global user.name "bfabricPy Bot"
git config --global user.email "bfabricpy-bot-noreply@fgcz.ethz.ch"
- name: Create tag (with Python)
run: |
set -euxo pipefail
# Find the version
VERSION=$(python3 -c "import tomllib; from pathlib import Path; print(tomllib.loads(Path('pyproject.toml').read_text())['project']['version'], end='')")
# Check if tag exists
if git rev-parse $VERSION >/dev/null 2>&1; then
echo "Tag $VERSION already exists"
exit 1
fi
# Create tag
git tag -a $VERSION -m "Release $VERSION"
# Push tag
git push origin $VERSION
publish_documentation:
name: Publish Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-bfabricpy
with:
python-version: 3.12
- name: Publish documentation
run: |
set -euxo pipefail
git fetch --unshallow origin gh-pages
git checkout gh-pages && git pull && git checkout -
uv run mkdocs gh-deploy
9 changes: 5 additions & 4 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-bfabricpy
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install nox
run: pip install nox uv
- name: Run unit tests
# Note: we use cd to double-check that the installation actually worked
run: cd bfabric/tests && pytest ./unit
run: nox -s tests
code_style:
name: Code Style
runs-on: ubuntu-latest
Expand All @@ -34,7 +35,7 @@ jobs:
- uses: actions/checkout@v4
- run: sudo apt-get install -y ripgrep
name: Install ripgrep
- run: rg -n TODO bfabric
- run: rg -n TODO .
name: List TODOs
license_check:
name: License Check
Expand Down
12 changes: 0 additions & 12 deletions bfabric/experimental/app_interface/app_runner/_spec.py

This file was deleted.

37 changes: 0 additions & 37 deletions bfabric/scripts/bfabric_list_not_existing_storage_directories.py

This file was deleted.

42 changes: 0 additions & 42 deletions bfabric/tests/unit/test_response_format_dict.py

This file was deleted.

24 changes: 24 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,30 @@ Versioning currently follows `X.Y.Z` where

## \[Unreleased\]

## \[1.13.8\] - 2024-10-03

This release contains mainly internal changes and ongoing development on the experimental app interface functionality.

### Added

- Entities can be compared and sorted by ID now.
- Show Python version in version info string.
- Caching for bfabric_list_not_existing_storage_directories.py.
- (experimental) add initial code for a resource based application dispatch
- (experimental) new app_runner cli that integrates all commands into a single interface

### Fixed

- bfabric_read.py is a bit more robust if "name" misses and tabular output is requested.

### Changed

- `bfabric.scripts` has been moved into a namespace package `bfabric_scripts` so we can later split it off.
- (internal) migrate to src layout
- (experimental) the former `process` step of the app runner has been split into a `process` and `collect` step where,
the collect step is responsible for generating the `output.yml` file that will then be used to register the results.
- (experimental) app runner apps by default reuse the default resource

## \[1.13.7\] - 2024-09-17

### Fixed
Expand Down
62 changes: 33 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["bfabric*"]

[project]
name = "bfabric"
description = "Python client for the B-Fabric WSDL API"
version = "1.13.7"
version = "1.13.8"
license = { text = "GPL-3.0" }
authors = [
{name = "Christian Panse", email = "cp@fgcz.ethz.ch"},
Expand All @@ -31,6 +28,8 @@ dependencies = [
"pydantic",
"eval_type_backport; python_version < '3.10'",
"python-dateutil >= 2.9.0",
"cyclopts",
#"platformdirs >= 4.3",
]

[project.optional-dependencies]
Expand All @@ -54,31 +53,31 @@ Homepage = "https://github.com/fgcz/bfabricPy"
Repository = "https://github.com/fgcz/bfabricPy"

[project.scripts]
"bfabric_flask.py"="bfabric.scripts.bfabric_flask:main"
#bfabric_feeder_resource_autoQC="bfabric.scripts.bfabric_feeder_resource_autoQC:main"
"bfabric_list_not_existing_storage_directories.py"="bfabric.scripts.bfabric_list_not_existing_storage_directories:main"
"bfabric_list_not_available_proteomics_workunits.py"="bfabric.scripts.bfabric_list_not_available_proteomics_workunits:main"
"bfabric_list_workunit_parameters.py"="bfabric.scripts.bfabric_list_workunit_parameters:main"
"bfabric_upload_resource.py"="bfabric.scripts.bfabric_upload_resource:main"
"bfabric_logthis.py"="bfabric.scripts.bfabric_logthis:main"
"bfabric_setResourceStatus_available.py"="bfabric.scripts.bfabric_setResourceStatus_available:main"
"bfabric_setExternalJobStatus_done.py"="bfabric.scripts.bfabric_setExternalJobStatus_done:main"
"bfabric_setWorkunitStatus_available.py"="bfabric.scripts.bfabric_setWorkunitStatus:main_available"
"bfabric_setWorkunitStatus_processing.py"="bfabric.scripts.bfabric_setWorkunitStatus:main_processing"
"bfabric_setWorkunitStatus_failed.py"="bfabric.scripts.bfabric_setWorkunitStatus:main_failed"
"bfabric_delete.py"="bfabric.scripts.bfabric_delete:main"
"bfabric_read.py"="bfabric.scripts.bfabric_read:main"
"bfabric_read_samples_of_workunit.py"="bfabric.scripts.bfabric_read_samples_of_workunit:main"
"bfabric_read_samples_from_dataset.py"="bfabric.scripts.bfabric_read_samples_from_dataset:main"
"bfabric_save_csv2dataset.py"="bfabric.scripts.bfabric_save_csv2dataset:main"
"bfabric_save_dataset2csv.py"="bfabric.scripts.bfabric_save_dataset2csv:main"
"bfabric_save_fasta.py"="bfabric.scripts.bfabric_save_fasta:main"
"bfabric_save_importresource_sample.py"="bfabric.scripts.bfabric_save_importresource_sample:main"
"bfabric_save_link_to_workunit.py"="bfabric.scripts.bfabric_save_link_to_workunit:main"
#bfabric_save_resource="bfabric.scripts.bfabric_save_resource:main"
"bfabric_save_workunit_attribute.py"="bfabric.scripts.bfabric_save_workunit_attribute:main"
"bfabric_save_workflowstep.py"="bfabric.scripts.bfabric_save_workflowstep:main"
"bfabric_slurm_queue_status.py"="bfabric.scripts.bfabric_slurm_queue_status:main"
"bfabric_flask.py"="bfabric_scripts.bfabric_flask:main"
#bfabric_feeder_resource_autoQC="bfabric_scripts.bfabric_feeder_resource_autoQC:main"
"bfabric_list_not_existing_storage_directories.py"="bfabric_scripts.bfabric_list_not_existing_storage_directories:main"
"bfabric_list_not_available_proteomics_workunits.py"="bfabric_scripts.bfabric_list_not_available_proteomics_workunits:main"
"bfabric_list_workunit_parameters.py"="bfabric_scripts.bfabric_list_workunit_parameters:main"
"bfabric_upload_resource.py"="bfabric_scripts.bfabric_upload_resource:main"
"bfabric_logthis.py"="bfabric_scripts.bfabric_logthis:main"
"bfabric_setResourceStatus_available.py"="bfabric_scripts.bfabric_setResourceStatus_available:main"
"bfabric_setExternalJobStatus_done.py"="bfabric_scripts.bfabric_setExternalJobStatus_done:main"
"bfabric_setWorkunitStatus_available.py"="bfabric_scripts.bfabric_setWorkunitStatus:main_available"
"bfabric_setWorkunitStatus_processing.py"="bfabric_scripts.bfabric_setWorkunitStatus:main_processing"
"bfabric_setWorkunitStatus_failed.py"="bfabric_scripts.bfabric_setWorkunitStatus:main_failed"
"bfabric_delete.py"="bfabric_scripts.bfabric_delete:main"
"bfabric_read.py"="bfabric_scripts.bfabric_read:main"
"bfabric_read_samples_of_workunit.py"="bfabric_scripts.bfabric_read_samples_of_workunit:main"
"bfabric_read_samples_from_dataset.py"="bfabric_scripts.bfabric_read_samples_from_dataset:main"
"bfabric_save_csv2dataset.py"="bfabric_scripts.bfabric_save_csv2dataset:main"
"bfabric_save_dataset2csv.py"="bfabric_scripts.bfabric_save_dataset2csv:main"
"bfabric_save_fasta.py"="bfabric_scripts.bfabric_save_fasta:main"
"bfabric_save_importresource_sample.py"="bfabric_scripts.bfabric_save_importresource_sample:main"
"bfabric_save_link_to_workunit.py"="bfabric_scripts.bfabric_save_link_to_workunit:main"
#bfabric_save_resource="bfabric_scripts.bfabric_save_resource:main"
"bfabric_save_workunit_attribute.py"="bfabric_scripts.bfabric_save_workunit_attribute:main"
"bfabric_save_workflowstep.py"="bfabric_scripts.bfabric_save_workflowstep:main"
"bfabric_slurm_queue_status.py"="bfabric_scripts.bfabric_slurm_queue_status:main"

[tool.black]
line-length = 120
Expand All @@ -99,3 +98,8 @@ using = "PEP631"

[tool.pytest.ini_options]
logot_capturer = "logot.loguru.LoguruCapturer"

[tool.check-tests-structure]
sources_path = "src/bfabric"
tests_path = "tests/unit"
allow_missing_tests = true
File renamed without changes.
4 changes: 3 additions & 1 deletion bfabric/bfabric.py → src/bfabric/bfabric.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import base64
import importlib.metadata
import sys
from contextlib import AbstractContextManager
from contextlib import contextmanager
from datetime import datetime
Expand Down Expand Up @@ -257,8 +258,9 @@ def _get_version_message(self) -> tuple[str, str]:
engine_name = self._engine.__class__.__name__
base_url = self.config.base_url
user_name = f"U={self._auth.login if self._auth else None}"
python_version = f"PY={sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
return (
f"bfabricPy v{package_version} ({engine_name}, {base_url}, {user_name})",
f"bfabricPy v{package_version} ({engine_name}, {base_url}, {user_name}, {python_version})",
f"Copyright (C) 2014-{year} Functional Genomics Center Zurich",
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ def get(self, key: str, default: Any = None) -> Any:
"""Returns the value of a key in the data dictionary, or a default value if the key is not present."""
return self.__data_dict.get(key, default)

def __lt__(self, other: Entity) -> bool:
"""Compares the entity with another entity based on their IDs."""
if self.ENDPOINT != other.ENDPOINT:
return NotImplemented
return self.id < other.id

def __repr__(self) -> str:
"""Returns the string representation of the workunit."""
return f"{self.__class__.__name__}({repr(self.__data_dict)}, client={repr(self.__client)})"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8c74f22

Please sign in to comment.