Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: psf/black@stable
4 changes: 2 additions & 2 deletions .github/workflows/cli-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6

- uses: actions/setup-python@v1
- uses: actions/setup-python@v6
with:
python-version: '3.10'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ to increase readability, maintainability, and user experience of pepdbagent, whi
- <u>Sample</u>: Handles the creation, modification, and deletion of samples, without modification of the entire project.
- <u>View</u>: Manages the creation, modification, and deletion of views for specific projects.
- <u>User</u>: Contains user-related information such as favorites and other user-related data.
- <u>Schema</u>: Provides information and functions related to the user schemas.

## Example:

Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.12.4] -- 2026-01-26
- Added project search by tag in annotation module
- Updated github actions workflows


## [0.12.3] -- 2025-04-03
- Fixed models for schema records and versions

Expand Down
2 changes: 1 addition & 1 deletion pepdbagent/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.12.3"
__version__ = "0.12.4"
14 changes: 14 additions & 0 deletions pepdbagent/modules/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def get(
count=self._count_projects(
namespace=namespace,
search_str=query,
tag=tag,
admin=admin,
filter_by=filter_by,
filter_end_date=filter_end_date,
Expand All @@ -115,6 +116,7 @@ def get(
results=self._get_projects(
namespace=namespace,
search_str=query,
tag=tag,
admin=admin,
offset=offset,
limit=limit,
Expand Down Expand Up @@ -235,6 +237,7 @@ def _count_projects(
self,
namespace: str = None,
search_str: str = None,
tag: str = None,
admin: Union[str, List[str]] = None,
filter_by: Optional[Literal["submission_date", "last_update_date"]] = None,
filter_start_date: Optional[str] = None,
Expand All @@ -246,6 +249,7 @@ def _count_projects(

:param namespace: namespace where to search for a project
:param search_str: search string. will be searched in name, tag and description information
:param tag: tag of the projects (find projects with specific tag)
:param admin: string or list of admins [e.g. "Khoroshevskyi", or ["doc_adin","Khoroshevskyi"]]
:param filter_by: data to use filter on.
Options: ["submission_date", "last_update_date"]
Expand All @@ -270,6 +274,8 @@ def _count_projects(
)
if pep_type:
statement = statement.where(Projects.pop.is_(pep_type == "pop"))
if tag:
statement = statement.where(Projects.tag == tag)
result = self._pep_db_engine.session_execute(statement).first()

try:
Expand All @@ -280,6 +286,7 @@ def _count_projects(
def _get_projects(
self,
namespace: str = None,
tag: str = None,
search_str: str = None,
admin: Union[str, List[str]] = None,
limit: int = DEFAULT_LIMIT,
Expand All @@ -295,6 +302,7 @@ def _get_projects(
Get projects by providing search string.

:param namespace: namespace where to search for a project
:param tag: tag of the projects (find projects with specific tag)
:param search_str: search string that has to be found in the name or tag
:param admin: True, if user is admin of the namespace [Default: False]
:param limit: limit of return results
Expand Down Expand Up @@ -322,6 +330,7 @@ def _get_projects(
namespace=namespace,
search_str=search_str,
admin_list=admin,
tag=tag,
)
statement = self._add_date_filter_if_provided(
statement, filter_by, filter_start_date, filter_end_date
Expand Down Expand Up @@ -406,6 +415,7 @@ def _add_condition(
namespace: str = None,
search_str: str = None,
admin_list: Union[str, List[str]] = None,
tag: str = None,
) -> Select:
"""
Add where clause to sqlalchemy statement (in project search)
Expand All @@ -414,6 +424,7 @@ def _add_condition(
:param namespace: project namespace sql:(where namespace = "")
:param search_str: search string that has to be found in the name or tag
:param admin_list: list or string of admin rights to namespace
:param tag: tag of the projects (find projects with specific tag)
:return: sqlalchemy representation of a SELECT statement with where clause.
"""
admin_list = tuple_converter(admin_list)
Expand All @@ -428,6 +439,9 @@ def _add_condition(
if namespace:
statement = statement.where(Projects.namespace == namespace)

if tag:
statement = statement.where(Projects.tag == tag)

statement = statement.where(
or_(Projects.private.is_(False), Projects.namespace.in_(admin_list))
)
Expand Down
Loading